First of all, let me say that I'm very new to HTML and CSS. I so far have a containing div with two divs inside, one floating left and one floating right. The one that floats right contains a 400px
image, and the one floating left is supposed to contain some text, but I want the height of the background color
to remain the same height as the image. Because the image is being defined by percentages rather than pixel height, I can't just set the height the same as it won't scale.
Here's the HTML:
<div id="about">
<div id="abouttext">
djfd
</div>
<div id="aboutpic">
<img src="images/photoph.png" alt="Yeah, that's me">
</div>
</div>
Here's the relevant CSS:
#about
{
width: 70%;
height: auto;
margin: 0 auto;
}
#aboutpic
{
width: 40%;
float: right;
}
#abouttext
{
width: 50%;
background-color: #2A1F33;
opacity: 0.6;
height: auto;
float: left;
padding-top: 5%;
padding-left: 5%;
padding-right: 5%;
}
Any help is massively appreciated.