Hiding a button in HTML5 and CSS when on Smartphone

0

I made a responsive Web application, which when it arrives in Checkout has two buttons: Print and Save.

Only the user (client) on the smartphone clicks to print even without a printer.

I have tried to extend with @media, but I can not.

How can I hide the "Print" button and leave only the "Save" button when the user is on Smatphone or Tablet?

    
asked by anonymous 08.07.2018 / 15:39

1 answer

2

If you are using bootstrap4, you can use the class d-none (means display none)

Because this set of classes accepts prefixes, you can add the class d-sm-block to switch to display block when the screen is small or higher.

In the end, it would look like this:

<button class='d-none d-sm-block'>Imprimir</button>

When the screen is small, medium, large or extra large, you will have a normal display block. When the screen is smaller than small, type extra small (or smartphone) the display will be none.

I hope I have helped.

    
08.07.2018 / 17:23