Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS list content image and more server requests

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #35879
    farzadina
    Participant

    I have many li tags and want to show a small image inside of them. I use content:url('...png'), and should give each li an image URL. So The server requests increase, one request for each image. And we can’t use something like background-position to reduce request here.

    One of the solutions that I found is using CSS based images (base64).

    Is there any other ideas?

    #93625
    TheDoc
    Member

    It’s the same image for every list item? I can’t see how you couldn’t use a background image here…

    #93728
    farzadina
    Participant

    No, they are not same. See my Sidebar Here, at the right of page, the 3th box, the colorful-hover list…

    #93730
    TheDoc
    Member

    You could give each li a unique id and then put a background on them that way. And you could use a sprite to make sure only one file is being downloaded.

    #93768
    farzadina
    Participant

    Yea, and how to keep the background image on hover?
    On hover, the color cover the icon. Result.
    There will be a transition problem if I use another background tag on hover.

    #93794
    TheDoc
    Member

    You could include the colored background in your sprite?

    #93797
    farzadina
    Participant

    I want my li to have a background-color on li:hover. What’s your purpose about including the colored background in sprite?

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.