HTML Help Forum HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

Centering frames
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum -> HTML Frame
View previous topic :: View next topic  
Author Message
Informatrix



Joined: 24 Jun 2009
Posts: 2

Posted: Wed Jun 24, 2009 1:19 am     Centering frames  

Hell people,

I have a problem which I'm after some help with.

I will explain I am not a web-designer... Although I have found I can edit some else's code {in small doses}. I am no designer! If given a blank sheet of paper, I'd sit there hours and still end up with nothing... or the analogy if given a canvass, oil paints & paint brushes - you won't get the Mona Lisa out of me... But that doesn't mean I don't know how to mix paint!

Anyway, the problem.

A friend has a web site which, when opened, always "left loads" (that is if there is any 'white space left over, it's always down the right hand side. The pages are made up of frames. Since screen resolution and sizes have got bigger and bigger this has become more and more of a problem...

The people who designed and wrote the site disappeared some time ago - and but for this one change, it doesn't need a great overhall.

I've looked at the source code but nothing is slapping me around the face to grab my attention on how to centre the frameset itself on the page to that both margins are equal if there's any space left over.

As I said, I don't want to re-invent the wheel or learn all this is to know about how to create websites from scratch because like I outlined above: Armed with a paint brush or two and some oil paints, You're still only going to get something akin to that "Mr Bean" restoration for those of you who've seen the movie.... I also don't want anyone to do this for me.

But if anyone can point me at the right bits on here to read, I really would be very, very garteful.

Thanks in advance

Paul
PayneLess Designs



Joined: 28 Feb 2007
Posts: 4288
Location: MS

Posted: Wed Jun 24, 2009 2:32 am      

Since you didn't give a link to the problem site, I'll take a guess here. Check to see if the pages are properly style with a width for the page (contents) container. IN order to center the page or any container, a width less than 100% must be given. Then style it with:

margin: 0 auto;
Informatrix



Joined: 24 Jun 2009
Posts: 2

Posted: Wed Jun 24, 2009 5:37 am      

The website concerned is www.reevemetalfinishing.co.uk
sticks464



Joined: 31 Dec 2006
Posts: 2627

Posted: Wed Jun 24, 2009 7:30 am      

You can give this a try for centering. Put a container around all your body content, give it a width and apply margins.

example:
Code: <body bgcolor="#000000" leftmargin="0" topmargin="0" onLoad="MM_preloadImages('fire/reeve-metal_f2.jpg')">
<div id="wrapper">
...Rest of content...
</div>
</body>
</html>

Then create a css rule for the container in your stylesheet
Code: #wrapper {
width:720px;/* same width as nested table */
margin:0 auto;/* position to center */
position:relative;
}

The container needs the relative positioning so the absolute positioned div (layer2) will position off the wrapper div and not the body.
 
 
DARFUR
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum -> HTML Frame
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group