0

List-style-image:; not working.

I have set a list style to use a picture but I cannot get it to show on my site. I have resized the picture to 10x10 and I should also point out that it is a png arrow image. I have tried putting the image in the images file and calling it from there with no result, I have even put it in the main file and calling it with no result. The urls I used were: #contact { list-style-image: url("images/bullet.png"); } AND: #contact { list-style-image: url("bullet.png"); } I need help whenever I can get it; it's not urgent.

3rd Apr 2018, 11:24 AM
Lucas McLerie
Lucas McLerie - avatar
23 Answers
+ 3
could try for the url (if it's in the images folder and the html file is in another folder): "../images/bullet.png"
3rd Apr 2018, 11:38 AM
storm
storm - avatar
+ 2
@ Lucas the png extension is widely used and supported by the browsers. it's THE image standard. so I too don't think it's the extension. wirgout the code we would be just guessing. I'd go with Blue, to post those parts of your code in here.
3rd Apr 2018, 1:04 PM
storm
storm - avatar
+ 2
I tried it out. Blue is absolutely right. first, put that bullet.png file in your images folder and add in your css file in the #contact section the following line: list-style-image: url ("../images/bullet.png"); problem solved. great job Blue! :)
3rd Apr 2018, 2:00 PM
storm
storm - avatar
+ 1
Ok
3rd Apr 2018, 1:08 PM
Lucas McLerie
Lucas McLerie - avatar
+ 1
I can give you the web address. If you donā€™t know, You hit F12 then go to sources and you will find the root files and you will be able to view all the code
3rd Apr 2018, 1:31 PM
Lucas McLerie
Lucas McLerie - avatar
+ 1
I'm at a loss. if every other style works, it can't be the link element (otherwise the other styles wouldn't work either). what's left is either the file itself or something with the url. final offer: give te path to your png file in the ul element as inline style.
3rd Apr 2018, 1:35 PM
storm
storm - avatar
0
@Storm I would like to point out that my relevant file tree is as follows: Site > css > stylesheet.css images > bullet.png index.html ALSO, #contact { list-style-image: url("../images/bullet.png"); } Did NOT work either.
3rd Apr 2018, 12:25 PM
Lucas McLerie
Lucas McLerie - avatar
0
@Storm Would the extension have anything to do with it? I saw some articles referring to a .SVG image, and Sololearn referred to a .JPG image. Do you think maybe .PNG is not supported?
3rd Apr 2018, 12:33 PM
Lucas McLerie
Lucas McLerie - avatar
0
@Blue Absolutely, Which part of the HTML?
3rd Apr 2018, 12:42 PM
Lucas McLerie
Lucas McLerie - avatar
0
I have the .CSS file linked in the HTML header. and everything I followed in the Sololearn CSS list styling is correct. It's just not showing up on the index.html page when opened. Do you mean style the <li> tag and not the <ul> tag?
3rd Apr 2018, 12:58 PM
Lucas McLerie
Lucas McLerie - avatar
0
Lucas Mclerie, Ya, I wanted that link present in your HTML header and <li> with its parent element i.e., <ul> I think...
3rd Apr 2018, 1:05 PM
777
777 - avatar
0
Again, the section Iā€™m trying to style or the full document?
3rd Apr 2018, 1:07 PM
Lucas McLerie
Lucas McLerie - avatar
0
HTML: <ul id="contact" align="left"> <li>What your site is going to be about.</li> <li>How you want your site to be laid out.</li> <li>What you want your domain name to be.</li> </ul> CSS: #contact { list-style-image: url("images/bullet.png"); list-style-position: inside; }
3rd Apr 2018, 1:09 PM
Lucas McLerie
Lucas McLerie - avatar
0
Please post the <link> tag in which you included css file cuz everything is looking fine!
3rd Apr 2018, 1:17 PM
777
777 - avatar
0
I know the link is correct because every other tag I have needed to style has worked perfectly. But here it is anyway: <link rel="stylesheet" type="text/css" href="css/stylesheet.css">
3rd Apr 2018, 1:19 PM
Lucas McLerie
Lucas McLerie - avatar
0
Yup you're right! Try #contact li as the CSS selector... Can you share your FULL code (html and css) through SoloLearn or any online media then, it will be more easy to solve the error!
3rd Apr 2018, 1:28 PM
777
777 - avatar
3rd Apr 2018, 1:32 PM
Lucas McLerie
Lucas McLerie - avatar
0
I have no idea how to set a list image in a <style> tag. (Is it just <ul style=ā€œlist-style-image:url(ā€œimages/bullet.pngā€);ā€>? Is the above also what you mean by ā€˜inline styleā€™?
3rd Apr 2018, 1:38 PM
Lucas McLerie
Lucas McLerie - avatar
0
There is no #contact { list-style-image: url("images/bullet.png"); } block in your stylesheet.css? (DON'T include this! It is incorrect) Plus, there isn't any image named 'bullet.png' in images folder??? Solution: Include this block in your CSS file: #contact { list-style-image: url("../images/sitelogo.png"); } /* just as an example */ @storm was absolutely right! :)
3rd Apr 2018, 1:47 PM
777
777 - avatar
0
Might I add. I actually forgot that I did not upload the updated files to the hosting site. I will need to do that tomorrow as my pc is now off. Iā€™m so sorry that I didnā€™t realize earlier. Again, I did do exactly as you just stated; include #contact { list-style-image: url(ā€œimages/bullet.pngā€); } And there is a bullet.png image in my images file.
3rd Apr 2018, 1:54 PM
Lucas McLerie
Lucas McLerie - avatar