• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Frage Hintergrundbild wird in CSS nicht angezeigt

Lloma

Neues Mitglied
Hallo,

ich bastel momentan an einem Seitenlayout und zwar meinem ersten. Jetzt wird bei mir nicht das Hintergrundbild angezeigt und ich habe trotz x verschiedenen Ansätzen und Onkel Google nicht des Problemslösung gefunden, vllt mag mir ja jemand helfen?

HTML:
<html>
<head>
<title>Mabilis Racing</title>
<link rel=stylesheet type="text/css" href="design.css">
</head>
<body>
<div class='header'></div>
<div class='sidebar' <ul> <li> <a href='./?seite=index'>Home</a></li><li><a href='./?seite=racer'>ASJC Racer</a></li> <li> <a href='./?seite=nationalracer'>National Racer</a> </li> <li> <a href='./?seite=studs'>Studs</a></li><li><a href='./?seite=broods'>Broodmares</a></li><li><a href='./?seite=retired'>Retired</a> </li> </ul> </div></div>
<div class="container"></div>
<div class='footer'></div>
</body>
</html>

Code:
body {
font-family: Georgia, Verdana, sans-serif;
background: url (bgbild.jpg)repeat;
background-attachment: fixed;
font-size: 18pt ;
color: black ;
text-align:left;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}

h3 {
font: italic normal 1.4em georgia, sans-serif;
letter-spacing: 1px;
margin-bottom: 0;
color: #7D775C;
}
a:link {
font-weight: bold;
text-decoration: none;
color: #61451E;
text-shadow: 0 0 2px #424242
}
a:visited {
font-weight: bold;
text-decoration: none;
color: #61451E;
text-shadow: 0 0 2px #424242
}
a:hover, a:focus, a:active {
text-decoration: none;
color: #61451E;
text-shadow: 0 0 2px #424242
}
li {list-style-type: none;}

.text {
width: 35em;
line-height: 1.4em;
}
.header {background-color: #F6EFB9}
.sidebar { position: absolute; z-index:1; float: right; width: 20%; max-width: 1000px; padding: 15px; margin-left: 1100px; margin-top: 160px; padding-top: 100px; height: auto; min-height: 600px; box-shadow: 0 0 10px #424242; background-color: #A2AE3E}
.container { position: absolute; float: left; width: 80%; max-width: 1000px; padding: 15px; margin-left: 150px ;margin-top: 185px; padding-top: 100px; height: auto; min-height: 600px; background-color: #C8D756; box-shadow: 0 0 15px #424242;}
.footer {background-color: #563C17}
 
Werbung:
Versuch es mal so:
background: url('background.jpg') repeat;
Ansonsten ist der Pfad vielleicht falsch
 
Zuletzt bearbeitet:
Werbung:
Die richtige Schreibweise für das Einfugen eines Hintergrundbildes wäre:
<style>
body {
background: url(bg_image.jpg) repeat;
}
</style>
und nicht
...
background: url (bgbild.jpg)repeat;
...
achte auf die Leerzeichen! CSS ist da sehr sensibel.
 
@Sailor die Anführungszeichen sind glaube ich allerdings auch ein wichtiger bestandteil, falls ein Ordner oder der Dateiname Leerzeichen enthält:
./hier ein bild/bild beispiel2.png

Dann brauchst du die halt:
'./hier ein bild/bild beispiel2.png'
 
Werbung:
Zurück
Oben