0
I have a div parent containing two Divs son and one of these div son contains two other Divs son. The title of one of these is getting out of it. I modified the sizes of the same due to the available size of the SO-pt allows, to avoid creating scrollbars horizontally at least. real values will be at the end of the display of the example of div.
Code
.div-pai-banner {
width: 480px;
height: 300px;
background-color: #CCC;
margin: auto;
margin-top: 20px;
border: 3px solid #666;
font-family: tahoma, Arial;
font-size: 1.5em;
font-weight: bold;
}
.div-filho-time {
width: 480px;
height: 220px;
background-color: #FFF;
text-align: center;
}
.div-filho-footer {
width: 480px;
height: 80px;
background-color: #00F;
}
.div-filho-patrocinio {
width: 300px;
height: 80px;
float: left;
background-color: #F00;
text-align: center;
}
.div-filho-realizacao {
width: 180px;
height: 80px;
background-color: #F00;
text-align: center;
}
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="estilo-banner.css"/>
<title>Banner</title>
</head>
<body>
<div class="div-pai-banner">
<div class="div-filho-time">imagem do time...</div>
<div class="div-filho-footer">
<div class="div-filho-patrocinio">Patrocínio:</div>
<div class="div-filho-realizacao">Realização:</div>
</div>
</div>
</body>
</html>
Real values:
.div-pai-banner
width: 800px;
height: 500px;.div-son-time
width: 800px;
height: 400px;.div-filho-footer
width: 800px;
height: 100px;.div-filho-patrocinio
width: 500px;
height: 100px;.div-son-realization
width: 300px;
height: 100px;
P.S.: In this example above the title realization didn’t even show up!
worked out here, I put put the patrocinio div to float left, I thought that so the other div would float right, since, the sum of the width of the daughter Divs equals the width of the div in which they are contained.
– Lucas Inácio
Yes, I could use the property
float
also, but in thediv-filho-realizacao
with the valueright
.– Marco