<div class = "left"> <div class = "custimage"><img src = "img/notch.jpg" alt = "notch"/><p>Notch</p></div> <div class = "custimage"><img src = "img/peak.jpg" alt = "peak"/><p>Peak</p></div> <div class = "custimage"><img src = "img/shawl.jpg" alt = "shawl"/><p>Shawl</p></div> </div>
CSS:
.left { position: relative; float: left; wIDth:600px; height:200px; background-color: #000; opacity: 0.7;}.custimage{ position:relative; margin-top: 15px; margin-left: 15px; height: 170px; wIDth: 130px; background-color: #999; text-align:left;}.custimage p{ color: #fff; Font:normal 60%/1.5 Helvetica,Arial,sans-serif; padding-left: 5px;}
http://www.everry.com/new/customise/customisenow.html
我究竟做错了什么?
解决方法 应用浮动:左侧.custimage.custimage{ position:relative; margin-top: 15px; margin-left: 15px; height: 170px; wIDth: 130px; background-color: #999; text-align:left; float: left; // float all cust images to the left so they stack up against each other}总结
以上是内存溢出为你收集整理的html – 水平对齐div全部内容,希望文章能够帮你解决html – 水平对齐div所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)