As shown in the picture, the bullets on the left are made from pictures, but now they are misplaced. How to set the margins of images?
Not usedlist-style-image This attribute
Usedbackground: url(1.png) no-repeat 74px;
Haha, I did use the wrong attribute. It would be better to use the li background or the li a background to simulate the list-type-image. At least the positioning is not that difficult.
Hmm . I haven't used list-type-image much before, thinking it has a positioning function. It still doesn't seem to work now.
Is it possible to accumulate the file names of background pictures one by one:
For example, there are 10 LIs, and the background pictures are from icon1.gif to icon10.gif respectively. These background pictures must be in li Shown before. Can it be implemented by just defining a CSS? Do I have to define 10 calls one by one?
/*-----------------------------------.top10-----------------------------------*/ #top10 li { line-height:160%; padding-left:24px; border-bottom:1px #ccc dashed; width:150px; overflow:hidden; } #top10 a:hover { color:#C90; } #top10 .top1 { background:url(images/top_1.gif) no-repeat left center; } #top10 .top1 a { color:#06f; } #top10 .top1 a:hover { color:#f60; } #top10 .top2 { background:url(images/top_2.gif) no-repeat left center; } #top10 .top2 a { color:#06f; } #top10 .top2 a:hover { color:#f60; } #top10 .top3 { background:url(images/top_3.gif) no-repeat left center; } #top10 .top3 a { color:#0066FF; } #top10 .top3 a:hover { color:#f60; } #top10 .top4 { background:url(images/top_4.gif) no-repeat left center; } #top10 .top5 { background:url(images/top_5.gif) no-repeat left center; } #top10 .top6 { background:url(images/top_6.gif) no-repeat left center; } #top10 .top7 { background:url(images/top_7.gif) no-repeat left center; } #top10 .top8 { background:url(images/top_8.gif) no-repeat left center; } #top10 .top9 { background:url(images/top_9.gif) no-repeat left center; } #top10 .top10 { background:url(images/top_10.gif) no-repeat left center; }
If you don’t have to define them one by one, then connect 10 pictures into a vertical string to make a picture---->
The next two methods are:
1 .Use the picture as the background of ul, spacing + picture height = line-height of li. Disadvantages: You have to make sure you don’t break the bank.
2. Use js to determine which li appears, and assign the value corresponding to "*" in background-position:*px;.
--------------------
Benefits: Images only need to be requested once from the server, which is very important for large sites.
The above is the detailed content of css: How to set the image background in list-style-image?. For more information, please follow other related articles on the PHP Chinese website!

The typical journey for a person browsing a website: view a page, click a link, browser loads new page. That's assuming no funny business like a Single Page

Let’s take a look at a super lightweight way to create a horizontal masonry effect for a set of arbitrarily-sized photos. Throw any set of photos at it, and

Different website designs often call for a shape other than a square or rectangle to respond to a click event. Perhaps your site has some kind of tilted or

Sophie Koonin blogged "Everything I googled in a week as a professional software engineer," which was a fascinating look into the mind of a web developer and

Interesting research from Jonathan Sampson, where he watches the network requests a browser makes the very first time you launch it on a fresh install, and

A collection of front-end development achievements. How many can you collect?

There are so many things you can do with clipping paths. I've been exploring them for quite some time and have come up with different techniques and use cases


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Zend Studio 13.0.1
Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor