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!

Cascading elements question

Status
Not open for further replies.

TestingXSD

Programmer
Mar 24, 2002
11
US
Given that I have a div tag wrapping a portion of my content, is there a way that I can apply a style to every nested Blockquote? This question is not as dumb as it sounds. I'm talking about nesting.

Something instead of:

Div.content blockqoute
{
FONT-FACE:Arial
}
Div.content blockqoute blockquote
{
FONT-FACE:Arial
}

Div.content blockqoute blockquote blockquote
{
FONT-FACE:Arial
}

Sort of like saying for every tag x inside tag y do this

Thanks for your time

-T
 
Have you tried setting a blockquote class?

There's always a better way. The fun is trying to find it!
 
Your first example is all you need to do:
Code:
div.content blockqoute
{
  font-face: Arial;
}
This will make any blockquote within the <div> with a class content have Arial font. It does not matter how many elements are in between. For example:
Code:
<div class="content">
 <blockquote>
  First
  <blockquote>
   Second
   <blockquote>Third</blockquote>
  </blockquote>
 </blockquote>
</div>
All the blockquotes will have Arial font if you specify the css I have shown above. That css applies to all descendant elements, not just first child. Hope it is clear.
 
I just realized what I said wrong. I need to apply to ANY blockqoute tag. There may be a blockqoute inside a div, inside a div, inside someother type of tag. I just want to say any "blockqoute" tag within this type of div tag gets this type of style.

I am trying to avoid 50 variations on the style.

-T
 
Hey, you've got the word "testing" as part of your handle, have you tried doing any? Declare the first CSS rule that you suggested yourself:
Code:
Div.content blockqoute 
{
  FONT-FACE:Arial
}
and try a few test cases in a document.

You'll find that any <blockquote>s, anywhere inside a <div class="content"> will be rendered in Arial, whether or not there are any intervening elements.

-- Chris Hunt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top