Doubt about CSS in inheritance

Asked

Viewed 40 times

0

Herança.

The configuration of the Father 'li' is not being inherited by the children 'li#foto01' and 'li#foto02' I do not understand why

  • Also put the html code so we can see.

1 answer

3


When you set the property background, in fact you are setting a list of properties with the following values:

  • background-image: none

  • background-position: 0% 0%

  • background-size: auto auto

  • background-repeat: repeat

  • background-origin: padding-box

  • background-clip: border-box

  • background-attachment: scroll

  • background-color: transparent

Then you overwrite the value of background-position

To fix this you can:

  • Invert the order (put the style ul#album-fotos li afterward)

  • Put the !important after ownership background-position (method not recommended)

  • Grind background for background-image and background-repeat

Browser other questions tagged

You are not signed in. Login or sign up in order to post.