Jump to content

Different Default Settings in One Style Sheet?


MinusMyThoughts

Recommended Posts

i don't know what to call what i'm trying to do, so hopefully i can explain it adequately......i'd like to be able to set a default for something like text size inside a div called header, which will have multiple divs and other elements inside it. if i can avoid it, i'd like to be able to merely use a <p> tag, rather than needing to add <p class="headerText"> to every tag......but, when i get to the body, i'd like to reset that default text size, again without needing a class identifier......is there any way to set properties for a div that all contained elements will inherit?...thanks!love,jason

Link to comment
Share on other sites

Ever heared of the child and descendant selectors? For example

div span

matches

<p>text<span>text</span>text</p><div> <h1>text<span>text</span>text</h1> <p>text<span>text</span>text</p> <span>text</span></div>
And
div > span

matches

<p>text<span>text</span>text</p><div> <h1>text<span>text</span>text</h1> <p>text<span>text</span>text</p> <span>text</span></div>
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...