Nie rozumiem dziedziczenia w CSS
tomjas - 04-06-2010 22:35
Nie rozumiem dziedziczenia w CSS
Witam.
Wlasnie spedzilem ponad godzine pozycjonujac elementy menu poziomego.
Mam:
#navcontainer {
height: 38px;
margin:0;
padding:0;
}
a w nim
#navcontainer ul {
list-style:none;
}
Dlaczego "ul" nie dziedziczy stylow "margin" i "padding" i umiejscawia
sie w dziwnym miejscu? Dopiero po dodaniu powyzszych do "ul" dziala tak
jak ja chce.
Z gory dzieki i pozdrawiam.
yew - 04-06-2010 22:35
W dniu 2010-05-18 12:14, tomjas pisze:
> Witam.
> Wlasnie spedzilem ponad godzine pozycjonujac elementy menu poziomego.
> Mam:
>
> #navcontainer {
> height: 38px;
> margin:0;
> padding:0;
> }
>
> a w nim
>
> #navcontainer ul {
> list-style:none;
> }
>
> Dlaczego "ul" nie dziedziczy stylow "margin" i "padding" i umiejscawia
> sie w dziwnym miejscu? Dopiero po dodaniu powyzszych do "ul" dziala tak
> jak ja chce.
Bo to nie jest dziedziczenie tylko zawê¿anie.
--
yew
satellite - 04-06-2010 22:35
On 2010-05-18 12:14, tomjas wrote:
> Dlaczego "ul" nie dziedziczy stylow "margin" i "padding" i umiejscawia
one nie pozwalaja sie dziedziczyc - zobacz w specyfikacji
http://www.w3.org/TR/CSS2/box.html#propdef-margin