Hej Kim
Jeg beklager at jeg ikke var helt klar i spyttet i mit forrige indlæg
Problemet er at størrelse og baggrundsfarver forsvinder når jeg indsætter koden for opstillingen af <div>.
Her er koden før "sidebyside" og "ombryd" sættes ind. Som du kan se har alle 6 <div> en bestemt størrelse og farve:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Trylleshow</title>
<style>
html, body {
height: 100%;
}
body {
background-color: #cccccc;
}
.container {
margin: 0 auto;
background-color: white;
max-width: 960px;
min-height: 100%;
}
.div1 {
background-color: #607d8b;
max-width: 470px;
height: 700px;
}
.div2 {
background-color: #000000;
max-width: 470px;
height: 700px;
}
.div3 {
background-color: #7E7E7E;
max-width: 470px;
height: 700px;
}
.div4 {
background-color: #F1F1F1;
max-width: 470px;
height: 700px;
}
.div5 {
background-color: #2C3980;
max-width: 470px;
height: 700px;
}
.div6 {
background-color: #009688;
max-width: 470px;
height: 700px;
}
.sidebyside {
float:left;
max-width: 470px;
height: 700px; }
.ombryd {clear:both}
</style>
</head>
<body style="direction: ltr;">
<div class="container">
<div class="div1">div1</div>
<div class="div2">div2</div>
<div class="div3">div3</div>
<div class="div4">div4</div>
<div class="div5">div5</div>
<div class="div6">div6</div>
</div>
</body>
</html>
Og her er koden med "sidebyside" og "ombryd". Som du kan se er <div> størrelsen og baggrundsfarver ændret/væk:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Trylleshow</title>
<style>
html, body {
height: 100%;
}
body {
background-color: #cccccc;
}
.container {
margin: 0 auto;
background-color: white;
max-width: 960px;
min-height: 100%;
}
.div1 {
background-color: #607d8b;
max-width: 470px;
height: 700px;
}
.div2 {
background-color: #000000;
max-width: 470px;
height: 700px;
}
.div3 {
background-color: #7e7e7e;
max-width: 470px;
height: 700px;
}
.div4 {
background-color: #f1f1f1;
max-width: 470px;
height: 700px;
}
.div5 {
background-color: #2c3980;
max-width: 470px;
height: 700px;
}
.div6 {
background-color: #009688;
max-width: 470px;
height: 700px;
}
.sidebyside {
float: left;
max-width: 470px;
height: 700px;
display: inline;
}
.ombryd {
clear: both;
}
</style>
</head>
<body style="direction: ltr;">
<div class="container">
<div class="sidebyside">div1</div>
<div class="sidebyside">div2</div>
<div class="sidebyside ombryd">div3</div>
<div class="sidebyside">div4</div>
<div class="sidebyside ombryd">div5</div>
<div class="sidebyside">div6</div>
</div>
</body>
</html>
Hvordan undgår jeg at størrelser og farver i alle seks <div> ændrer sig og forsvinder?
Håber at spørgsmålet giver mening.
De bedste hilsner
Søren