<a>标签的样式

是不是先要设置display:block 后, with height 这些设置才有效果
我的代码 没设置display,with也有用
<style type="text/css"> 
<!-- 
.tb{padding-top:50px; padding-left:50px}
.tb a{ height:40px; background:#990000; color: #FFFFFF; text-decoration:none; padding:10px; margin-left:20px}
.tb a:hover{ background:#FF0000}

--> 
</style> 
</head>

<body>
<div>
<div class="tb"><a href="http://www.mop.com">dsd</a><a href="http://sohu.com">sadsa</a>
</div>

回答你的补充:如果你没有设置display:block
那肯定没用的,不可能你没设置,宽和高还有用的。

<style>
a{ width:100px; height:50px; border:#000 solid 1px;}
</style>
<a href=122>哈哈</a>

这样随便你怎么设置width和height都是无效的

猜你喜欢

转载自blog.csdn.net/qq_18975791/article/details/81316763