This is a migrated thread and some comments may be shown as answers.

Change text to icon - responsive

1 Answer 496 Views
Button
This is a migrated thread and some comments may be shown as answers.
Ezequiel
Top achievements
Rank 2
Ezequiel asked on 15 Jun 2018, 02:45 PM

I have some buttons with icons and text and some only with text.

How the best way to make the button have only icon in a responsive layout?

Is there some settings I can do it or I need to do it in my scripts?

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 19 Jun 2018, 06:46 AM
Hi Ezequiel,

In order to hide the text of a button on different screen size, you could use media queries. For example you could wrap the text of the button in a span with specific class. Then in your styles, you could hide the element depending on the screen size.
<button id="button" type="button"><span class="hideText">Cancel</span></button>

<style>
@media screen and (max-width: 800px) {
  .hideText {
    display: none
  }
}
</style>

Here is a Dojo example, where the text of the button is visible or hidden depending on the screen size.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Button
Asked by
Ezequiel
Top achievements
Rank 2
Answers by
Neli
Telerik team
Share this question
or