...

View Full Version : margin shorthand - how?



effpeetee
07-21-2008, 10:15 AM
The validator does not like this. It refers to the shorthand version. How else should I put it?


#section{
width:66%;
background:#dd0;
margin:0 auto;
margin-bottom:5%;
}

Frank

FWDrew
07-21-2008, 10:17 AM
Hi Frank,



#section{
width:66%;
background:#dd0;
margin:0px auto;
margin-bottom:5%;
}

Or you could do this:

#section{
width:66%;
background:#dd0;
margin:0px auto 5% auto;
}

Drew

effpeetee
07-21-2008, 10:20 AM
Hi Frank,



#section{
width:66%;
background:#dd0;
margin:0px auto;
margin-bottom:5%;
}

Or you could do this:

#section{
width:66%;
background:#dd0;
margin:0px auto 5% auto;
}

Drew
Ah! So that's what they meant.

Many thanks.

Frank

VIPStephan
07-21-2008, 12:20 PM
#section{
width:66%;
background:#dd0;
margin:0px auto 5% auto;
}


You could even make it shorter:


margin: 0 auto 5%;


Three values apply to:

top margin
left and right margin altogether
bottom margin

effpeetee
07-21-2008, 03:54 PM
You could even make it shorter:


margin: 0 auto 5%;


Three values apply to:

top margin
left and right margin altogether
bottom margin


That's real cool.

I'll implement that.

Thanks,

Frank



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum