Jump to content

How to style content of div class


newcoder1010
 Share

Recommended Posts

Hi,

 

I have this html. How can I apply css to $9000 only.

	   <div class="views-field views-field-field-discount-price">  
     	   <div class="field-content">
		       <del> $9,995 </del> 
			     $9,000
		   </div> 
	   </div>

This code makes all red. Instead, I like to style only $9,000.

.views-field-field-discount-price {color:red; font-weight:bold;}

Thanks.

 

 

 

Link to comment
Share on other sites

Unless you place it in a element to target like a span

	   <div class="views-field views-field-field-discount-price">  
     	   <div class="field-content">
		       <del> $9,995 </del> 
			     <span>$9,000</span>
		   </div> 
	   </div>
 .field-content span {color:red; font-weight:bold;}

The only other longer way is to reset content colour in del element,

.views-field-field-discount-price {color:red; font-weight:bold;}
.views-field-field-discount-price del {color:black; font-weight:normal;} /* reset to default/normal colour */
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
 Share

×
×
  • Create New...