Im sure this is simple but I'm scratching my head, I want a header div to be full width, I have it set to 100%. The problem is when I put content in it like a h1 tag, then minimize the browser the content bursts out of the div. The only way I can stop it from happening is by giving the header div a proper width like 1024px, but I want it to be 100% to suit all screens.
I have no width set on the body, just margin, padding set to 0. Do I need to set the body to 100% as well
So the body is now set to 100%. 100% of what? The parent of <body> is <html>. What is that set to? I got hung up on the body width instead of the 'header'. That's what happens when you don't supply the html or css. Apparently your header is floated? Without the complete markup, anything I say is just a wild guess.
There is no width set on the html, not quite sure what your getting at? I just want the content to stay where it is when you drag the size of the browser around, without having to use absolute positioning
A div element should expand the full width of the container on its own. Since you say it's not, I can only assume the div is floated or its contents are but, without a link or the markup, I can only guess.
Here is a link http://www.retford-web-design.co.uk/test/fullwidth.html When you minimize the browser and drag it accross you will see the h1 drops down and makes the div bigger, I just want it to stay where it is without having to give it a fixed width.
Have you used any padding in the header? If you have, remove it. That is your problem. If not, post your code for me.
There is only one way to do this as i can think of. Code is below <html> <head> <title>Untitled</title> <style type="text/css"> <!-- .overflow { text-overflow: ellipsis; overflow: hidden; white-space:nowrap; } --> </style> </head> <body> <div class="overflow"> <h1 title="Now over flowing">Hello world! this is not my first code. And i am not a pro</h1> </div> </body> </html>
There is only one way to do this as i can think of. Code is below Put below on css: .overflow { text-overflow: ellipsis; overflow: hidden; white-space:nowrap; } Put below on Html <div class="overflow"> <h1 title="Now over flowing">Hello world! this is not my first code. And i am not a pro</h1> </div>