Log In · Register

 
 
Closed TopicStart new topic
Position:absolute and centering
GunsNRachel
post Aug 16 2008, 03:05 PM
Post #1


Senior Member
****

Group: Member
Posts: 292
Joined: Jul 2007
Member No: 545,047



I know when you have position: absolute and you put left: 50% it's supposed to center what you want to center.. but mine isn't? I'm confused. It puts it to the right instead of center.

Here's the code:
CODE
.heading{
width:700;
height:300;
background-color:ffffff;
border:0px;
border-color:000000;
border-style:solid;
position:absolute;
left:50%;
font-family:;
color:;
font-weight:normal;
font-size:;
letter-spacing:;}


 
danielkraus
post Aug 16 2008, 03:13 PM
Post #2


Senior Member
***

Group: Member
Posts: 62
Joined: Aug 2008
Member No: 676,822



Not sure if this will help, as I am new, but you could add this
CODE
top:0%;


If that does not work, I sometims will use
CODE
margin-left:XXXX;_margin-left:XXXX;
         margin-top:XXXX;_margin-top:XXXX;


This may work it may not, but I usually try these options first. Hope it at least helps a little.
******************
Read what schizo wrote below, I missed the lack of "px" on your width and height.
Reason for edit: Use [code] for smaller codes. - Gabi. ;)
 
schizo
post Aug 16 2008, 03:13 PM
Post #3


Senior Member
******

Group: Staff Alumni
Posts: 2,435
Joined: Feb 2007
Member No: 506,205



You have to add margin-left:#px in there. Since the width is 700px, set the number to about -350.
 
GunsNRachel
post Aug 16 2008, 03:31 PM
Post #4


Senior Member
****

Group: Member
Posts: 292
Joined: Jul 2007
Member No: 545,047



the margin-left thing is just making it go more to the right?
 
schizo
post Aug 16 2008, 03:34 PM
Post #5


Senior Member
******

Group: Staff Alumni
Posts: 2,435
Joined: Feb 2007
Member No: 506,205



It shouldn't. Right now you have nothing to position it. Just having left:50% isn't going to work.
 
Jghelfi
post Aug 16 2008, 03:38 PM
Post #6


Senior Senior Member
******

Group: Official Member
Posts: 1,507
Joined: Sep 2007
Member No: 571,541



CODE
MARGIN-LEFT= GOES TO THE RIGHT
MARGIN-RIGHT= GOES TO THE LEFT
MARGIN-TOP= GOES TO THE BOTTOM
MARGIN-BOTTOM= GOES TO THE TOP

LEFT: 1-49% = GOES TO THE LEFT on a small number
LEFT: 50-100% = GOES TO THE RIGHT on a big number
 
GunsNRachel
post Aug 16 2008, 03:53 PM
Post #7


Senior Member
****

Group: Member
Posts: 292
Joined: Jul 2007
Member No: 545,047



I must be on crack! haha. I just figured it out. Thanks guys.
 
schizo
post Aug 16 2008, 03:55 PM
Post #8


Senior Member
******

Group: Staff Alumni
Posts: 2,435
Joined: Feb 2007
Member No: 506,205



Topic closed and moved to Resolved.
 

Closed TopicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: