Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving a html page down and to the right! how?

Status
Not open for further replies.

dor1979

Programmer
Jul 20, 2003
2
GB
hi,
all i want to know is how i can use css to move all my html pages to the left 50 pixels and down 100 pixels?
(so to leave room for a javascript menu, at the moment the menu goes over the text)
 
Code:
<div id=&quot;mainContent&quot; style=&quot;position:absolute; left:50px; top:100px;&quot;><!--Main Content Goes Here --></div>
 
cheers, but
i have many html files with php in them. So i have a seperate css file. I hope to use this file to move all my text to the right of my menu. Could i use position:absolute in my css file to move all the things in the body?

Correct me if i am wrong but u would put this at the top of every html file:<div id=&quot;mainContent&quot; style=&quot;position:absolute; left:50px; top:100px;&quot;><!--Main Content Goes Here --></div>
 
Well, I'd perhaps put a global style declaration in my stylesheet. say
Code:
.mainBody {position:absolute;
           left:50px;
           top:100px;
          }
Then at the top of the body:
Code:
<div class=&quot;mainBody&quot;>

Then the rest of the body content.

Then before the </body> tag:
Code:
</div>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top