| | |
Really basic Noob question- centering page
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2008
Posts: 6
Reputation:
Solved Threads: 0
I'm doing our site and the template I used looks nice on my old monitor, because it fits the screen. My new computer has a widescreen monitor and so now I see that the layout of the page has the page based on the left side of the monitor
How do I set it so the page centres in the monitor, whatever size is used? Isn't there a simple line that goes into the css to do this?
You can see it here: Mission Adventure
How do I set it so the page centres in the monitor, whatever size is used? Isn't there a simple line that goes into the css to do this?
You can see it here: Mission Adventure
•
•
Join Date: Jul 2009
Posts: 20
Reputation:
Solved Threads: 0
Setting the right and left page margins to auto will typically solve this problem. (this creates a even left and right margin with the remaining empty space left over on a larger monitor)
For example if your html is:
Then your css doc should be
Hope this helps
Eric
For example if your html is:
html Syntax (Toggle Plain Text)
<html> <body> <div id="container"> <p>This is your page content</p> </div> </body> </html>
Then your css doc should be
css Syntax (Toggle Plain Text)
body { margins: auto; } #container { width:760px; margins: auto; }
Hope this helps
Eric
Last edited by peter_budo; Jul 10th, 2009 at 5:39 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- [ask[PHP quiz script] how to show 1 question per page ?? (PHP)
- webservice in visual basic asp .net (ASP.NET)
- Question (Networking Hardware Configuration)
- Basic Variables Question (Visual Basic 4 / 5 / 6)
- Getting data from ASP page A to ASP page B using javascript (ASP.NET)
- Noob question about Defining and Declaring. (C++)
- Centering (Java)
- NOOB question , graphical tiles (C++)
- What exploit are they using? (Web Browsers)
Other Threads in the HTML and CSS Forum
- Previous Thread: Drop down Menu
- Next Thread: HTML Tables vs CSS & divs - examples/help
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7





