css如何制作< a>文字对齐底部? [英] css how to make <a> text align bottom?

查看:172
本文介绍了css如何制作< a>文字对齐底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让< a> 文字对齐底部?我添加了 height = line-height vertical-align:bottom; code>但文本仍然在div的中间。怎么做?谢谢



测试在 http://jsfiddle.net/BanAz/

 <!DOCTYPE html PUBLIC -  // W3C // DTD XHTML 1.0 Transitional // EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> 
< html>
< head>
< style type =text / css>
#layer {width:198px; height:48px; line-height:48px; border:1px#000 solid; vertical-align:bottom;}
#layer a {text-decoration:none;}
< / style>
< / head>
< body>
< div id =layer>
< a href =#>菜单< / a>
< / div>
< / body>
< / html>


解决方案

选项包括:



我将实际使用的方法:


How how to make <a> text align bottom? I have added height = line-height, and vertical-align:bottom; but the text still in the middle of the div. How to do? Thanks

Test in http://jsfiddle.net/BanAz/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<style type="text/css">
#layer{width:198px;height:48px;line-height:48px;border:1px #000 solid;vertical-align:bottom;}
#layer a{text-decoration:none;}
</style>
</head>
<body>
<div id="layer">
<a href="#">menu</a>
</div>
</body>
</html>

解决方案

Options include:

And the method I would actually use:

这篇关于css如何制作&lt; a&gt;文字对齐底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆