- This topic is empty.
-
AuthorPosts
-
August 27, 2012 at 12:40 pm #39530
Ani_
ParticipantHI all,
i was trying to follow the tutorials about the photoshop mockup, and i created the layout but now i got the problem that the wooden background wont appear when i open my index file. Maybe someone can help me.
Here is the html code:
And here is the css:
/* RESETS & BASIC PAGE SETUP */
* { margin:0; padding: 0; }
html { overflow-y: scroll; }
body {
font: 62.5% "Lucida Grande", sans-serif;
background: url(images/body_bg.jpg) ; }
ul { list-style: none inside; }
p { font-size: 1.2em; line height: 1.2em; margin-bottom: 1.2 em; }
a img {border: none; }
/* END RESET */
/* TOOOLBOX */
.floatleft { float: left; }
.floatright {float: right; }
.clear { clear: both; }
/* END TOOLBOX */
well thanks in advance and i hope to hear from someone.Ani_
August 27, 2012 at 2:00 pm #108534TheDoc
MemberDo you have a link to the site?
I’m guessing that your path to your image is wrong.
August 27, 2012 at 2:42 pm #108537Ani_
Participantit isn’t online yet. the images map is located in the root folder so i thought the path was images/body_bg.jpg becouse it is in roots right? still let me re-check and thanks for looking at it! :)
August 27, 2012 at 3:31 pm #108545TheDoc
MemberIt depends on where your CSS file is. If your CSS file is in a folder in the root called CSS then you’d have to back out to the root and then go to the images folder.
url(/images/body_bg.jpg)
The above code will go right to the root, then check for an ‘images’ folder.
url(../images/body_bg.jpg)
The above code will move one folder up from the current position and then check for an ‘images’ folder.
url(‘../../images/body_bg.jpg)
Will go two folders up and check…
You get the idea!
August 27, 2012 at 4:12 pm #108549Ani_
ParticipantYes thats probaly the problem! My style.css file is in the map css. So in order for my css to find the image it will have to get out of the directory css to find it. Will let you know if it worked!
Thanks!
August 27, 2012 at 4:12 pm #108550Ani_
ParticipantYes thats probaly the problem! My style.css file is in the map css. So in order for my css to find the image it will have to get out of the directory css to find it. Will let you know if it worked!
Thanks!
August 28, 2012 at 1:06 am #108582Ani_
Participantwell i did it how you told me, but i still wont see any background. ill show you the code:
/* RESETS & BASIC PAGE SETUP */
* { margin:0; padding: 0; }
html { overflow-y: scroll; }
body {
font: 62.5% "Lucida Grande", sans-serif;
background: url(../images/body_bg.jpg) ; }
ul { list-style: none inside; }
p { font-size: 1.2em; line height: 1.2em; margin-bottom: 1.2 em; }
a img {border: none; }
/* END RESET */
/* TOOOLBOX */
.floatleft { float: left; }
.floatright {float: right; }
.clear { clear: both; }
/* END TOOLBOX */
as you see i changed the path to go up one folder and then search for the images folder and then for body_bg.jpg but it wont show.
August 28, 2012 at 4:05 am #108593Watson90
MemberHi there Ani,
It seems like you’re doing everything right.
Maybe try:
body {
font: 62.5% "Lucida Grande", sans-serif;
background-image: url(/images/body_bg.jpg);
}I set the property to background-image rather than background. Just see if that works instead.
Thanks
August 28, 2012 at 4:23 am #108594Ani_
Participanthmm i copied the code just like you typed here but my nice wooden background wont appear haha. so i realy dont know what to do now :P
August 28, 2012 at 6:25 am #108598Ani_
Participantone way or another i scripted everything from scrap and now it works oleee:P thanks for evrything guys!
August 28, 2012 at 7:42 am #108600Watson90
MemberWeirrddd! Haha, glad everything worked out :)
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.