Note that there are some explanatory texts on larger screens.

plurals
  1. POUnordered list item background image scaling down in Safari but not Chrome
    primarykey
    data
    text
    <p>My problem is that background images to list items ("li") in an unordered list ("ul") are behaving wildly different across browsers. I am not sure how to best approach the problem. The code renders nicely in Apple-WebKit browsers, but images don't scale down properly to the "li" bounds in Chrome or Firefox. </p> <p>I realize I could scale the images to the "correct" resolution but then I'd have to implement all that user ID 2x swapping for retina and high DPI displays, which will really be a maintenance hassle as this icon grid will regularly change over time. </p> <p>The CSS is structured the way it is with id wildcards because I'll eventually be having different characteristics for each "li." Styles in this example are coded inline with the page's header. </p> <p>I'm hoping that I am missing something simple and elegant like perhaps defining a div somehow within or around a "li" but I think I may have tried that already with confoundingly mixed results. </p> <p>Thanks very much for the advice. </p> <p>The example page is here:</p> <p><a href="https://dl.dropboxusercontent.com/u/35370696/iframes/FrontGrid.html" rel="nofollow">https://dl.dropboxusercontent.com/u/35370696/iframes/FrontGrid.html</a></p> <p>Style extract:</p> <pre><code>ul[id="GridBox"] { position:relative; list-style: none; margin-left:auto; margin-right:auto; width: 940px; height: 370px; } li[id^="Cell"] { color: #FFFFFF; float:left; background-color:green; position:relative; max-height:70px; max-width:70px; height:70px; width:70px; background-size:70px 70px; margin-top: 12px; margin-left: 12px; margin-bottom: 12px; margin-right: 12px; line-height: 20px; display: block; font-family: abel, sans-serif; font-size: 10px; font-weight: 400; text-align:right; box-shadow: 3px 3px 3px #888888; } li[id="Cell1"] { background: url(images/Sears.png); } li[id="Cell1"]:hover { background: url(images/SearsReverse.png); color: black; } li[id="Cell1"]:active { box-shadow: 3px 3px 3px transparent; color:#7BB1FF; } </code></pre> <p>Content extract: </p> <pre><code> &lt;ul class="Icons" id="GridBox"&gt; &lt;a href="http://www.diacritica.pe"&gt; &lt;li id="Cell1"&gt;ALWB  &lt;/li&gt;&lt;/a&gt; &lt;li id="Cell2"&gt;ALWB  &lt;/li&gt; &lt;li id="Cell3"&gt;ALWB  &lt;/li&gt; &lt;li id="Cell4"&gt;ALWB  &lt;/li&gt; &lt;li id="Cell5"&gt;ALWB  &lt;/li&gt; &lt;li id="Cell6"&gt;ALWB  &lt;/li&gt; &lt;li id="Cell7"&gt;ALWB  &lt;/li&gt; &lt;li id="Cell8"&gt;ALWB  &lt;/li&gt; </code></pre> <p>[etc…]</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