[thelist] CSS - Clarification on Code

M.G.Noriega manuel at simplelogica.net
Thu Oct 2 16:49:46 CDT 2003


Brian wrote:

> What differences, if any, are there in the following examples:
>
> 1) list-style: none;
> &
> list-style-type: none;
> EX: http://www.maxdesign.com.au/presentation/listutorial/horizontal02.htm
>
The *list-style* property is a shorthand for the *list-style-type 
<http://www.htmlhelp.com/reference/css/classification/list-style-type.html>*, 
*list-style-position 
<http://www.htmlhelp.com/reference/css/classification/list-style-position.html>*, 
and *list-style-image 
<http://www.htmlhelp.com/reference/css/classification/list-style-image.html>* 
properties.
(from  http://www.htmlhelp.com/reference/css/classification/list-style.html)

So, no difference

> 2) margin: 0px;
> &
> margin: 0;
>
No need to specify units when quantity is zero (obviously), but 
sometimes out of custom i catch myself using 0px too :)


> 3) background: #ccc;
> &
> background-color: #ccc;
>
Same as 1)
http://www.htmlhelp.com/reference/css/color-background/background.html
The *background* property is a shorthand for the more specific 
background-related properties.


> I am beginning to think these may be personal choice or a shorthand. I 
> have tried all in several situations but have been unable to nail this 
> down.

1) and 3) are shorhands. 2) is just redundancy

HTH :)

-- 
Manuel González Noriega
Simplelógica, construcción web @ http://simplelogica.net
Logicola es el weblog de Simplelógica http://simplelogica.net/logicola/




More information about the thelist mailing list