Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applying Tag Style Only Within DIV 1

Status
Not open for further replies.

PCHomepage

Programmer
Feb 24, 2009
609
US
Is there some way to apply a general tag style only with the tags are within a DIV?

For example, a style like this:

CSS:
table, td, tr {
	padding: 0;
	margin: 0;
}

needs to be applied only when the table is inside a pair of DIV tags but I'm not sure how parent/child relations are created for multiple elements. Any ideas?
 


The commas mean that the rules to ALL of the specified elements
Without commas will create an hiearchial structure (called "Combinators"

CSS:
div p span {
/* CSS ruleset */
}

the above will apply to a span in a paragraph in a division.

HTML:
<div>
    <p>
        <span> the rules apply here</span>
    </p>
</div>


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top