MinusMyThoughts Posted January 10, 2007 Share Posted January 10, 2007 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 More sharing options...
boen_robot Posted January 10, 2007 Share Posted January 10, 2007 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>Anddiv > 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 More sharing options...
MinusMyThoughts Posted January 10, 2007 Author Share Posted January 10, 2007 awesome. yeah, i don't know much about CSS. just enough to slowly hack through it......thanks!love,jason Link to comment Share on other sites More sharing options...
jesh Posted January 10, 2007 Share Posted January 10, 2007 div > span Doesn't that fail in IE? Hence all of the IE hacks based off of that? Link to comment Share on other sites More sharing options...
boen_robot Posted January 10, 2007 Share Posted January 10, 2007 In IE6- yes. But I think (I haven't verified) it works in IE7. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now