Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-18-2011, 04:17 PM   PM User | #1
Triswit
New to the CF scene

 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Triswit is an unknown quantity at this point
External CSS Tag Not Working

I'm working on a site for a class in which we were told to use an external reference for css. Most of the css commands carry over, but all the body commands don't. My css file is below:

Code:
<style type="text/css">

body
{
font-family:"Courier New", Courier, monospace;
background-image: url(file:///H:/web/background);
}
h1
{
background-color: #FFFFFF;
color:black;
border-style:groove;
border-width:thick;
text-align:center;
}
p
{
background-color: #FFFFFF;
border-style:groove;
border-width:5px;
text-align:left;
}
The html command that references that file is as follows:
Code:
<link rel="stylesheet" type="text/css" href="file:///H:/web/csstest.css" />
I have checked the pathways for the background image and css file. Does anyone have an idea as to what's going on?
Triswit is offline   Reply With Quote
Old 10-18-2011, 04:26 PM   PM User | #2
tracknut
Regular Coder

 
Join Date: Aug 2006
Posts: 891
Thanks: 4
Thanked 205 Times in 204 Posts
tracknut is an unknown quantity at this point
That background image is actually named "background" ?? No suffix like ".jpg" or anything?

Dave
tracknut is online now   Reply With Quote
Old 10-18-2011, 07:08 PM   PM User | #3
fredrikrob
New Coder

 
Join Date: Sep 2011
Location: NY
Posts: 33
Thanks: 4
Thanked 0 Times in 0 Posts
fredrikrob is an unknown quantity at this point
Quote:
Originally Posted by tracknut View Post
That background image is actually named "background" ?? No suffix like ".jpg" or anything?

Dave

yes i am agree with Tracknut that the backgound should have suffix. You must put the right path to the exact file. And would be better if you put short path and put the image file in the same folder where the css and main home file reside. Then path will be like (./image/imagename.jpg). This one is the best way and less chance are to have mistake in codding.
__________________
Do you like to change PSD to HTML or PSD to drupal conversion here is the Answer.
fredrikrob is offline   Reply With Quote
Old 10-18-2011, 07:34 PM   PM User | #4
Triswit
New to the CF scene

 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Triswit is an unknown quantity at this point
I opened the background file in firefox and that was the pathway. If I open it with a suffix, such as .jpg or .jpeg, the link is broken.
Triswit is offline   Reply With Quote
Reply

Bookmarks

Tags
css, error

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:57 PM.


Advertisement
Log in to turn off these ads.