Topic: More CSS positioning (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28862" title="Pages that link to Topic: More CSS positioning (Page 1 of 1)" rel="nofollow" >Topic: More CSS positioning <span class="small">(Page 1 of 1)</span>\

 
loj58
Nervous Wreck (II) Inmate

From: I'm over here, now
Insane since: Jul 2006

IP logged posted posted 01-27-2007 09:18 Edit Quote

Alright you CSS gurus I'm kinda slow but I am learning this stuff.

I ran into a problem though. I want to center my content div on the page ...right.

Well after some reading I found the

code:
margin: 0 auto;

method. Found that I can't use

code:
position:whatever;

... so I deleted it from my style sheet.
Alright great! it works....but but but... Now what do I do to get a top margin?

I tryed

code:
margin: 50 auto;

.... doesn't work
I tryed adding

code:
margin top: 50;

....doesn't work

Html is here

CSS is here

Flashy signature here...

(Edited by loj58 on 01-27-2007 09:26)

mas
Maniac (V) Mad Librarian

From: the space between us
Insane since: Sep 2002

IP logged posted posted 01-27-2007 10:36 Edit Quote

margin-top:50px; would be the correct code...

The Space Between Us | My Blog: lukas.grumet.at

DL-44
Lunatic (VI) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 01-27-2007 18:42 Edit Quote

first: when specifying a number other than 0, you need to specify your unit of measure - 50 what?

second: when specifying in the manner you have used, the first value represents the top and bottom, the second value represents the left and right. You can also specify all four sides seperately, in the following order: top right bottom left;

So in your case, you could use any of the following methods:

margin:50px auto; (will put 50 px both top and bottom)
margin:50px auto 0 auto; (will p ut 50px top, 0 bottom)
or using two declrations:
margin:0 auto;
margin-top:50px; (make sure if you do this, the 'margin-top' is following the 'margin' declaration: the last delclaration supercedes any previous ones)

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

IP logged posted posted 01-27-2007 21:01 Edit Quote

Horse's mouth: http://w3.org/TR/CSS21/box.html#propdef-margin

loj58
Bipolar (III) Inmate

From: I'm over here, now
Insane since: Jul 2006

IP logged posted posted 01-27-2007 23:05 Edit Quote

Thanks so much guys, I guess I had the right idea.... just fell short on the implementation.

Flashy signature here...



Post Reply
 
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
 
Your Text:
Loading...
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu