So I've been trying to get my custom image to appear in a vertical toolbar, but I'm having trouble. I'm referencing http://codepen.io/nikhil/pen/sicrK which has all of the source code; I want pretty much the same toolbar, but with custom images. Here's a snippet, from the part I've been trying to adjust to get it to work:
From the HTML:
<ul class="menu">
<li title="home"><a href="#" class="menu-button home">menu</a></li>
<li title="search"><a href="#" class="search">search</a></li>
<li title="pencil"><a href="#" class="pencil">pencil</a></li>
<ul>
From the CSS - before (works, as in the link):
.menu li a.search:before {
content: "\f002";
}
From the CSS - with my attempted modification (doesn't work; no image appears)
.menu li a.search:before {
list-style-image: "\newImage.png";
}
So, I was trying to use list-style-image
, but no image would appear. The image I'm referencing in the folder is 100x100px. I tried background-image
and just using <img src="newImage.png">
inside the HTML markup, but no dice - no image appears and there are no errors logged in the console. How can I resolve this issue? The toolbar re-sizes according to the CSS based on the screen size, so I assume that means the size of my image doesn't really matter. Or, do I need to be using an SVG
instead? Thanks for any help - I'm new to working with CSS.