Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,224
    Thanks
    10
    Thanked 269 Times in 268 Posts
    That background image is actually named "background" ?? No suffix like ".jpg" or anything?

    Dave

  • #3
    New Coder
    Join Date
    Sep 2011
    Location
    NY
    Posts
    33
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •