-1

I have this CSS here but its not working :(

Here is the CSS

.wpsc-product .hentry{
    border-bottom: none;
    padding: 0 !important;
    position: relative;
}

this is what I am trying to call

<article id="post-60" class="post-60 wpsc-product type-wpsc-product status-publish hentry">

how would I apply to this article and it has to invlice wpsc-product because thats what I am targeting.

1
  • are you trying to override another existing style or something applied by a script?
    – Rooster
    Oct 11, 2012 at 21:58

4 Answers 4

3

.wpsc-product .hentry is a combinator selector which will match any element with a class of hentry that has an ancestor with a class of wpsc-product, like

<article class="wpsc-product"><section class="hentry"></section></article>

You want .wpsc-product.hentry (no space)

0
1

remove the space in your css selector

.wpsc-product.hentry { ... }
1

That article element will only get the CSS rule you have if it is inside another element with the wpsc-product class, because   (an empty space) is actually an operator in CSS, meaning that the second selector is a descendent (inside) the first.

To select elements that have both classes, use .wpsc-product.hentry as the selector. Concatenation of selectors requires all of them on the element.

0

To adress a tag that has more than one class, you should use css selectors like:

class1.class2.class3 { ... }

In your case:

.wpsc-product.hentry

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.