How to Hide Button Text in Phone Mode ? Last Updated : 08 Oct, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report While building a website for small-screen devices like smartphones, it becomes important that we use every bit of screen space wisely, we could not afford to waste any area. To achieve this, we can hide some peripheral elements in phone mode. Hiding button text in phone mode: Example: This example is implemented using CSS. We can use media queries in CSS to hide button text according to the screen size of the device. HTML <!DOCTYPE html> <html> <head> <style> /* Basic styling */ #btn { width: auto; } /* It is triggered when screen size becomes <=768px */ @media(max-width:768px) { #btn-text { /* It hides the button text when screen size <=768px */ display: none; } } </style> </head> <body> <h2 style="color:green"> GeeksforGeeks </h2> <b> Hiding button text in phone mode</b><br /><br /> <button id="btn"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20210520182549/myDelete.png" id="icon"> <span id="btn-text">Delete</span> </button> </body> </html> Example 2: The following example is implemented using bootstrap. HTML <!DOCTYPE html> <html lang="en"> <head> <!-- Including Bootstrap CSS file --> <link rel="stylesheet" href= "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" crossorigin="anonymous"> <style> #btn { width: auto; } </style> </head> <body> <h2 style="color:green"> GeeksforGeeks </h2> <b> Hiding button text in phone mode </b> <br /><br /> <button> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20210520182549/myDelete.png" id="icon"> <!-- In Bootstrap, d-none class sets the display property of span to none in all screen sizes and d-md-inline-block sets the display property to inline-block when screen size >=768px (medium sized displays) --> <span class="d-none d-md-inline-block"> Delete </span> </button> </body> </html> Output: Note: Both codes will give the same output, only the font style will change in the case of bootstrap due to the default bootstrap styling Comment More infoAdvertise with us Next Article How to Hide Button Text in Phone Mode ? D durgeshpushpakar Follow Improve Article Tags : Bootstrap CSS-Properties HTML-Questions Bootstrap-Questions Similar Reads How to display icon next to show/hide text on button ? In this article, we will learn how to add icons with the show/hide text button and also you can use that icon as a button. It will be done here by using JavaScript. In this example, with the help of JavaScript, you can easily toggle between show and hide. Add any icons beside the button or you can u 2 min read How to customize the iPhone 15 Pro's Action Button The iPhone 15 and 15 Pro Max have been on sale for days. The action button is one among many other features. Both new models include action buttons instead of ring/silent buttons. This is useful for multiple purposes since you may choose which activities to perform when you touch it. It's easy to us 10 min read How to Hide Apps on an Android Phone? Want to keep certain apps private on your Android phone? Hiding apps can help you maintain privacy and declutter your home screen. Whether you want to conceal personal apps or just keep your phone organized, there are several methods to hide apps on an Android phone.In this guide, we will provide st 15 min read How to Combine Text and Image on a Button or ImageButton in Android? Image Buttons are used in many android applications for performing some actions. Some of the users of mobile applications sometimes are not aware of the images which are present on that specific buttons. So for informing the user about that button we also add a simple text to our button so that the 4 min read How to Set Buttons Inside an Alert Dialog in Android? In this article, we are going to see how can we set two buttons inside an Alert Dialog. For example, we can see when an alert dialog is pop up then their two types of buttons available one is the Ok or Positive Button another one is Cancel or Negative Button. Alert dialogs are most frequently used i 4 min read Like