Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7761317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:06:18+00:00 2026-06-01T14:06:18+00:00

I use a list-style-image for li items , and a single-line text. But it

  • 0

I use a list-style-image for li items , and a single-line text.

enter image description here

But it looks bad, so I want to vertically align the text to the middle of the image.

I should use vertical-align: middle , right ? But it didn’t work for me.

<html>
    <head>
        <title> This is an demo </title>
        <style>
            body {
                background-color: #464443;
                color: white;
            }
            ul {
                list-style-image: url('bg.png');
            }

            li {
                vertical-align: middle;
            }

        </style>
    </head>

    <body>
        <ul>
            <li>abc</li>
            <li>abc</li>
            <li>abc</li>
            <li>abc</li>
        </ul>
    </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:06:20+00:00Added an answer on June 1, 2026 at 2:06 pm

    A satisfactory way to do this (imo) is to not use list-style-image, instead using the background property to set the “bullet” (note I substituted my own placeholder image since I just copied/pasted from a fiddle). Your padding and other dimensions will vary depending on the size of the “bullet” image.

    Here’s the fiddle: http://jsfiddle.net/huBpa/1/

    body {
      background-color: #464443;
      color: white;
    }
    
     ul {
       list-style: none;
       padding: 0;
       margin: 0;
     }
    
     li {
       background: url('http://lorempixel.com/output/technics-q-c-32-32-1.jpg') no-repeat;
       line-height: 32px;
       vertical-align: middle;
       padding-left: 40px;
     }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to adjust the position of list-style-image? When I use padding
I want to use List.Find() on a simple collection that does not implement Find().
I have css like this: .done {list-style-image:url('images/tick.gif')} .notdone {list-style-image:url('images/cross.gif')} And html like this: <ul>
I have a couple un-ordered lists on my page. Both lists use list-style: disc
I have a CSS like this ul { list-style-image:url(images/bulletArrow.gif); } ul li { background:
I'm trying to style an ordered list that seemed quite simple but apparently is
Is it possible to use CSS sprites for the list background image? Normally, I
I have a list of items that I want to be laid out horizontally.
I know I can just use an image for this but who in their
I've always been one to simply use: List<String> names = new ArrayList<>(); I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.