PDA

View Full Version : CSS Problem



ben22
February 14th, 2008, 05:00 PM
Hi,

I try to create a two column layout with difs, with both difs having the same width. The problem is that the text is floating over the div and not breaking into a new line.

Any help out there????





<html>
<head>
<title>style-Attribut</title>

<style type="text/css">
body {
}



div#left {
float: left;
border: dashed silver;
width: 49%;
color:#000000;




}

div#right {
border: dashed silver;
float: right;
color:#CC0000;
width: 49%;

}


</style>

</head>

<body>



<div id="left">

<h1>Die Seite mit dem besonderen Element</h1>
aber das folgende Element soll etwas Besonderes sein:</p>
<p>Hier sind zwar zentrale Formatdefinitionen vorhanden,

Unser Kopf ist rund, damit das Denken die RichtungRichtungdddddddddddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddd dd Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung Richtung wechseln kann!
</p>

</div>

<div id="right">

<h1>Die Seite mit dem besonderen Element</h1>
aber das folgende Element soll etwas Besonderes sein:</p>
<p>Hier sind zwar zentrale Formatdefinitionen vorhanden,

Unser Kopf ist rund, damit das Denken die Richtung wechseln kann!adsacvasdfasdfasddddddddddddddddddddddddddddd ddddddddddddddddddddddasdddddddddddddddddddddddddd dddddddddddddddddddddddddddddddddddddddddddddddddd ddddddddddddddddddddUnser Kopf ist rund, damit das Denken die Richtung wechseln kann!adsacvasdfasdfasddddddddddddddddddddddddddddd dddddddddddddddddddddd

</p>

</div>

</body>

</html>

MCrittenden
February 14th, 2008, 05:06 PM
When I copied and pasted into html file, it looked fine to me. The words with tons of d's goes out of the divs just because html keeps the words intact even if they're way too long for their container. Just don't make such long words and you should be alright. All of the other words stayed in the div's just fine.

ben22
February 14th, 2008, 05:08 PM
yes, but I need to break these words into new lines.

shawnhcorey
February 14th, 2008, 09:01 PM
How about adding some scrollbars?


div#left {
float: left;
border: dashed silver;
width: 49%;
color:#000000;
overflow: auto;
}

div#right {
border: dashed silver;
float: right;
color:#CC0000;
width: 49%;
overflow: auto;
}