homerun
homerun

Reputation: 20745

HTML and CSS , position absolute question

Is it good and desirable to put all the web site content in a div with the following styling?

<div style="position:absolute; top:0; left:0; width:100%;">
        ALL site content come here
</div>

My problem is that i want to put in some places in the site divs that the width will be 100% without the spaces in the sides , so if i put all the site content in one absolutely div and put a normal div with 100% width it will be from side to side without the spaces in the sides example :

<div style="width:100%;background-color:yellow;"></div>

so , is that good to do that? and if it get some difficulties on the way?

Upvotes: 0

Views: 117

Answers (1)

700 Software
700 Software

Reputation: 87773

I think what you are suggesting is safe, but you may accomplish what you want by adding style="margin:0" to your <body>. Or if you have a .css file, you can just add body{margin:0} to it. It would be simpler I think, but then, I am not sure whether I understand your question correctly.

Upvotes: 1

Related Questions