【发布时间】:2019-04-04 03:38:00
【问题描述】:
我想在一个 DIV 中而不是文本中居中一个 DIV,所有解决方案都说要指定我的宽度并将边距设置为自动,但是如果它是一个响应式构建,就像我设置它不会设置的宽度一样,它是如何工作的是?我想对齐联系信息 DIVS 但不是文本。希望这已经足够清楚了。
谢谢!
<div id="upperfooter">
<div class="container">
<div id="links">
<div class="contact-info col-lg-offset-0 col-lg-3 col-xs-4 col-md-offset-0 col-md-4">
<div class="contact-item">
<h3><strong>COMPANY INFO</strong></h3>
<p>About Nielsen</p>
<p>Investor Relations</p>
<p>Nielsen Families</p>
<p>Responsibility & Sustainability</p>
<p>Press Room</p>
<p>Careers</p>
<p>Contact Us</p>
</div>
</div>
<div class="contact-info col-lg-offset-0 col-lg-3 col-xs-4 col-md-offset-0 col-md-4">
<div class="contact-item">
<h3><strong>INSIGHTS</strong></h3>
<p>Newswire</p>
<p>Reports</p>
<p>News Center</p>
<p>Top 10 & Trends</p>
<p>How We Measure</p>
<p>Webinars & Events</p>
<p>Newsletter Sign-up</p>
</div>
</div>
<div class="contact-info col-lg-offset-0 col-lg-3 col-xs-4 col-md-offset-0 col-md-4">
<div class="contact-item">
<h3><strong>SOLUTIONS</strong></h3>
<p>Advertising Effectiveness</p>
<p>Audience Measurement</p>
<p>Marketing ROI</p>
<p>Price and Promotion</p>
<p>Product Development</p>
<p>Reputation Management</p>
<p>Shopper</p>
</div>
</div>
</div>
</div>
</div>
【问题讨论】:
-
你想要居中的 div,现在,所有 contact-item 类的 div 都在 contact-info 类的 div 中居中。当屏幕很大时,您想将 col-lg-3 放在 id 为 links 的 div 上吗?请问,你能提供更多细节吗?
标签: html css twitter-bootstrap alignment footer