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.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2011
    Posts
    96
    Thanks
    7
    Thanked 0 Times in 0 Posts

    BODY will not carrry over

    Hello:
    I have copied and pasted all of my css coding into a .css file.
    I started a new page with with the external style sheet as mentioned above.
    <link rel="stylesheet"href="C:\Users\Shepard\Desktop\styles.css" />

    Everything works great on the new page except the Body portion. In my style sheet I set left, right, top and bottom margins as well as background-color. When I open my new document it ignors my Body css code? My margins are all ar 0 and my color is white when it should be red.

    Any clues?

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Post the css.

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello SHEPME,
    Your link <link rel="stylesheet"href="C:\Users\Shepard\Desktop\styles.css" /> is referring to a file on your local C:\ drive, is that really the path you want to use? I would expect you really want to link to the styles.css on your server, not the one on your local machine.

    See absolute and relative paths explained here.


    That line might also work better with a space betweeen attributes like this
    <link rel="stylesheet" href="C:\Users\Shepard\Desktop\styles.css" />
    or, even better, something more like this <link href="C:\Users\Shepard\Desktop\styles.css" rel="stylesheet" type="text/css" />

    For more help with checking your code see the links about validation in my signature line below.


    To see why some of your CSS is being ignored, AndrewGSW is right in asking to see your code - both CSS and HTML would even be better.
    Last edited by Excavator; 04-24-2011 at 09:23 PM.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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