SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Location
    Kerala,India
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    can't link my external css file

    i am very new to the website designing community and have been learning through a pdf from sitepoint itself but recently when they asked me to link an external css file i was unable to do so or else i couldn't see any effects.
    Here is the Css code:-

    style1.css
    body {
    font-weight: bold;
    color: blue;
    font-family: algerian;
    }

    here is the nark up for my page (ps its pretty much empty)

    <!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>
    <title>Robotryst 2013</title>
    <meta http-equiv="Content-Type"
    content="text/html; charset=utf-8"/>
    <link href="style1.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
    <div id="header">
    <h1> Robotryst @ Musaliar College</h1>
    <p> Robotryst is Organized in association with <strong>TRYST</strong> and <strong>Robosapiens</strong>, Delhi</p>
    <ul>
    <li><a href="index.html">Home</a></li>
    <li><a href="about4.html">Main Attractions</a></li>
    <li><a href="contacts.html">Contact Us</a></li>
    </ul>
    </div> <!-- end of header -->
    <div id="taglines">
    <h2> Win Prizes Worth <em> 1 Lakh </em> Rupees <h2>
    <h3> Hunt For India's Super <em> Robo </em> Genius !!! </h3>
    <p><img src="free kit.jpg" width="480" height="203"
    alt="free robotics kits"/></p>
    <h3> HURRY !! ONLY LIMITED SEATS AVAILABLE </h3>
    </div><!-- end of taglines-->
    </body>
    </html>

    please help me i have been stuck in this part of the tutorial for quite a time now
    Last edited by Alen Thomas; Feb 2, 2013 at 20:56. Reason: typin error

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Hi Alen Thomas. Welcome to the forums.

    What you have will work fine, as long as the path to your CSS file is correct. What you have at the moment:

    Code:
    <link href="style1.css" rel="stylesheet" type="text/css"/>
    is telling the browser to look for the style1.css file in the same folder as the page itself. But if your CSS file is stored somewhere else, the path needs to be different. E.g. if the CSS file is in a folder called /styles/ in the root folder, the link would look something like this:

    Code:
    <link href="styles/style1.css" rel="stylesheet" type="text/css"/>
    So the question is, where is the CSS file in relation to your page?

  3. #3
    SitePoint Member
    Join Date
    Feb 2013
    Location
    Kerala,India
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx a lot it was placed in a different folder
    the new linking worked !!

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Glad to hear it! Don't hesitate to come back if you have further questions.


Tags for this Thread

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
  •