margin in css

Reply

Join Date: Oct 2009
Posts: 17
Reputation: rudz is an unknown quantity at this point 
Solved Threads: 0
rudz rudz is offline Offline
Newbie Poster

margin in css

 
0
  #1
Nov 3rd, 2009
  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)
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 17
Reputation: rudz is an unknown quantity at this point 
Solved Threads: 0
rudz rudz is offline Offline
Newbie Poster
 
0
  #2
Nov 3rd, 2009
i wana test it on ie6
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 7
Reputation: scottloway is an unknown quantity at this point 
Solved Threads: 2
scottloway scottloway is offline Offline
Newbie Poster
 
0
  #3
Nov 3rd, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 17
Reputation: rudz is an unknown quantity at this point 
Solved Threads: 0
rudz rudz is offline Offline
Newbie Poster
 
0
  #4
Nov 3rd, 2009
Originally Posted by scottloway View Post
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
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 7
Reputation: scottloway is an unknown quantity at this point 
Solved Threads: 2
scottloway scottloway is offline Offline
Newbie Poster
 
0
  #5
Nov 3rd, 2009
Interesting, so was IE6 in quirks then? Out of curiosity, what was your previous (problematic) doctype?
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 22
Reputation: Wrams is an unknown quantity at this point 
Solved Threads: 0
Wrams's Avatar
Wrams Wrams is offline Offline
Newbie Poster
 
0
  #6
Nov 3rd, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 17
Reputation: rudz is an unknown quantity at this point 
Solved Threads: 0
rudz rudz is offline Offline
Newbie Poster
 
0
  #7
Nov 3rd, 2009
Originally Posted by scottloway View Post
Interesting, so was IE6 in quirks then? Out of curiosity, what was your previous (problematic) doctype?
i 4 get it i guess doctype1.0....
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 22
Reputation: Wrams is an unknown quantity at this point 
Solved Threads: 0
Wrams's Avatar
Wrams Wrams is offline Offline
Newbie Poster
 
0
  #8
Nov 3rd, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 17
Reputation: rudz is an unknown quantity at this point 
Solved Threads: 0
rudz rudz is offline Offline
Newbie Poster
 
0
  #9
Nov 3rd, 2009
Originally Posted by Wrams View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 7
Reputation: sereYboth is an unknown quantity at this point 
Solved Threads: 0
sereYboth's Avatar
sereYboth sereYboth is offline Offline
Newbie Poster
 
0
  #10
Nov 3rd, 2009
I don`t find any problem!
_____________________________________________________
Sereyboth and Blogging | Blogging Tip & Trick | Interview | Free Blog Template
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC