Below is the code for the displaying a number of items on a shopping cart image.
The background image is not displaying.
Style sheet:
div#cart{
background:url("Cart.gif") no-repeat;
display:inline-block;
height:35px;
width:35px;
}
#clickCount{
float:left;
right:-50px;
top:-15px;
position:relative;
background:lightblue;
border-radius:80px;
border:1px solid grey;
height:20px;
width:20px;
text-align:center;
}
This is the HTML code where I'm using 2 divs one for the display and other for the count:
<code>
<div><div id="cart"></div><p id="clickCount">0</p></div>
<div id="click">
<input type="submit" onclick="myFunc()" value="Cart">
</input>
</code>
Below is the javascript:
function myFunc(){
var val=document.getElementById("clickCount").innerHTML; document.getElementById("clickCount").innerHTML=Number.parseInt(val)+1;
}
This is part of my code. The URL works. My HTML is just a regular HTML document with a body etc...
Is there any particular dimensions which I need to consider while choosing an image for this?