The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Conditional CSS – Changing the look and feel of a div if another is displayed

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #208637

    I am listing a price under a product along with a sale price next to it (span). The sale price is setup as a conditional (PHP) where it is not displayed if nothing is entered in its field on the backend in WordPress.

    What I’m attempting to accomplish is… For example, the product price will be displayed as a black color when the “sale” price is NOT listed, but displayed as a grey color with strike through decoration when the “sale” price IS listed.

    I’m guessing there will be some sort of conditional CSS needed, but how can this be accomplished with what code?

    Thanks for your help!!!


    I would change the HTML output to something like this:


    He’s using WordPress and already performing a conditional, pretty sure he can reorganize his HTML output to make things easier.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.