I am trying to align an HTML element on the right even when the window is resized. I have tried using CSS
#goRight
{
align:right;
}
along with float:right: , text-align:right but the problem is that when I decrease the size of the window horizontally the element is cut out and eventually disappears, which is not what I want. Is there a way to keep the element aligned to the right of the active viewing screen?
<div id="address" class="tab">
Filter by:
<hr />
<div class="label">Choices:</div>
<div id="goRight">
<select name="myselect" id="myselect" size="0">
<option>Option1</option>
<option>Option2</option>
<option>Option3</option>
</select>
</div>
<div class="listSeparator"></div>
</div>
float:rightis simply aligns a html element to right, even window size is changed, element will still right aligned.In your case i think another element / style breaks your right align style. Because just
float:rightis works. Simple fiddle at: jsfiddle.net/T5F83