Jump to content

css style inheritance


chadmichael

Recommended Posts

I noticed that in the following style delcaration, not all of the things are inherited.

 body {border: 1px solid green; color:aqua;}

The text coloring is inherited by every child of the containing body element, but not the border styling. THis makes sense of course, logically, but can someone summarize the types of attributes that are inherited and those that aren't?

Link to comment
Share on other sites

There isn't a rule for defining what properties are inherited and what not. That's defined in the CSS specification itself.Some of the properties that are inherited include font (all), text (all), color, direction, letter-spacing and maybe few more.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...