nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Examples *{margin: 0;padding: 0;}.box{padding: 10px 20px;background: red;color: #fff;text-decoration: none;float: left;}.ico{width: 20px;height: 20px;background: blue;float: right;}怎么破
登录后复制
在IE 6 7下撑开了, 其他正常 不想让它撑开. a 宽度不固定 i 在右边.
怎么破?
求解?
可以给文字外再包一层 可以解决 ,如果是这种结构的话有没有其他方法可以解决
回复讨论(解决方案)
你的父元素,非得用float吗?
a标签
display:block
试试看
a标签
display:block
试试看
不行
加个宽度。
demo here.
nbsp;html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Examples *{margin: 0;padding: 0;} .box{ padding: 10px 20px; background: red; color: #fff; text-decoration: none; float: left; width:78px; } .ico{ width: 20px; height: 20px; background: blue; float: right; } .txt{ float:left;} 怎么破
登录后复制
.ico{ width: 20px; height: 20px; background: blue; display:inline-block;}
登录后复制
子和父样式中添加position:absolute;同时在子样式中加入right:**px;(宽度自己定义)
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2843701.html