This is a discussion on "[SOLVED] Centralising a sub-wrap" within the Web Page Design section. This forum, and the thread "[SOLVED] Centralising a sub-wrap are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Centralising a sub-wrap
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Centralising a sub-wrap
Hi all,
Since Linda was kind enough to show me how to create a wrap using CSS so I don't need to use position. I have tried to create a sub wrap within the main wrap that will hold the Header, Content and Footer. The subwraps width wants to be 800px and centralised inside the main wrap. I've looked on the site and I've seen you all saying use:
|
|
|
|
|||
|
Re: Centralising a sub-wrap
I take that you are trying to center all of your elements with margin:0 auto; I think the problem is that you have margin:0; set to the body in the css. Try removing it.
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
|||
|
Re: Centralising a sub-wrap
*sigh*
You have no Doctype. You are probably looking at this in IE6. Those two factors combined will destroy auto margins. Add a Doctype, and validate your site. Please upload your site (or page), and give us a link! |
|
|||
|
Re: Centralising a sub-wrap
http://www.cipherpol.com/test4.htm This is the site, where it says "HELLO ALL" is the subwrap. Once I get that to be centered I was going to put the head, content and footer into it.
|
|
||||
|
Re: Centralising a sub-wrap
Like Mike said ... add a DOCTYPE first.
|
|
|||
|
Re: Centralising a sub-wrap
:S not to sound completely stupid hehe, since I'm at work I'm using Frontpage 2003 which is completely a waste of space. I have Dreamweaver CS3 at home which automatically puts the DOCTYPE in, were as frontpage it doesn't and I don't know how to hehe.
Also I'm using IE7. Last edited by Madball; Nov 6th, 2007 at 13:15. |
|
|||
|
Re: Centralising a sub-wrap
HTML is text. That's all. You can use notepad to add a doctype!
Testing your page confirms my prediction: the centring is working in Firefox, but not in IE6. All you have to do is add a doctype. If you're not already testing in Firefox, you should be! I advise against allowing any program to choose the doctype. Different doctypes have different uses, and Dreamweaver chooses a silly one by default (XHTML trans.). See my article on doctypes for more information. Last edited by MikeHopley; Nov 6th, 2007 at 13:20. |
|
|||
|
Re: Centralising a sub-wrap
OK I've got it working, but not 100%, the text has been aligned to the center of the:
The DOCTYPE I added was: <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" http://www.w3.org/TR/html4/loose.dtd> EDIT!!!! OK it is working, my fault sorry. When I look at it in IE7 it is fine, but when I look at it in Frontpage 2003 editing area it is still aligned to the left. Last edited by Madball; Nov 6th, 2007 at 13:29. |
|
|||
|
Re: Centralising a sub-wrap
Well done!
Your <div> is centred correctly. I don't see the problem. Try reducing the width of the <div>, and adding a background colour, so that you can observe it's behaviour more easily. |
|
||||
|
Re: Centralising a sub-wrap
Quote:
Glad to see you got it working |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to text wrap? | Quetzal | Web Page Design | 9 | Jun 3rd, 2008 18:58 |
| Centralising my site | danny322 | Web Page Design | 16 | Nov 5th, 2007 16:12 |
| div wrap not working on IE pc | jillcary | Web Page Design | 5 | Jul 19th, 2007 17:33 |
| Div outside wrap issue | timmytots | Web Page Design | 5 | Oct 14th, 2006 23:28 |
| How to wrap text around a div | AdRock | Web Page Design | 6 | Sep 5th, 2006 19:02 |