CSS Notizen

Entweder:

1
2
3
4
5
6
7
div#myContainer
{ 
  background-color: red;
  background-image: url('../images/background.png'); 
  background-repeat: no-repeat;
  background-position: -20px 100px; 
}

Oder:

1
2
3
4
div#myContainer
{   
  background: red url('../images/background.png') no-repeat -20px 100px; 
}

Code Styles

Bad:

1
background-image: url(images/background.png);
1
background-image: url('images/background.png');
1
background-image: url("images/background.png");
1
background-image: url("./images/background.png");

Good:

1
background-image: url('./images/background.png');

Not working:

1
background-image: url('/images/background.png');

Kommentar abgeben

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.

Microsoft Certified Professional Logo
 

Werbung