FLOAT Geht nicht wie es sollte
Aquariophile
- css
Hallo!
Das gelbe DIV soll nur 100px lang sein.
Wenn ich _keine_ Angabe "width" hinmache geht es bis zum rechten ende der seite,
dafür ist es zumidest dort wo es hingehoert.
Sobald ich aber width:100px; reinmache,
geht das ding von oben wo es hingehört nach unten links.
Hier der source von dem,
wie es aussehen soll von der Platzierung,
nur das gelbe DIV eben nur 100px; lang:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
html
{
margin: 0; padding: 0;
height: 100%; width: 100%;
}
body {
color: #000000; background-color: #FFFFFF;
font-family: Verdana,Arial,Helvetica,sans-serif;
margin: 0; padding: 0;
height: 100%; width: 100%;
}
.t1 {
margin-top:20px;
width:800px;
height:46px;
background-color: #adbdce;
border-top-style:solid;
border-top-color:#000000;
border-top-width:2px;
border-bottom-style:solid;
border-bottom-color:#000000;
border-bottom-width:2px;
color:#840000;
line-height:46px;
text-align:right;
font-family:serif;
font-size:40px;
font-weight:900;
padding-right:10px;
}
.t2 {
float:left;
margin-top:0px;
width: 250px;
/* height FEHLT */
background-color: #FFFFFF;
color:#840000;
text-align:left;
font-family:serif;
font-size:20px;
font-weight:900;
padding-bottom:20px;
}
.t3 {
width:140px;
background-color: #dedede;
border-style:solid;
border-color:#10108c;
border-width:3px;
color:#101029;
text-align:center;
padding-top:10px;
padding-left:10px;
padding-right:10px;
padding-bottom:10px;
margin-left: 30px;
}
.t4 {
background-color: #dedede;
border-style:solid;
border-color:#000000;
border-width:1px;
color:#000000;
text-align:left;
font-family:serif;
font-size:20px;
font-weight:900;
}
</style>
</head>
<body>
<div class="t1">Saftnasentüten</div>
<div class="t2">
<div><img src="lautsprecher.jpg" alt="lautsprecher"></div>
<div style="height:30px;"> </div>
<div class="t3">
<div class="t4">
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
</div>
</div>
</div>
<div style="background-color:#FFCC00">
foobar<br>
foo<br>
bar<br>
</div>
</body>
</html>
Danke!
Hi Hans,
ist ja super, dass Du CSS-Positionierung lernst, aber könntest Du nicht
a)den Code, den Du postest, auf das Relevante kürzen oder
b) wenn's so lang sein muss, nen Link statt des Codes anbieten, dass man sich Deinen Versuch mal angucken kann?
Viele Grüße
Mattes