Wiem , że temat jest odgrzewany , ale po kilkuuuu dobrych godzinach rozkminiania tego banalnego problemu mam dość. Chciałem rozciągnąć div#c1 i potem w ten sam sposób div#d1. Zróbmy jeden , a drugi będzie analogicznie rozwiązany.
<div id="y"><br />PL | GB | D | FR | S
<br /><br /></div>
html,body {
background-color:orange;
margin:auto;
width: 100%;
height:100%;
text-decoration:none;
font-family: Verdana;
line-height: 10px;
}
div {
margin: auto;
border : none;
padding : auto;
}
#x {
width:100%;
}
#y {
background-color:#000;
width: 100%;
text-align: right;
clear: left;
float: left;
}
#z {
width: 100%;
background-color:#FFF;
clear: left;
float: left;
}
#a {
width: 100%;
background-color:#04B486;
clear: left;
float: left;
}
#b {
width: 100%;
background-color:#007777;
clear: left;
float: left;
}
#c {
overflow: hidden;
width: 100%;
clear: left;
float: left;
background-color:#FFF;
}
#c1 {
width: 1000px;
background-color: red;
position:absolute;
left:50%;
margin-left:-500px;
}
#d {
width: 100%;
background-color:brown;
margin: auto;
float : none;
display: block;
margin: auto;
padding:auto;
}
#e {
width: 100%;
background-color:#FFF;
clear: left;
float: left;
}
#f {
clear: both;
width: 100%;
background-color:#FFF;
}
próbowałem rozwiązania polegającego na wstawieniu
clear:both;<div style="clear: both;"></div>
a nawet wynalazek typu :
function setheight() {
if(document.getElementById('c1').offsetHeight > document.getElementById('c').offsetHeight) {
document.getElementById('c').style.height = document.getElementById('c1').offsetHeight+'px';
}}
jednak wciąż nie działa...
ktoś potrafi pomóc?