1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

CSS linked stylesheet

Discussion in 'Web Development' started by serdaan, Apr 30, 2010.

  1. serdaan

    serdaan New Member

    Hi there,

    Nothing as simple as linking a new page to the same stylesheet...I thought...I tried and stared and tried and stared again..the whole day yesterday, but I cannot figure out why it does not work. It works for the main page, so I copied this page gave it a different name..only changes some text.
    The link to the page works fine, it is only the stylesheet that does not seem to work. I really do not see what is wrong with this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="XHTML namespace">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>dekoofies</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    </head>

    It must be something else...anyone any idea?
    Thank's so much in advance.
     
  2. rblbliss

    rblbliss New Member

    Hi,

    Your code looks sound to me.

    The onlything I can suggest without seeing mroe of the code is that you check your directory structure.

    Is your css file in the same file as both pages?

    Is the main page in the same level of directory.

    example:

    main page=
    Websitefolder/index.html

    second page =
    Websitefolder/secondpage.html

    css file=
    Websitefolder/index.html

    I personaly keep all html files in the root directory
    then all css files will go into a folder in the root directory labeled e.g "css"

    so the link ref will read:

    <link href="css/style.css" rel="stylesheet" type="text/css" />


    Let me know if this solves your problem, if not then we will look further into the problem.

    regards.
     
  3. serdaan

    serdaan New Member

    Thanks a lot, this works..but only for the page....now my header is gone.
    So I moved it also to the css folder and changed the code in the stylesheet into css/header.jpg but that did not help
     
  4. ishkey

    ishkey Moderator, Logos, Sports Crests Staff Member Verified Member

    what editing program are you using?
     
  5. serdaan

    serdaan New Member

    found it!
    Forgot the "/" before the folder name

    Have a nice day.
     
  6. rblbliss

    rblbliss New Member

    Glad it worked,

    If you get stuck on anything else please post and we will all try our best to help.

    Also on a quick note to keep everything in order I wold also make a new folder called "images" and put all images in this folder with referencing appropriately. e.g images/header.jpg