I am practicing building a website from an image. The image is supposed to fit inside the div with the red border, but when I set the images width to 200px, it pops out like this, and I dont know why.
Basically, I want the image on top of the blue text/background, and I want them both nested in a div about as tall and wide as the two grey boxes to its left. There will be another div to the right of this one, so 3 divs across total.
<div id="articles">
<div id="newslinks">
<div id="market-news">
<h4>Market News</h4>
<a href="#"><li>Student Housing Heats Up in St. Louis - 10/27/14</li></a>
<a href="#"><li>Student Housing Heats Up in St. Louis - 10/27/14</li></a>
<a href="#"><li>Student Housing Heats Up in St. Louis - 10/27/14</li></a>
<a href ="#" id="viewmore">+ View more</a>
</div>
<div id="announcements">
<h4>Announcements</h4>
<a href="#"><li>Student Housing Heats Up in St. Louis - 10/27/14</li></a>
<a href="#"><li>Student Housing Heats Up in St. Louis - 10/27/14</li></a>
<a href="#"><li>Student Housing Heats Up in St. Louis - 10/27/14</li></a>
<a href ="#" id="viewmore">+ View more</a>
</div>
</div>
<div id="article-company-news">
<div id="hq-img">
<img src="/img/tile-lg.jpg" alt="HQ img">
</div>
<div id="company-news-content">
<h4>Company News</h4>
<p>Military Service Provided Excellent Professional Traning for Company Employee</p>
</div>
</div>
</div>
so the question now, is how come the text is sitting on top of the image as opposed to below it? And how do I get the full size image within the area that the image is currently in?
Also, the text should be about 40% of the div, and the image about 60%. I am trying to make a near exact replica of the completed site linked above.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.
See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.