External CSS Stylesheet not working
Results 1 to 4 of 4

Thread: External CSS Stylesheet not working

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    1

    External CSS Stylesheet not working

    I am having a problem with an external style sheet using PhP5.

    If I put the link to the stylesheet in on the page everything works fine.

    However, I am using a function files to store the functions that are used frequently throughout the site.

    All function files are specified in an include statement.

    When I run the page with the stylesheet link in the output_fns.php file the styesheet is not loading. The content works fine but none of the styles are loading. Can anyone help?

    Here is my coding:

    (index.php)
    PHP Code:
    <?php

        
    include('rhs72_fns.php');
        
    session_start();
        
    do_html_header('RHS Class of 1972');
    ?>
    rhs72_fns.php

    PHP Code:
    <?php
        
    include('database_fns.php');
        include(
    'output_fns.php');
    ?>
    output_fns.php

    PHP Code:
    function do_html_header($title = ' ')
        {
            ?>        
                <!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">
                <html xmlns=""http://www.w3.org/1999/xhtml" lang = "en" xml: lang = "en">

                <head>
                    <meta http-equiv="Content Type" content ="text/html";
                        charset ="ISO-8859-1" />
                    <meta name = "Author" Content = "Michael Burden" />
                    <meta name = "Created Date" content = "12/10/2012" />
                    <meta name = "Company" content = "MTB Enterprises" />
                    <meta name = "Modified Date" Content = "12/11/2012 />

                    <title><?php echo $title?></title>

                    <link rel="stylesheet" type="text/css" href="http://www.rhs72rams.com/rhs72rams_main.css" />
                </head>
                
                <body>
                    <body>
                        <div class="container">
                          <div class="header"><a href="#">
                             <img src="images/RiverviewHighSchool.jpg"
                            alt="Ram's Head" name="Logo" width="960"
                            height="160" id="Insert_logo"  /> </a>
                            <!-- end .header --></div>
                          <div class="sidebar1">
                            <ul class="nav">
                                <li> <a href="/login.php">Log-In</a></li>
                                <li><a href="/index.php">Welcome</a></li>
                                <li><a href="/classmates.php">Classmates</a></li>
                                <li><a href="/memorial.php">Memorials</a></li>
                                <li><a href="/photos.php">Photo Albums</a></li>
                                <li><a href="/chat.php">Chat Room</a></li>
                                <li><a href="/quiz.php">Quiz Page</a></li>
                                <li><a href="/polls.php">Polls</a></li>
                                <li><a href="/calendar.php">Calendar</a></li>
                                <li><a href="/events.php">Details of Events</a></li>
                                <li><a href="/rsvp.php">RSVP</a></li>
                                <li><a href="/coming.php">Who's Coming</a></li>
                                <li><a href="/tickets.php">Buy Tickets</a></li>
                                <li><a href="/travel.php">Travelers</a></li>
                                <li><a href="/donations.php">Make a Donation</a></li>
                                <li><a href="/sponsors.php">Sponsors</a></li>
                                <li><a href="/store.php">Class Store</a></li>
                                <li><a href="/contact.php">Contact Us</a></li>
                                <li><a href="https://www.facebook.com/#!/groups/117326885027939/">Facebook Link</a></li>
                            </ul>
                            <p>&nbsp;</p>
                         <!-- end .sidebar1 --></div>
            <?php
        
    }
    Last edited by NogDog; 12-12-2012 at 01:23 AM.

  2. #2
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,974
    Welcome to the forums. In future posts, please make use of the [php]...[/php] bbcode tags around your code snippets (which I added to your post here). As it's past my bedtime, I'll leave it to someone else to help you, else I'll see you tomorrow some time.
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because hes a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

  3. #3
    Senior Member
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    753
    It looks like you've got some problems in that output file of yours, which you'd spot with a decent syntax highlighting editor. The main issues are:
    • missing opening PHP tag, although this might be a copy/pasta error when you pasted it into your question
    • A random semicolon at the end of the first meta tag line; you can put this whole meta tag on one line as well
    • Missing quote mark on the last meta tag line - this is the one causing your issue, as the browser is confused as to what tags end where
    • space in the xml:lang attribute, which is creating two lang attributes that are identical and a third called xml: that contains no value
    Ashley Sheridan
    www.ashleysheridan.co.uk

  4. #4
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    13,974

    off-topic

    Quote Originally Posted by Ashley Sheridan View Post
    ...
    • missing opening PHP tag, although this might be a copy/pasta error when you pasted it into your question
    There must be a good xkcd cartoon in there, somewhere.

    (Now, back to your regularly scheduled discussion.)
    Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

    "But the main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because hes a better programmer now!" ~ http://www.oreillynet.com/ruby/blog/...ck_to_p_1.html


    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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