html css 超链接 A、Span 标签的width属性无效

针对症状的解决方法:

1.网页的首部加入了<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,把这断代码去掉即可。

2.在CSS中控制,相关元素的width属性值时加入:display:inline-block; 属性即可。

如:span 的样式 可以这样写:span{width:300px;display:inline-block;}

posted @ 2010-12-23 14:01  春哥也编程  阅读(6262)  评论(0编辑  收藏  举报