text-indent bug (bugs.jqueryui.com isn't working for me)
text-indent: -99999 on icons makes adjacent inline elements disappear too.
To reproduce, view this in IE8 with Browser Mode: IE8 or IE8 compatibility view, and Document Mode: Quirks Mode.
- <html>
- <head>
- <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css"/>
- <style>
- /* "body" required for reproducing bug */
- body .ui-icon-star {
- background-image: url('/some-url-404');
- /* either of these will reproduce bug */
- display: inline-block;
- display: inline;
- }
- #icon-line { border: 1px solid red; }
- #icon { border: 1px solid green; }
- #text { border: 1px solid blue; }
- </style>
-
- </head>
- <body>
- <p>1</p>
- <p id="icon-line">
- <span id="icon" class="ui-icon ui-icon-star"></span>
- <span id="text">2</span>
- </p>
- <p>3</p>
- </body>
- </html>
Expected result
: 1, 2, 3 (#text element visible)
Actual result: 1, 3 (#text element not visible)
The issue seems to be in the way IE handles text-indent with adjacent siblings, jQueryUI setting a text-indent: -99999 on the icon adjacent to the text hides both.
Workaround: remove the text-indent,
- <!--[if IE]>
- <style>
- body .ui-icon { text-indent: 0 !important; }
- </style>
- <![endif]-->
and make sure none of your icons contain text.