我不能在div
左侧浮动图像居中。 我尝试过文本对齐并设置页边距。居中图像int浮动div
CSS:
.to_left_690 {
width: 690px;
float: left;
}
.to_left_290 {
width: 290px;
float: left;
overflow: hidden;
text-align: center;
}
p {
margin: 0 0 14px 0px;
text-align: justify;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
}
HTML:
<div class="to_left_690">
<h3>Date Center</h3>
<p>One of the biggest` data centers in Latin America with over 3000 servers took a proactive approach to monitor their electrical infrastructure. Over 4 years later they have still not had any major disruptions.</p>
<h3>Call Center</h3>
<p>
<img class="alignleft size-full wp-image-181" alt="baloons" src="http://www.sheerdigitaltest.net/janus/wp-content/uploads/2013/07/baloons.png" width="62" height="70">During Carnival 2013 the data center air conditioning failed for a call centre company and no-one on site. Thanks to early detection and alerts sent to the standby maintenance team they were quickly able to resolve the situation and prevent a catastrophic shutdown.</p>
<h3>Facilities Management:</h3>
<p><span>With over 1200 people working at headquarters the TJES needed a solution to maintain proper working conditions to be able to perform with the minimum of disruption. Janus Technology solutions have eliminated all problems and saved millions in lost productivity over 2 years</span>
</p>
</div>
<div class="to_left_290">
<img class="size-full wp-image-183 aligncenter" alt="ipad" src="http://www.sheerdigitaltest.net/janus/wp-content/uploads/2013/07/ipad.png" width="290" height="368">fdsfdsfdsfds</div>
的jsfiddle:http://jsfiddle.net/xLwSh/
理论上来说img IS就在中心。 div是290px,img是290px,div浮动到左边。在这种情况下,图像将位于左侧。居中div或给div 100%宽度,然后图像居中。 – Vector
你有答案,你只需要决定是否要固定宽度的浮动div或中心对齐的图像。你只能做到一件事。 – Learner