Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In order to display them via a css sprite sheet, you'll want to get rid of the actual image tags within the link buttons as css sprite sheets are applied via the background-image property. </p> <p>Since it looks like each has a class of "flagbutton", you can specify that every element with class flag button has a background image (your sprite sheet). That would look something like this:</p> <pre><code>.flagbutton { background-image:url(images/myspritesheet.png); width:26px; height:15px; margin-right:2px; display:block; float:left; } </code></pre> <p>Then, since each has a unique ID, you can specify in your css file a unique background position for each link button, which will allow you to basically slide the sprite sheet around within each flag's window to position it to show the correct flag. That would something like this:</p> <pre><code>#btnSelectEnglish { background-position: 0 0; } #btnSelectGerman { background-position: 0 -26px; } </code></pre> <p>This would display the first 26px x 15px portion of the sprite sheet in the english box, and the second 26px x 15px portion of the sprite sheet in the german box.</p> <p>You won't need to add spacing between the flags in your sprite sheet -- as that will be covered by the margin-right in the .flagbutton definition above. Without rollovers, I think your final sprite sheet will be height 312px (26 x 12) by 15px tall.</p> <p>If you want to add rollovers into the mix, simply place the rollover version of each image below its counterpart in the sprite sheet. This would double the height of your sprite sheet. Then, add a hover class for each of your IDs to cover hovering like so:</p> <pre><code>#btnSelectEnglish:hover { background-position: -15px 0; } #btnSelectGerman:hover { background-position: -15px -26px; } </code></pre> <p>This will shift your sprites up to reveal the hover image. </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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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