我遇到了這部分代碼的問題,出於某種原因,兩個div中包含的兩個元素將不能正確排列(並排)。我對此相對較新,希望得到一些幫助。這可能是我忽略的一個愚蠢的錯誤,但我似乎無法做到。如何使這條線正確
<div style="background-image:url('http://royalelectric.com/blog/wp-content/uploads/2014/09/Yellow-Banner-1.jpg'); background-size:100%;">
<div style="max-width:584px; min-width:205px; display:inline-block; width:48.8%; min-height:230px; display:inline-block; padding:1.2%;" align="left">
<h1 align="left">Essentially Electric</h1>
<h3 align="left">A Slightly Different Outlook on Our World!</h3>
<a href="http://royalelectric.com/blog/why-isnt-there-a-standard-voltage-among-the-worlds-nations/"><img src="http://royalelectric.com/blog/wp-content/uploads/2014/07/voltage-thumbnail.jpg" style="float:left">
<h4 style="text-align:center; padding-left:4%; padding-right:4%;"> Why isn’t there a standard voltage among the world’s nations? </h4></a>
<br>
<p style="text-align:right; padding-left:5%; padding-right:5%;">
If you’ve ever traveled overseas, you probably already know that there isn’t a worldwide standard for the voltage and frequency of alternating current (AC) electricity. Hopefully you didn’t find out the hard way. For various reasons...</p>
<a href="http://royalelectric.com/blog/royal-blog/"><img src="http://royalelectric.com/blog/wp-content/uploads/2014/09/button11.png" style="padding:4%;"></a>
</div>
<div style="max-width:584px; min-width:205px; display:inline-block; width:48.5%; min-height:230px; display:inline-block; padding:1.2%;" align="left">
<h1 align="left">Wow! Cool! Neat!</h1>
<h3 align="left">Innovations + Great Ideas from our Manufacturers!</h3>
<a href="http://royalelectric.com/blog/why-isnt-there-a-standard-voltage-among-the-worlds-nations/"><img src="http://royalelectric.com/blog/wp-content/uploads/2014/09/Klein-Tools-Switch-Drive-System-T1.jpg" align="left" style="padding-left:5%; padding-right:5%;"></a>
<a href="http://royalelectric.com/blog/why-isnt-there-a-standard-voltage-among-the-worlds-nations/"><img src="http://royalelectric.com/blog/wp-content/uploads/2014/09/Klein-Tools-Switch-Drive-System-T1.jpg" align="right" style="padding-left:5%; padding-right:5%;"></a>
</div>
</div>
的jsfiddle:http://jsfiddle.net/zawmd0uw/
我看着jsfiddle,但我不能告訴你要如何排列元素。哪兩個元素應該並排顯示? – 2014-09-26 14:39:47
您應該考慮使用實際的css而不是內聯樣式。它將使html更容易理解,並允許您檢測冗餘,例如您在其中一個div上列出了兩次「display:inline-block」。 – Bic 2014-09-26 14:44:13
好的謝謝!感謝幫助。 – bmbu924 2014-09-26 14:56:10