SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    webpage not seeing stylesheet

    Something going wrong with my new xhtmlpage not seeing or reacting to my stylesheet.
    I suspect I somehow got the path wrong, but maybe it is something else. I've tried about a dozen different solutions, but nada. Looked in my textbooks and still can't see where I go wrong. Grrrrrrrr, I hate looking thick.

    stylesheet content (only for test purposes): Body {background-color: red; }

    stylesheet name: xtmlstylesheet.css

    webpageaddress: http://www.boiler-breakdown-repair-l...t-london.xhtml

    link and position in head of xhtlmpage:

    <head>
    <link rel="xtmlstylesheet" type="text/css" href="http://www.boiler-breakdown-repair-london.co.uk/xtmlstylesheet.css" />
    <title>Emergency waterleak repairs in southeast London</title>
    <meta name="keywords" content="waterleak, repair, southeast London, emergency"/>
    <meta name="Description" content="Emergency waterleak repairs in southeast London"/>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta name="geo.region" content="UK"/>
    <meta name="geo.placename" content="London"/>
    <meta name="geo.position" content="51.427364;-0.160074"/>
    </head>


    The other weird thing, is that the page displays fine (albeit with default background-color and not in red) in Opera, Firefox and Chrome. But when I copy/paste the address in the Internet Explorer addressbar, it starts up Firefox and displays the page as it is located on my harddisk, and never changes the homepage in I.E.

    This is harder than I thought.

    Why does it not see my stylesheet and why does I.E. refuse to display it and start up firefox?????

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,329
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by benbob View Post
    Why does it not see my stylesheet and why does I.E. refuse to display it and start up firefox?????
    Your style sheet doesn't work because you have an error in red below:

    Code:
    <link rel="xtmlstylesheet" type="text/css" href="http://www.boiler-breakdown-repair-london.co.uk/xtmlstylesheet.css" />
    It should just read

    Code:
    <link rel="stylesheet" type="text/css" href="http://www.boiler-breakdown-repair-london.co.uk/xtmlstylesheet.css" />
    The problem with IE may have something to do with the xml declaration at the top, which doesn't belong there, and which throws some versions of IE into chaos:

    Code:
    <?xml version="1.0" ?>
    Remove that, and clear any spaces before the doctype. See if that helps.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ralph

    I changed it into the following, but strangely enough it doesn't make any difference in either display or the way I.E. reacts.

    I've cleared up the spaces, just in case, but that made no difference either.

    stylesheet content =

    Body {color: red; }

    (just line 1, nothing before, nothing after)




    xhtmlpage content:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link rel="stylesheet" type="text/css" href="http://boiler-breakdown-repair-london.co.uk/xtmlstylesheet.css" />
    <title>Emergency waterleak repairs in southeast London</title>
    <meta name="keywords" content="waterleak, repair, southeast London, emergency"/>
    <meta name="Description" content="Emergency waterleak repairs in southeast London"/>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta name="geo.region" content="UK"/>
    <meta name="geo.placename" content="London"/>
    <meta name="geo.position" content="51.427364;-0.160074"/>
    </head>
    <body>
    <h1>Southeast London emergency waterleak repairs</h1>

    <p><strong>Emergency waterleak repairs in southeast London</strong> is one of the key services .........................................

    ...................</p>
    </body>
    </html>

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Something else strange here.
    When I copy:

    http://www.boiler-breakdown-repair-l...t-london.xhtml

    In the addressbar, I get a 404 page not found and the addressbar changes to:

    http://www.boiler-breakdown-repair-l...t-london.xhtml


    Never had that before with htmlpages.

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,329
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Because you are using a strict XHTML doctype, it's probably because your style reads

    Code:
    Body {color: red; }
    instead of

    Code:
    body {color: red; }
    As a rule, never use capitals in code. It's just asking for trouble.

  6. #6
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    NOTE:

    Just spotted a typo in the url: the "s" was missing and it was called "southeat" instead of "southeaSt".

    Now rectified so old link in this post may not work

  7. #7
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Eureka, that's it. B instead of b.

    Ralph, saviour of the universe.
    Or at least of my sanity. Maybe not as grand, but as important to me.

    Pffffffff, this "strict" stuff may be good for coding discipline, it's costing me a year of my life.

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,329
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by benbob View Post
    Pffffffff, this "strict" stuff may be good for coding discipline, it's costing me a year of my life.
    Yes, there are so many potential typos that I at least keep everything lowercase to avoid this problem. URLs, class/id names, element tags etc.


Bookmarks

Posting Permissions

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