Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    May 2003
    Location
    Mid-Cheshire, England
    Posts
    275
    Thanks
    1
    Thanked 3 Times in 3 Posts

    CSS coding error

    The line of CSS below produces a CSS error but I need help to understand what is needed to correct the error that reads:

    Expected end of value but found `top'. Error in parsing value for `margin'. Declaration dropped.
    http://www.sandiwaygolf.co.uk/gallery.html

    #container {position:absolute; /*relative;*/ width:770px; height:396px; margin:20px /*auto 0 auto;*/ top:20px; left:200px; border:1px solid #aaa; background:#fff

    Thank you in anticipation,

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: CSS coding error

    Your code, when tidied up reads:

    <pre>#container {position:absolute;
    /*relative;*/
    width:770px;
    height:396px;
    margin:20px
    /*auto 0 auto;*/
    top:20px;
    left:200px;
    border:1px solid #aaa;
    background:#fff</pre>


    The use of /* and */ is a way to comment out parts of the CSS so in fact it is just:

    <pre>#container {
    position:absolute;
    width:770px;
    height:396px;
    margin:20px;
    top:20px;
    left:200px;
    border:1px solid #aaa;
    background:#fff;
    }
    </pre>

    You had left off the closing semi-colon and closing curly bracket
    Jerry

  3. #3
    3 Star Lounger
    Join Date
    May 2003
    Location
    Mid-Cheshire, England
    Posts
    275
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Re: CSS coding error

    My sincere apologies - the line of code was incomplete and reads:

    #container {position:absolute; /* relative;*/ width:770px; height:396px; margin:20px /*auto 0 auto;*/ top:20px; left:200px; border:1px solid #aaa; background:#fff url(../imagestoo/back.jpg) 75px 10px no-repeat;}

    I have used the comments /* . . . */ to remind me of the original code as I had a great deal of difficulty in getting the gallery to display as expected.

  4. #4
    3 Star Lounger
    Join Date
    May 2003
    Location
    Mid-Cheshire, England
    Posts
    275
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Re: CSS coding error

    I've found an error in that a semicolon is missing (margin:20px ). Putting it in clears the CSS error but the gallery shoots up the page to partly cover the banner. Fixing that is for tomorrow!

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: CSS coding error

    If you look at my revised code higher up in th thread you can see I spotted that <img src=/S/wink.gif border=0 alt=wink width=15 height=15> <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Well done for spotting that, it is amazing how one little thing can skew code. I have found that laying the code out as I have assists in fault finding of this kind
    Jerry

Posting Permissions

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