So, I'm designing a website right now (pretty nooby in HTML and CSS), but I did the design in Photoshop beforehand so that I could go through the coding and make the site the way I wanted. Well, I have a problem. I have two DIV elements inside a larger DIV container that will not align side by side despite using the built-in block. Here is the css code:
.contentContainer { display: block; width: 700px; height: 250px; margin: 20px auto; } .topContainer { height: 230px; padding: 10px; background-color: white; } .topThumbnail { display: inline-block; width: 370px; height: 230px; } .topThumbnail img { width: 370px; height: 230px; } .topInfo { display: inline-block; margin-left: 10px; width: 300px; height: 230px; } .topInfo p { width: 300px; height: 230px; background-color: pink; }
The contentContainer is the highest DIV containing my topContent and topThumbnail, so I thought I would throw it in the provided code. And the HTML code:
<div class="topContainer"> <div class="topThumbnail"> <img src="YT.png" /> </div> <div class="topInfo"> <p>Testing the information area of the top container or something along those lines</p> </div> </div>
It is impossible to post photos to explain the problem .. you need 10 reputations .. it will be difficult to describe.
In design, the two containers for Thumbnail and Info should be side by side and aligned at the top. The thumbnail should be to the left of the topContainer, and the information should be to the right of the thumbnail with a margin of 10. For some reason, the information does not go to the right of the thumbnail, but rather goes under it. I have ALREADY given a field value
set to 0 to fix default tagging issues.
source share