我遇到了这个问题的麻烦。集中在水平元素浮动,如果可能,响应
我试着让div的所有形状保持居中,当我减少窗口的宽度,但他们是跟随彼此,总是,真的离开(认为浮动:左)。
和图像,如果可能,我们会保持对我有趣的响应,但我试图控制宽度百分比,并没有工作。
Tks支持。
<div class="general-box">
<div class="left-right-padding">
<ul>
<li class="general-box-title">TITLE 1</li>
<li> <a id="" href="" title=""><img src="" width="156" height="75" alt="" /></a>
<a class="left-margin-photo" href="" title=""><img src="" width="101" height="75" alt="" /></a>
</li>
</ul>
</div>
<div class="left-right-padding">
<ul>
<li class="general-box-title">TITLE 2
<li> <a href="" title=""><img src="" width="92" height="75" alt="" /></a>
<a class="left-margin-photo" href="" title=""><img src="" width="160" height="75" alt="" /></a>
</li>
</ul>
</div>
<div class="left-right-padding">
<ul>
<li class="general-box-title">TITLE 3
<li> <a href="" title=""><img src="" width="170" height="75" alt="" /></a>
<a class="left-margin-photo" href="" title=""><img src="" width="88" height="75" alt="" /></a>
</li>
</ul>
</div>
<div class="clear"></div>
</div>
CSS:
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font: inherit;
font-size: 100%;
vertical-align: baseline;
outline: none;
text-decoration: none;
zoom: 1;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
.clear {
clear: both
}
.general-box {
padding: 0 40px 30px 40px;
font-weight: bold;
border: 1px solid #000;
}
.general-box .left-right-padding {
float: left;
padding: 0 20px 0 20px;
}
.general-box .general-box-title {
margin: 30px 0 30px 0;
}
.general-box .left-margin-photo {
margin-left: 16px;
}
Adilapapaya,tks的支持。但我需要这些元素最初保持并排。 – user2752929