Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The behaviour you are seeing is due to elements being floated, which means that they have been removed from normal flow and will <strong>not</strong> be used by the browser when calculating height of containing elements. There are plenty of blog posts out there about CSS <code>float</code>, so I'll only link one for <a href="http://coding.smashingmagazine.com/2007/05/01/css-float-theory-things-you-should-know/" rel="nofollow">background reading</a>.</p> <p>There are many ways to fix this for example on the quirksmode blog - <a href="http://www.quirksmode.org/css/clearing.html" rel="nofollow">Clearing floats</a>. The most famous is known as the "clear fix", an example of which can be found <a href="http://nicolasgallagher.com/micro-clearfix-hack/" rel="nofollow">here</a> and also below:</p> <pre><code>/** * For modern browsers * 1. The space content is one way to avoid an Opera bug when the * contenteditable attribute is included anywhere else in the document. * Otherwise it causes space to appear at the top and bottom of elements * that are clearfixed. * 2. The use of `table` rather than `block` is only necessary if using * `:before` to contain the top-margins of child elements. */ .cf:before, .cf:after { content: " "; /* 1 */ display: table; /* 2 */ } .cf:after { clear: both; } /** * For IE 6/7 only * Include this rule to trigger hasLayout and contain floats. */ .cf { *zoom: 1; } </code></pre> <p>So applying to your (cleaned up) <em>HTML</em> as seen in <a href="http://jsfiddle.net/4zRwA/" rel="nofollow"><strong>this demo</strong></a> or below@</p> <pre><code>&lt;div id= "myModule"&gt; &lt;div id="moduleHeader"&gt; &lt;p&gt;Who We Are &lt;span&gt;&lt;b style="color:#999; font-size:20px;"&gt;Learn more about Trinity&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt; &lt;div id= "moduleBody" class="cf"&gt; &lt;p&gt;The United Church of Christ acknowledges as its sole head, Jesus Christ, Son of God and Savior. It acknowledges as kindred in Christ all who share in this confession. It looks to the Word of God in the Scriptures, and to the presence and power of the Holy Spirit, to prosper its creative and redemptive work in the world. It claims as its own the faith of the historic Church expressed in the ancient creeds and reclaimed in the basic insights of the Protestant Reformers. It affirms the responsibility of the Church in each generation to make this faith its own in reality of worship, in honesty of thought and expression, and in purity of heart before God. In accordance with the teaching of our Lord and the practice prevailing among evangelical Christians, it recognizes two sacraments: Baptism and the Lords Supper or Holy Communion.&lt;/p&gt; &lt;div id="mod_Image"&gt;&lt;img src="churchImg.jpg"/&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><em>CSS</em></p> <pre><code>#myModule { width:1000px; background-color:red; } #moduleHeader { background-color:yellow; } #moduleHeader p { text-align:left; font-family:Arial; font-size:22px; font-size:30px; color:#191970; margin-left:20px; } #moduleBody { background-color:#0E1031; width:800px; padding:40px;border:thick solid #1B1851; border-radius: 15px; } #moduleBody p { text-align:justify; height:150px; width:500px; font-family:Arial; font-size:14px; line-height:150%; float:left; color:white; } #mod_Image { height:250px; width:200px; margin-left:40px; float:left; border:thick solid white; } .cf:before, .cf:after { content: " "; /* 1 */ display: table; /* 2 */ } .cf:after { clear: both; } </code></pre> <p>Note that you do not need to be specifying any of <code>height:auto</code>, <code>position:absolute</code>, <code>width:100%</code> as these are the defaults for the elements where you had them applied to.</p> <p>An alternative approach is to remove the "clear fix" class and <code>float:left</code> and use <code>display:inline-block</code> and <code>vertical-align:top;</code> instead as in <a href="http://jsfiddle.net/4zRwA/2/" rel="nofollow"><strong>this alternate demo</strong></a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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