Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Notepad ++ link style sheet.css and index.html.

Options
  • 23-10-2012 8:53am
    #1
    Registered Users Posts: 883 ✭✭✭


    How do you link Notepad ++ style sheet.css and index.html.I have href style done on the index plus folders. I run in Firefox but no style shows up.


Comments

  • Registered Users Posts: 2,022 ✭✭✭Colonel Panic


    Are you using relative paths? Is everything spelled correctly? What the debug console in Firefox say? Is it finding the fileS? Post code or we can't possibly help you any further!


  • Registered Users Posts: 3,078 ✭✭✭onemorechance


    style.css
    P.special {
    color : green;
    border: solid red;
    }
    

    index.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <HTML>
      <HEAD>
       [B] <LINK href="style.css" rel="stylesheet" type="text/css">[/B]
      </HEAD>
      <BODY>
        <P class="special">This paragraph should have special green text.
      </BODY>
    </HTML>
    

    This assumes that both style.css and index.html are in the same folder.


  • Closed Accounts Posts: 3,513 ✭✭✭donalg1


    try something like

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

    obviously change foldername to whatever the title of the folder you have the css sheet and index saved.


  • Registered Users Posts: 3,078 ✭✭✭onemorechance


    donalg1 wrote: »
    try something like

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

    obviously change foldername to whatever the title of the folder you have the css sheet and index saved.

    If both files are in the same folder there is no need to go up one folder and back down into the same one.

    It's good practice to separate them into their own folders, like in the first example shown below:
    site\html\index.html
    
    [COLOR="Red"][B]site[/B][/COLOR]\[COLOR="SeaGreen"][B]css[/B][/COLOR]\style.css
    
    <link href="[COLOR="red"][B]..[/B][/COLOR]/[COLOR="SeaGreen"][B]css[/B][/COLOR]/style.css" rel="stylesheet" type="text/css">
    
    site\index.html
    
    site\[COLOR="SeaGreen"][B]css[/B][/COLOR]\style.css
    
    <link href="[COLOR="SeaGreen"][B]css[/B][/COLOR]/style.css" rel="stylesheet" type="text/css">
    
    site\index.html
    
    site\style.css
    
    <link href="style.css" rel="stylesheet" type="text/css">
    


  • Registered Users Posts: 6,464 ✭✭✭MOH


    You're missing the closing tag for the paragraph:
    <P class="special">This paragraph should have special green text.[B]</P>[/B]
    


  • Advertisement
  • Registered Users Posts: 883 ✭✭✭raher1


    what are good div tag to start with? and thanks for the notepad help.


  • Registered Users Posts: 3,078 ✭✭✭onemorechance


    What exactly do you want to know about the <div> tag?

    Its purpose is to contain other block elements and allow you to structure HTML documents into divisions. Typically it's used with CSS for position, sizing and alignment.


  • Registered Users Posts: 883 ✭✭✭raher1


    What exactly do you want to know about the <div> tag?

    Its purpose is to contain other block elements and allow you to structure HTML documents into divisions. Typically it's used with CSS for position, sizing and alignment.

    structure a html document to start and then build the elements.


Advertisement