Jump to content

How to apply a child div class


newcoder1010

Recommended Posts

<div class="NumberOfPeople_R">  <label for="edit-submitted-eventinformation-number-of-people">Number of people </label>   <input required="required" class="NumberOfPeople_C form-text form-number required" type="text" id="edit-submitted-eventinformation-number-of-people" name="submitted[EventInformation][number_of_people]" size="4" min="10" max="250" step="1"> <div class="description">10 to 250</div></div>

Hello,

 

I have the above html and I am trying make the text '10 to 250' red color for one div class description only. I tried this and did not work.

.NumberOfPeople_R .description {color:red;}

Thanks.

Edited by newcoder1010
Link to comment
Share on other sites

That looks correct. Are there any other CSS rules with higher precedence interfering with the style? You can see what styles are being applied to an element in the developer tools by pressing F12 in most browsers.

Link to comment
Share on other sites

<div class="NumberOfPeople_R">  <label for="edit-submitted-eventinformation-number-of-people">Number of people </label>   <input required="required" class="NumberOfPeople_C form-text form-number required" type="text" id="edit-submitted-eventinformation-number-of-people" name="submitted[EventInformation][number_of_people]" size="4" min="10" max="250" step="1"> <div class="description"><p>10 to 250</p></div></div>

and here is the css

.description p {color:red;}

the reason why .description {color:red;} this give you succes because you wrapper div with class description whatever inside div will be red

Link to comment
Share on other sites

I have a feeling because '.NumberOfPeople_R' is different colour to '.description' in post#1 that it has not been saved correctly as UTF encoded, as the css styling is correct and should work, unless it is being overriding somewhere, just thought i would mention this as it has happened before.

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...