PDA

View Full Version : aligning text to the bottom a div



esthera
Jan 10th, 2007, 05:31 PM
i have a div and I want a link to align to the bottom

how do i do it.

my html is:

<div class=hpbook>

<a href=product.asp?productid=31><img src="/uploads/i2554.39704.jpg" height="110" border="0" alt="test"></a>

<br>
<font class="midle_txt"><a href=product.asp?productid=31>test</a></font> <br>


<a href=product.asp?productid=31 class=more>More</a>


</div>

kaitco
Jan 10th, 2007, 07:18 PM
Use vertical-align through CSS as described here: http://bonrouge.com/br.php?page=faq#valign You would apply the CSS to the class "hpbook."

Your syntax should really look like this instead:

<div class="hpbook">
<a href=product.asp?productid=31><img src="/uploads/i2554.39704.jpg" height="110" alt="test"></a>
<br />
<p class="midle_txt"><a href=product.asp?productid=31>test</a></p>
<br />
<a href=product.asp?productid=31 class=more>More</a>
</div>

The <font> tag is deprecated, so you should not use it. You have the class "midle_txt" already; just apply it to that a <p> tag instead.

esthera
Jan 10th, 2007, 07:23 PM
ok but i want only the more link to be aligned bottom - not everything in the div of hpbook.

harbingerOTV
Jan 11th, 2007, 05:08 AM
<div class=hpbook>
<a href=product.asp?productid=31><img src="/uploads/i2554.39704.jpg" height="110" border="0" alt="test"></a>
<br>
<font class="midle_txt"><a href=product.asp?productid=31>test</a></font> <br>
<a href=product.asp?productid=31 class=more>More</a>
</div>



.hptest {
position: relative;
}
.more {
position: absolute;
bottom: 0;
}

esthera
Jan 17th, 2007, 07:07 PM
this works in firefox but in ie it's moving out of the box of hpbook

harbingerOTV
Jan 18th, 2007, 05:37 AM
yikes!

try this:


.hpbook{
position: relative;
}
.more {
position: absolute;
bottom: 0;
}

and see if that works. I dont know where I got hptest from.