Note that there are some explanatory texts on larger screens.

plurals
  1. POmultiple divs side by side of fixed width
    text
    copied!<p>I want 6 divs side by side to show service packages. The problem is I want all of them of specified pixel width. But I am unable to give them a width in pixel. And also the parent div is getting adjusted to the width acquired by them as I have specified the width of 80% to it. I checked other posts but they didn't help me. I am working on this code...</p> <pre><code>&lt;div id="main"&gt; &lt;div id="content" class="shadow"&gt; &lt;div id="p-col1"&gt; &lt;ul&gt; &lt;li&gt;&lt;h1&gt;heading&lt;/h1&gt;&lt;/li&gt; &lt;li&gt;text text text &lt;/li&gt; &lt;li class="grey"&gt;text text text &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="p-col2"&gt; &lt;ul&gt; &lt;li&gt;&lt;h1&gt;Heading&lt;/h1&gt;&lt;/li&gt; &lt;li&gt;text text &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="p-col3"&gt; &lt;ul&gt; &lt;li&gt;&lt;h1&gt;Heading&lt;/h1&gt;&lt;/li&gt; &lt;li&gt;text text &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="p-col4" class="shadow"&gt; &lt;ul&gt; &lt;li&gt;&lt;h1&gt;Heading&lt;/h1&gt;&lt;/li&gt; &lt;li&gt;text text &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="p-col5"&gt; &lt;ul&gt; &lt;li&gt;&lt;h1&gt;Heading&lt;/h1&gt;&lt;/li&gt; &lt;li&gt;text text &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="p-col6"&gt; &lt;ul&gt; &lt;li&gt;&lt;h1&gt;Heading&lt;/h1&gt;&lt;/li&gt; &lt;li&gt;text text &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- End of Main --&gt; </code></pre> <p>The CSS:</p> <pre><code> #main{ width:80%; margin:0 auto; border:0px; font-size:18px; } .shadow { box-shadow:3px 0 10px #222 , -3px 0 10px #222; -moz-box-shadow:3px 0 10px #222 , -3px 0 10px #222; -webkit-box-shadow:3px 0 10px #222 , -3px 0 10px #222; } #main #content{ float:left; display:inline-block; padding:0; position:relative; padding:10px 10px 10px 10px; } #p-col1{ widht:100px; background-color:#FFFFFF; border-radius:10px 10px 10px 10px; -moz-border-radius:10px 10px 10px 10px; -webkit-border-radius:10px 10px 10px 10px; float:left; position:relative; } #p-col1 h1{ color:#ffffff; background-color:#d1ebf1; padding:25px 5px 5px 5px; font-size:20px; font-weight:bolder; text-align:center; border-radius:10px 10px 0 0; -moz-border-radius:10px 10px 0 0; -webkit-border-radius:10px 10px 0 0; } #p-col2{ widht:100px; background-color:#7098e0; border-radius:10px 10px 10px 10px; -moz-border-radius:10px 10px 10px 10px; -webkit-border-radius:10px 10px 10px 10px; float:left; position:relative; } #p-col2 h1{ color:#ffffff; background-color:#0152e7; padding:25px 5px 5px 5px; font-size:20px; font-weight:bolder; text-align:center; border-radius:10px 10px 0 0; -moz-border-radius:10px 10px 0 0; -webkit-border-radius:10px 10px 0 0; } #p-col3{ widht:100px; background-color:#778cdd; border-radius:10px 10px 10px 10px; -moz-border-radius:10px 10px 10px 10px; -webkit-border-radius:10px 10px 10px 10px; float:left; position:relative; } #p-col3 h1{ color:#ffffff; background-color:#012edd; padding:25px 5px 5px 5px; font-size:20px; font-weight:bolder; text-align:center; border-radius:10px 10px 0 0; -moz-border-radius:10px 10px 0 0; -webkit-border-radius:10px 10px 0 0; } #p-col4{ widht:100px; background-color:#75c3d7; border-radius:10px 10px 10px 10px; -moz-border-radius:10px 10px 10px 10px; -webkit-border-radius:10px 10px 10px 10px; float:left; position:relative; } #p-col4 h1{ color:#ffffff; background-color:#01abd8; padding:25px 5px 5px 5px; font-size:20px; font-weight:bolder; text-align:center; border-radius:10px 10px 0 0; -moz-border-radius:10px 10px 0 0; -webkit-border-radius:10px 10px 0 0; } #p-col5{ widht:100px; background-color:#729fcc; border-radius:10px 10px 10px 10px; -moz-border-radius:10px 10px 10px 10px; -webkit-border-radius:10px 10px 10px 10px; float:left; position:relative; } #p-col5 h1{ color:#ffffff; background-color:#0b6dd0; padding:25px 5px 5px 5px; font-size:20px; font-weight:bolder; text-align:center; border-radius:10px 10px 0 0; -moz-border-radius:10px 10px 0 0; -webkit-border-radius:10px 10px 0 0; } #p-col6{ widht:100px; background-color:#7098e0; border-radius:10px 10px 10px 10px; -moz-border-radius:10px 10px 10px 10px; -webkit-border-radius:10px 10px 10px 10px; float:left; position:relative; } #p-col6 h1{ color:#ffffff; background-color:#0189d4; padding:25px 5px 5px 5px; font-size:20px; font-weight:bolder; text-align:center; border-radius:10px 10px 0 0; -moz-border-radius:10px 10px 0 0; -webkit-border-radius:10px 10px 0 0; } li.grey{ background-color:#e3e8e9; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload