Note that there are some explanatory texts on larger screens.

plurals
  1. PORemove/override default icon styling from jQuery Mobile
    primarykey
    data
    text
    <p>In the header of my mobile web app, I want to provide a settings icon, and only a settings icon. I don't want any styles rendered. jQuery Mobile adds on a lot of styling, and I just want to remove it. I've gotten close, but ran into some problems.</p> <p>Here I define the custom icon in the header:</p> <pre><code>&lt;a href="#settings" class="ui-btn ui-icon-settings ui-btn-icon-notext" data-transition="flip"&gt;&lt;/a&gt; </code></pre> <p>And this CSS will remove the button and background color it adds under the icon (<code>.toolbar</code> is a class I defined for the header):</p> <pre><code>.toolbar .ui-btn, .toolbar .ui-btn-up, .toolbar .ui-btn-hover, .toolbar .ui-btn-down, .toolbar .ui-btn-inner, .ui-btn-icon-left::after, .ui-btn-icon-right::after, .ui-btn-icon-top::after, .ui-btn-icon-bottom::after, .ui-btn-icon-notext::after { background:none; } </code></pre> <p>I need to be able to set its size and always remain centered in the header (for all devices accessing the site). jQuery Mobile puts the icon in a bounding box so if I increase the size of my icon to 30px it cuts off part of the icon. 25px looks ok but isn't quite big enough and it's not centered perfectly in their defined box. I need to get rid of that box (which appears on hover), which you can see in this image.</p> <p><img src="https://i.stack.imgur.com/AtX05.png" alt="screenshot"></p> <p>Questions: Is there a better way to add a simple icon to a header and avoid having to reset/override the styles? Or what do I need to add to get the desired result? I also want to do this for text-only buttons, so if I can kill 2 birds with one stone that'd be great.</p> <p>Thanks a ton!</p> <p>PS. I'm utilizing jQM v 1.4.0 rc1.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload