Connecting Tech Pros Worldwide Help | Site Map

about my div

Member
 
Join Date: Dec 2008
Posts: 80
#1: Aug 3 '09
how can i centralize div with an external css named wrap
Expand|Select|Wrap|Line Numbers
  1. #wrap {
  2.     position: relative;
  3.     width: 456px;
  4.     margin: 40px  30px ;
  5. }
  6.  
jhoborg's Avatar
Newbie
 
Join Date: Aug 2009
Location: in a hole
Posts: 6
#2: Aug 3 '09

re: about my div


To center-align the div with the id "wrap", you must set its right and left margins to "auto".

Expand|Select|Wrap|Line Numbers
  1. #wrap {
  2.      position:relative;
  3.      width: 456px;
  4.      margin: 40px auto;
  5. }
  6.  
This forces the browser to make the left and right margins the same size.
Newbie
 
Join Date: Aug 2009
Posts: 1
#3: Aug 4 '09

re: about my div


This article might help you, i guess...
http://htmlcsstutorials.blogspot.com...tally-and.html
Reply