The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Nested Div & Span items, What is the correct syntax to reference the object?
post Sep 14 2006, 01:20 PM
Post #1

Group: Members
Posts: 1
Joined: 14-September 06
Member No.: 132

We have the code:

<div class="item">
  <!-- item header -->
  <div class="itemHead">
    <span class="itemTitle">The HEADER</span>    

<!-- Body of page -->
  <div class="itemBody">
    <div class="itemText">
      This is the body of the page.

We know we can style each class:
.item {font: arial; }
.itemHead {font-weight: bold; }
.itemBody {font-weight: normal; }

Our question:

How can we change the style on the span tag with the class "itemTitle" ONLY when it's in the div tag with the class "itemHead?" IN the example above, we want to change the style characteristics of the words "The HEADER" to something else.

Thanks for any help!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 23rd March 2019 - 11:22 AM