Note that there are some explanatory texts on larger screens.

plurals
  1. POheight:auto attribute gets messed up when using different positioning
    primarykey
    data
    text
    <p>I'm trying to make a module for a website. This module will include a heading, text, and an image. I would like the webmaster to be able to insert as many of these modules as he likes into a page and ideally he should be able to type as much as he wants in a module and have it auto adjust to the proper height.</p> <p><strong>Here's the problem:</strong></p> <p>I can't seem to get the height of the entire module called "myModlue" (the red box that hold the heading, image and text) to be auto height, and also have "moduleBody" set to auto height with out the two divs conflicting. In order to have "mymodule" recognize the content inside so that the height auto adjusts, I need to set the positioning to absolute. At this point "mymodule" is containing everything like it should, but "moduleBody" is not....moduleBody is collapsed and will not acknowledge the elements inside unless I set it's position to absolute as well. When I do this "moduleBody" does adjust in height, but now "myModule" no longer includes "moduleBody" in the height, it only sees "moduleHeader" (which is not set to position:absolute;) How can I make both "myModule" and "moduleBody" auto height and have everything work correctly?</p> <p>FYI: the styles are all embedded directly into the html, my complete version will absolutely not look this way, I've only done this because I want to see how things look quickly as I'm testing. The weird colors are for testing purposes too.</p> <p>Thanks to anyone who helps, Lindsay :)</p> <hr> <h2>myModule.html</h2> <pre><code>&lt;div id= "myModule"style="height:auto; width: 1000px; position:absolute; background-color:red;" &gt; &lt;div id= "moduleHeader" style = "width:100%; height:auto; background-color:yellow; "&gt; &lt;p style="text-align:left; font-family:Arial; font-size:22px; font-size:30px; color:#191970; margin-left:20px;"&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" style="background-color:#0E1031; width:800px; height:auto; margin-left:auto; margin-right:auto; padding:40px;border:thick solid #1B1851; border-radius: 15px; position:absolute;"&gt; &lt;p style=" text-align:justify; height:150px; width:500px; font-family:Arial; font-size:14px; line-height:150%; float:left; color:white; "&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" style="height:250px; width:200px;margin-left:40px; float:left; border:thick solid white;"&gt;&lt;img src="churchImg.jpg" style="height:100%; width:100%; "/&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    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.
 

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