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-21-2012 at 11:10 PM.

  • #2
    New Coder
    Join Date
    Feb 2012
    Posts
    40
    Thanks
    0
    Thanked 9 Times in 9 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

  • Users who have thanked cercos for this post:

    rob86 (02-21-2012)

  • #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.

  • #4
    New Coder
    Join Date
    Feb 2012
    Posts
    40
    Thanks
    0
    Thanked 9 Times in 9 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?

  • #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.

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,863
    Thanks
    160
    Thanked 2,224 Times in 2,211 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)

  • #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; } ]

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

  • Users who have thanked cercos for this post:

    rob86 (02-23-2012)

  • #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.

  • #10
    New Coder
    Join Date
    Feb 2012
    Posts
    40
    Thanks
    0
    Thanked 9 Times in 9 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*/

  • Users who have thanked cercos for this post:

    rob86 (02-23-2012)

  • #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.

  • #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

  • Users who have thanked Donkey for this post:

    rob86 (02-24-2012)

  • #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

  • #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.

  • #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 /

  • Users who have thanked skill3d for this post:

    rob86 (02-24-2012)


  •  
    Page 1 of 3 123 LastLast

    Posting Permissions

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