开发者

bottom-align a link in a div

开发者 https://www.devze.com 2023-01-27 06:34 出处:网络
I have something similar to this .col {float: left; width:190px;border: 1px solid red;} <div class=\"col\">

I have something similar to this

.col {float: left; width:190px;border: 1px solid red;}

<div class="col">
    <p>some text goes here some ass sasass here </p
</div>
<div class="col">
   <p>some text goes here</p>
   <a href="">Link</a>
</div>

So the text on the first div is quite long where as the text in the second div is not. So the first div gets taller than the second div.

What I want to achieve is leave the text in the second column as it is but vertical align the link to the bottom开发者_JAVA技巧 to match the left's div height.

Does that make sense?

Thanks


Look at this example:
http://www.ejeliot.com/samples/equal-height-columns/example-6.html

added:
you should take out the element that you want to put on the bottom.

<div class="col">
    <p>Lorem ipsum dolor 1</p>
</div>
<div class="bottom"></div>

<div class="col">
    <p>Lorem ipsum dolor 2</p>
</div>
<div class="bottom">
    <a href="#">link</a>
</div>
0

精彩评论

暂无评论...
验证码 换一张
取 消