Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 10-24-2006, 06:38 PM Centering Of Pages
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 961
Name: Darren
Location: England
Trades: 0
Hi there,

please have a look at this page http://www.h2ox.net

Ive been asked to revamp the site a bit but am failing at the first hurdle!!

how can i make this centred on the page?

I copied the whole thing inot a centred cell but this just messed up the .css styling?

I didn't make this from scratch so am a bit lost with it!

Cheers
rolda hayes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-24-2006, 07:03 PM Re: Centering Of Pages
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
It will actually be pretty simpe to center the page the way you have it coded now. Change:

#container {width: 741px;}

to

#container {width: 741px; margin:0 auto}

and you should see everything centered. The auto part of the margin lets the browser center the page. The code is a shortcut for saying

margin-top: 0
margin-right: auto
margin-bottom: 0
margin-left: auto
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 10-24-2006, 07:14 PM Re: Centering Of Pages
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 961
Name: Darren
Location: England
Trades: 0
Thanks, thats saved a headache!
rolda hayes is offline
Reply With Quote
View Public Profile
 
Old 10-24-2006, 07:30 PM Re: Centering Of Pages
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Glad to help.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 10-24-2006, 07:33 PM Re: Centering Of Pages
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 961
Name: Darren
Location: England
Trades: 0
Hmmm, not doing anything.

Am I doing this right? I changed the code in the .css file. Do I then need to put the whole page in a centered cell or should it automatically center as it is?
rolda hayes is offline
Reply With Quote
View Public Profile
 
Old 10-24-2006, 07:43 PM Re: Centering Of Pages
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 961
Name: Darren
Location: England
Trades: 0
Its centering in dreamweaver but not when view in iE
rolda hayes is offline
Reply With Quote
View Public Profile
 
Old 10-24-2006, 07:51 PM Re: Centering Of Pages
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
It's working in Firefox at the moment. I think to get it to work in IE you need to remove the first line of the document

<?xml version="1.0" encoding="iso-8859-1"?>

I think IE chokes on that line sometimes. Just start your document with the <doctype> line and it should be fine.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 10-24-2006, 07:54 PM Re: Centering Of Pages
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 961
Name: Darren
Location: England
Trades: 0
Works fine now,

Thanks for the help!
rolda hayes is offline
Reply With Quote
View Public Profile
 
Old 10-24-2006, 08:11 PM Re: Centering Of Pages
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Cool. Glad it's all working.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 10-25-2006, 05:45 AM Re: Centering Of Pages
pjaj's Avatar
Average Talker

Posts: 17
Name: Peter Jennings
Location: Oxfordshire UK
Trades: 0
Another way of getting it to work in both FF and IE is:-

/*---- ( layout - background etc ) ----*/

body {
text-align:center; /* centers for IE, not FF*/
}

/*-- ( outer wrapper for whole page) --*/

#container {
margin: 0px auto; /*centers for FF not IE*/
text-align:left; /* puts everything else back to the left */
}
pjaj is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Centering Of Pages
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53721 seconds with 12 queries