I'm currently working on implementing a language switching feature on this website. The concept involves using a SPAN element that reveals a dropdown box (based on UL) containing a list of available languages when hovered over. Below is a preview of the effect I am aiming to achieve.
View Image http://img337.imageshack.us/img337/3474/dropboxfinal.png
The dropdown box is essentially an unordered list that is initially hidden. Upon hovering over the span, I have set it up to make the UL visible. Here's a snippet of the HTML and CSS involved.
HTML
<span id="langswitch">Language↓
<ul id="langlist">
<li class="en">
<a title="Current language: English" href="http://domain/en">
<img width="16" height="13" alt="English Language" src="flag-en.gif" />
English
</a>
</li>
<li class="th">
<a title="Switch to Thai language" href="http://domain/th">
<img width="16" height="13" alt="Thai Language" src="flag-th.gif" />
Thai
</a>
</li>
<li class="zh">
<a title="Switch to Chinese language" href="http://domain/zh">
<img width="16" height="13" alt="Chinese Language" src="flag-zh.gif" />
Chinese
</a>
<li>
</ul>
</span>
CSS
ul#langlist {
border:1px solid #3399CC;
color:#006699;
background:#fff;
padding:0 !important;
width:100px;
list-style:none;
position:absolute;
top:62px;
right:0;
z-index:100;
display:none;
}
span#langswitch:hover ul#langlist { display:block; }
However, rather than the dropdown being aligned with my span as intended, it appears at the far-right edge of the browser window. Please refer to the screenshot below for clarification.
View Image http://img84.imageshack.us/img84/1687/dropbox.png
If any CSS experts out there could suggest a solution to this issue, I would greatly appreciate it!
Thank you, m^e