Swim the bottom to the right in the div

Possible duplicate:
How do I get a div to be placed at the bottom of the container?

I have this code to place a div in the bottom right of a div. But the range is stuck in the upper left.

<div id="color_tile" class="select_tile" title="Choose color" style="background: grey; background-image: url(wallpaper/201_color_picker.jpg);" >    
  <span id="color_picker" style="visibility: visible; display: block; float: right; vertical-align: bottom;"></span>
</div>

Is there any other way to place a range?

+5
source share
2 answers

You should probably separate your HTML / CSS appropriately.

Your code might look something like this.

HTML:

<div>
    <span>Absolute right bottom aligned to div...</span>
</div>

CSS

div { position: relative; }
div > span { position: absolute; right: 0; bottom: 0; }

Obviously your div should have some height / width greater than the width of the range, but this is usually a very acceptable way to do this.

div- , . , , , , , .

+5

vartical-align ( )

: position:absolute; bottom:0; right:0;

/ div,

0

All Articles