Jump to content

Centre on the screen


glenelkins

Recommended Posts

Hi

 

Ok this is really starting to get on my wick!

 

I have a style sheet setup as follows

 

body {

margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;

text-align: center;

font-family: Verdana,Arial,serif;
font-size: 10pt;

}


#main {

position: absolute;
top: 0px;
left: 0px;
width: 1024;
height: 100%;

}

#header {

position: relative;
top: 0px;
left: 0px;
width: 1024px;
height: 148px;

}

#navbar {

position: relative;
top: 0px;
left: 0px;
width: 1024px;
height: 35px;

}

#login_join {

position: absolute;
top: 10px;
left: 10px;

}

#main_body {

position:relative;
top: 0px;
left: 0px;
width: 1024px;
height: 100%;

}

#tabs {

position: absolute;
top: 148px;
left: 0px;
width: 1024px;
height: 30px;
text-align: center;

}

#content {

position: absolute;
top: 200px;
left: 0px;
width: 1024px;
height: 100%;
text-align:center;

}

h1 {

font-size: 12pt;
font-weight: bold;

}

a {

color: #000000;
text-decoration: none;

}

a:hover {

color: #00000;
text-decoration: underline;

}

.title1 {

font-weight: bold;
font-size: 10pt;

}

.title2 {

font-size: 8pt;
color: #000080;

}

.text1 {

font-size: 8pt;

}

#latest_news_title {

position: absolute;
top: 19px;
left: 115px;
color: #000000;
font-weight: bold;

}

 

all is well and good! Everything lines up like it should bla bla... now , my client wants the whole thing in the middle of the screen. Ok, so i thought id put <div align="center"></div> around everything...did it work? NO! i tried setting up a new tag #outer which aligned the content to centre, did it work? NO!

 

Any ideas? Its really doing my head in

Link to comment
Share on other sites

I'll assume you are talking about this site?  If so, on #main you need to remove position: absolute; and give it margin: 0 auto;

 

When I did this it messed up some other elements within the site.  This is being caused because you have assigned several elements position: absolute;, you will need to remove those.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.