I have two questions I seek your help with:
-
I am trying to remove the grey border using CSS but can’t seem to remove it.
My code is:
<p class="product woocommerce add_to_cart_inline " style="border:4px solid #ccc; padding: 12px;"> <span class="woocommerce-Price-amount amount"> <span class="woocommerce-Price-currencySymbol">$</span> 29.00 </span> <a href="?add-to-cart=511" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="511" data-product_sku="plan1" aria-label="Add “Plan 1” to your cart" rel="nofollow"> Add to cart </a> </p>
My CSS is:
p.product.woocommerce.add_to_cart_inline { border:0px; } span.woocommerce-Price-amount.amount { display:none }
Here is my JSFiddle.
Can someone please let me know why my CSS code does not work? -
In Chrome developer tools, is there a way to easily copy the CSS selector?
For example, after pointing out that this is the selector.
Is there a way to easily copy the “p.product.woocommerce.add_to_cart_inline”?Right now I type it out manually myself. I am pretty sure that there should be a way to copy it and paste it directly?
4
Answers
change your HTML code you have inline css for border in html
p
tagor you can add important to css like this:
It’s not working because of css specificity rules
You are adding border style inline in
p
tag which has more specificity than css selector.To fix this, remove the border style from the inline and apply it using another css selector.
Here is updated fiddle
Remove border css style from style attribute
add !important