BoulderBum
Programmer
I have a div that acts as a popup when a user mouses-over an element. The problem is that I want it to be form-fitting and not use a fixed width, but I also want to right align an element at the bottom of the div.
With this setup, however, the div ends up extending all the way to the right of the viewport unless I use a fixed width.
Is there a way I can structure the above markup differently so I have my link right-aligned, but don't have to worry about the div extending all the way to the right of the viewport?
MCP, MCTS - .NET Framework 2.0 Web Applications
Code:
<style type='text/css'>
.comment {
position:absolute;
visibility:hidden; /* changed to visible by javascript */
width:auto; /* <- trouble with this */
}
</style>
...
<div class='comment' />
<div>
<div>text goes here</div>
</div>
<!-- I want the link below right-aligned at the bottom of
the parent DIV -->
<div style='float: right;'>
<a href='#'>click for action</a>
</div>
<br style='clear: both' />
</div>
With this setup, however, the div ends up extending all the way to the right of the viewport unless I use a fixed width.
Is there a way I can structure the above markup differently so I have my link right-aligned, but don't have to worry about the div extending all the way to the right of the viewport?
MCP, MCTS - .NET Framework 2.0 Web Applications