Html External Css
- gr8rick2843
-
gr8rick2843
- Member since: Feb. 25, 2013
- Offline.
-
- Forum Stats
- Member
- Level 01
- Blank Slate
Ok so I'm doing this HTML/CSS tutorial for school and i have an HTML file with a style sheet, one of the styles is the body tag having a background image the style leads to the image file in the image folder, the tutorial calls for cutting the style tag and pasting it to a NEW file and then removing the beginning/end tags then putting THIS tag in the index.html file which should link the style sheet to the index file (??? still kinda new to HTML, dont know if this is making any sense to you all???)
<link rel="stylesheet" type="text/css" href="css/bridges.css"/>
now all the styles are there, but NONE of the images are! Andy ideas?
- Kirk-Cocaine
-
Kirk-Cocaine
- Member since: Aug. 17, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (18,524)
- Block
-
- Forum Stats
- Moderator
- Level 38
- Programmer
At 4/15/13 12:26 AM, gr8rick2843 wrote: now all the styles are there, but NONE of the images are! Andy ideas?
You'll need to change the paths to the images in your CSS file, as they no longer point to the correct location.
- smulse
-
smulse
- Member since: Mar. 24, 2005
- Offline.
-
- Forum Stats
- Member
- Level 31
- Blank Slate
At 4/15/13 04:48 AM, Kirk-Cocaine wrote:At 4/15/13 12:26 AM, gr8rick2843 wrote: now all the styles are there, but NONE of the images are! Andy ideas?You'll need to change the paths to the images in your CSS file, as they no longer point to the correct location.
To expand, if you've moved your css into a new file in the folder /css, and you're linking to your images in the css like
background: url(images/whatever.gif);
then the file you're trying to pull assumes directory structure would look like:
/css/images/whatever.gif
Whereas you would need to do
background: url(../images/whatever.gif);


