i have got a div with width=600px, but when i put some text inside it, it exceeds the 600px size instead of breaking up and continuing on another line.
i inherited this code and first though maybe it was the positioning declared in the stylesheet or because i dont have a reset.css present. Any help will do, going out of my mind here.

Must have something to do with your css or declarations before this div. If I try this:

<body>
	<div style="width:500px; background-color:red;">
		<p>And now we put a lot of text inside this div to see what is going to happen.</p>
	</div>
</body>

the text is on two lines, the first breaks after "is". Maybe you could post (part) of the code where it goes wrong.

add this text-alight:justify;float:left;
and set your margin-l and r

Member Avatar for diafol

add this text-alight:justify;float:left;
and set your margin-l and r

I wouldn't.

Member Avatar for soldierflup

I wouldn't.

Can you provide eventually a link to the page or give us the css and the html to see what happens ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.