Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 3 123 LastLast
Results 1 to 15 of 33
  1. #1
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post

    external style sheet

    I am unable to get my external style sheet to work.

    I dragged the style sheet in Dreamweaver from the css folder to the <head> of the page.

    <link rel="stylesheet" type="text/css" href="templates/template7/css/mytngstyle.css"/>

    The css in the style sheet is:

    #container
    {
    /* background-color: #edead9;*/

    background-color: #FF0000;

    margin-top: 100px;
    margin: auto;
    }

    This is the code in the <body>

    <body class="oneColFixCtr" >

    <div id="container">
    <div id="mainContent">
    <table width="700" border="0" align = "center" >

    I tried using the # and a "." and neither works. I want the CSS to connect to "container.


    Thanks to all who help.
    Last edited by rob86; 02-22-2012 at 12:10 AM.

  2. #2
    New Coder
    Join Date
    Feb 2012
    Posts
    50
    Thanks
    0
    Thanked 10 Times in 10 Posts
    first change
    background-color: ##FF0000;

    to

    background-color: #FF0000; you had two '#'

    and to see if it's a problem with your location in the href put the code in between to <style></style> tags in the <head> directly in the page you want styled

  3. Users who have thanked cercos for this post:

    rob86 (02-22-2012)

  4. #3
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post
    Quote Originally Posted by cercos View Post
    first change
    background-color: ##FF0000;

    to

    background-color: #FF0000; you had two '#'

    and to see if it's a problem with your location in the href put the code in between to <style></style> tags in the <head> directly in the page you want styled
    OOPS!
    That's not the problem. I made the correction above.

  5. #4
    New Coder
    Join Date
    Feb 2012
    Posts
    50
    Thanks
    0
    Thanked 10 Times in 10 Posts
    I'm not getting what your actually having a problem with, what is the result you want and what's the result your getting?

  6. #5
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post
    Quote Originally Posted by cercos View Post
    I'm not getting what your actually having a problem with, what is the result you want and what's the result your getting?
    Read the original post. It's not working. According to Dreamweaver, It's correct, but it's not working.

  7. #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,958
    Thanks
    164
    Thanked 2,236 Times in 2,223 Posts
    Have you validated your CSS ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  8. #7
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post
    Quote Originally Posted by abduraooft View Post

    No, I have never had a page pass yet. When I make the recommended corrections the page no longer works!!!
    I can do html and beyond that very little.


    Running the page through W3C says:

    5 body p Parse Error p. style13 {font-size: x-small}
    9 body p Parse Error } { padding-top: 60px; }
    22 Parse Error [: #edead9; } div.maincontent background-color: #DCD5B9; } ]

  9. #8
    New Coder
    Join Date
    Feb 2012
    Posts
    50
    Thanks
    0
    Thanked 10 Times in 10 Posts
    post your whole style sheet

  10. Users who have thanked cercos for this post:

    rob86 (02-23-2012)

  11. #9
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post
    Quote Originally Posted by cercos View Post
    post your whole style sheet
    /*your custom style goes in this file*/
    /*if you're overriding style blocks from genstyle.css, you only need to include the attributes you're overriding, not the whole block*/

    body
    p. style13 {font-size: x-small}

    {
    padding-top: 60px;
    }


    #div.container

    background-color: #edead9;

    }
    #div.maincontent

    background-color: #DCD5B9;


    The header states that this code over rides the default style sheet.

  12. #10
    New Coder
    Join Date
    Feb 2012
    Posts
    50
    Thanks
    0
    Thanked 10 Times in 10 Posts
    Add whatever element you wanted to style where the YOUR_ELEMENT is. I fixed what I could see wrong try it out:

    Code:
    body,/*MISSING COMMA*/
    p. style13 {font-size: x-small} 
    
    YOUR_ELEMENT /*MISSING*/
    {
    padding-top: 60px;
    }
    
    #div.container
    { /*MISSING*/
    background-color: #edead9;
    }
    
    #div.maincontent 
    {/*MISSING*/
    background-color: #DCD5B9;
    }/*MISSING*/

  13. Users who have thanked cercos for this post:

    rob86 (02-23-2012)

  14. #11
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post
    Quote Originally Posted by cercos View Post
    Add whatever element you wanted to style where the YOUR_ELEMENT is. I fixed what I could see wrong try it out:

    Code:
    body,/*MISSING COMMA*/
    p. style13 {font-size: x-small} 
    
    YOUR_ELEMENT /*MISSING*/
    {
    padding-top: 60px;
    }
    
    #div.container
    { /*MISSING*/
    background-color: #edead9;
    }
    
    
    Sorry to say it didn't work.
    
    #div.maincontent 
    {/*MISSING*/
    background-color: #DCD5B9;
    }/*MISSING*/

    Sorry to say it didn't work.

  15. #12
    Regular Coder Donkey's Avatar
    Join Date
    Sep 2003
    Location
    Blackfield UK
    Posts
    312
    Thanks
    1
    Thanked 36 Times in 36 Posts
    have you uploaded your site to a server, or are you on a local web server? If you just have the files on your computer without using a web server (e.g. xamp) then the external CSS file won't work.
    Also; Check that the path
    Code:
    href="templates/template7/css/mytngstyle.css"/
    is correct, and that the index file and other pages are in the root file.
    " 90% of everything is crud" - Theodore Sturgeon
    Filthy Beast - a 60's Rock Band

  16. Users who have thanked Donkey for this post:

    rob86 (02-24-2012)

  17. #13
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Donkey View Post
    have you uploaded your site to a server, or are you on a local web server? If you just have the files on your computer without using a web server (e.g. xamp) then the external CSS file won't work.
    Also; Check that the path
    Code:
    href="templates/template7/css/mytngstyle.css"/
    is correct, and that the index file and other pages are in the root file.
    I'm aware it needs to be on server and have done so.
    Here is the code
    <link rel="stylesheet" type="text/css" href="templates/template7/css/mytngstyle.css"/>

    page.php/templates/template7/css/mytngstyle.css

  18. #14
    New Coder
    Join Date
    May 2007
    Location
    MI USA
    Posts
    54
    Thanks
    18
    Thanked 1 Time in 1 Post
    Quote Originally Posted by mddjfoclbyu View Post
    have you uploaded your site to a server, or are you on a local web server? If you just have the files on your computer without using a web server (e.g. xamp) then the external CSS file won't work.
    Also; Check that the path

    They are on the server.

  19. #15
    New Coder
    Join Date
    Oct 2011
    Posts
    25
    Thanks
    5
    Thanked 1 Time in 1 Post
    Make sure the css is in the correct folder and directory, and that you had no problems. Rename the file to ' style.css ' and use this code:

    Code:
    <link rel="stylesheet" type="text/css" href="templates/template7/css/style.css" />
    Sometimes at the end of the code the
    Code:
    "/>
    may need a space between the " and /

  20. Users who have thanked skill3d for this post:

    rob86 (02-24-2012)


 

Posting Permissions

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