Hey folks, I'm trying to a language switching system in this website. The idea is to have a SPAN which upon hover displays a dropdown box (UL based) that contains a list of available languages. Here's a snapshot of the effect I'm trying to achieve.
The dropdown box is actually an unordered list that is hidden by default. Upon hovering on the span, I'm making the UL visible. Here's the HTML and the CSS.
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; }
But instead of the dropdown appearing aligned with my span, it's appearing at the extreme right end of the browser. Here's the screenshot.
Can any of the CSS gurus here recommend a fix for this?
Thanks, m^e