1

How can i hide button in css it the button text is read more.

I have a add to cart button on web site product archive page. But when the product will go out of stock the check changes to read more. I want to hie the button the the text changes to read more.

1
  • can you please share html Commented Mar 8, 2018 at 13:16

3 Answers 3

11

HTML

<input type="button" value="read more"/>

CSS

input[value="read more"]{ display:none; }

input[value="read more"]{
display:none;
}
<input type="button" value="read more"/>

<input type="button" value="add to cart"/>

Sign up to request clarification or add additional context in comments.

3 Comments

Hi, I tried its not working. This is he button class<a rel="nofollow" href="abc.savvatech.com/en/product/high-wall-ac-frost-4/…" data-quantity="1" data-product_id="289" data-product_sku="YK9FZC028BAH-AAX" class="button product_type_simple ajax_add_to_cart" target="_self">Read more</a>
I suppose if product out of stock than, it should be 0 [data-quantity="0"], In this case you can use [data-quantity="0"] { display:none; }
see my suggestion above
1

You should use a style to rub out the button styles, but it will still keep the button text there. Apply a css class such as this to the button

.icon-button {
   border: none;
   background:none;
}

Comments

0

You should add display: none; to yor button style to hide.

1 Comment

this will not work! display:none will hide the entire button for sure, but will also hide the text of the button, as that is part of the button!

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.