In the website I am creating I need a button which has an image (a cross) as background. I use a file *.css for all the graphics of the website, so I'd like to write the button's style in this file.
HTML code
<html>
<head>
<title>Prova</title>
<link rel="stylesheet" href="grafica/style.css" type="text/css">
</head>
<body>
<button id="cookieButton">
</body>
</html>
CSS
#cookieButton
{
background-image:url('croce2.png');
background-repeat: no-repeat;
background-position: center center;
width:30px;
height:30px;
}
this doesn't work, but if I write the same CSS code inline (as in the following code) it works
<html>
<head>
<title>Prova</title>
<link rel="stylesheet" href="grafica/style.css" type="text/css">
</head>
<body>
<button style="background-image:url('croce2.png'); background-repeat: no-repeat;
background-position: center center; width:30px; height:30px">
</body>
</html>
This is the result in the first case and in the second case
Why doesn't it work in the first case?
