944,208 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Nov 3rd, 2009
0

margin in css

Expand Post »
css Syntax (Toggle Plain Text)
  1. margin-left:auto;
  2. margin-right:auto;
is working in firefox but not working in ie can someone help plz i want to center the page .
Last edited by peter_budo; Nov 4th, 2009 at 7:36 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rudz is offline Offline
19 posts
since Oct 2009
Nov 3rd, 2009
0
Re: margin in css
i wana test it on ie6
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rudz is offline Offline
19 posts
since Oct 2009
Nov 3rd, 2009
0
Re: margin in css
As long as the div you're attempting to center has a static width, IE6+ shouldn't have a problem with auto.

Perhaps if you provided a URL, or code snippets, we'd be able to better help you.
Reputation Points: 19
Solved Threads: 12
Junior Poster in Training
scottloway is offline Offline
55 posts
since May 2008
Nov 3rd, 2009
0
Re: margin in css
Click to Expand / Collapse  Quote originally posted by scottloway ...
As long as the div you're attempting to center has a static width, IE6+ shouldn't have a problem with auto.

Perhaps if you provided a URL, or code snippets, we'd be able to better help you.
thx man i found the problem it was from the doctype of the html
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rudz is offline Offline
19 posts
since Oct 2009
Nov 3rd, 2009
0
Re: margin in css
Interesting, so was IE6 in quirks then? Out of curiosity, what was your previous (problematic) doctype?
Reputation Points: 19
Solved Threads: 12
Junior Poster in Training
scottloway is offline Offline
55 posts
since May 2008
Nov 3rd, 2009
0
Re: margin in css
To center a page you should use this CSS

HTML and CSS Syntax (Toggle Plain Text)
  1. #header {
  2. margin: 0 auto;
  3. }
  4. #wrapper {
  5. margin: 0 auto;
  6. }
  7. #footer {
  8. margin: 0 auto;
  9. }

This >>> margin: 0 auto; <<< Will center whatever CCS section its in. If you want something to move left or right then you replace this with the
HTML and CSS Syntax (Toggle Plain Text)
  1. float: left;
or
HTML and CSS Syntax (Toggle Plain Text)
  1. float: right;
elements.

Hope this helps.

I am a Web Developer and all the developers I know use this software. Its Open Source (Free) and shows you bugs in all Internet Explorer from IE5, 6, 7 & 8

Its called IETester and you can download it from here >>> IETester
Last edited by Wrams; Nov 3rd, 2009 at 5:18 pm.
Reputation Points: 28
Solved Threads: 1
Newbie Poster
Wrams is offline Offline
22 posts
since Nov 2008
Nov 3rd, 2009
0
Re: margin in css
Click to Expand / Collapse  Quote originally posted by scottloway ...
Interesting, so was IE6 in quirks then? Out of curiosity, what was your previous (problematic) doctype?
i 4 get it i guess doctype1.0....
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rudz is offline Offline
19 posts
since Oct 2009
Nov 3rd, 2009
0
Re: margin in css
Right click on your websites homepage or where ever the problem lies and then select View Source then go right to the top and copy the code Doctype Decleration here.

That way we can see if its got a mis type or something.
Reputation Points: 28
Solved Threads: 1
Newbie Poster
Wrams is offline Offline
22 posts
since Nov 2008
Nov 3rd, 2009
0
Re: margin in css
Click to Expand / Collapse  Quote originally posted by Wrams ...
Right click on your websites homepage or where ever the problem lies and then select View Source then go right to the top and copy the code Doctype Decleration here.

That way we can see if its got a mis type or something.
i closed it without saving so i can't get it.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rudz is offline Offline
19 posts
since Oct 2009
Nov 3rd, 2009
0
Re: margin in css
I don`t find any problem!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sereYboth is offline Offline
7 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Different Monitor resolutions changing layout! Help
Next Thread in HTML and CSS Forum Timeline: Why font-size is affecting the gap between divs in this example?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC