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 7 of 7

Thread: css is ignored

  1. #1
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts

    css is ignored

    i have a css that defines all paragraphs but if i do

    <p><span style=color:#0000ff;>this is a test</span></p>

    I would expect it to change the text color but it doesn't
    is there a reason why?

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    You need to wrap the style settings in parentheses:

    Code:
    <p><span style="color:#0000ff;">this is a test</span></p>
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #3
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to wrap the style settings in parentheses:

  • #4
    Senior Coder
    Join Date
    May 2004
    Posts
    1,464
    Thanks
    15
    Thanked 0 Times in 0 Posts
    that made no difference - it's taking the default from what the p is set to

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    And they meant quotes by the way not parentheses . Post the rest of your a code.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    And they meant quotes by the way not parentheses . Post the rest of your a code.
    Whoops, yes. It's early here!
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #7
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,776
    Thanks
    41
    Thanked 196 Times in 195 Posts
    it could be that the browser doesn't pick up the color or something... see demo and attached pic (works fine)

    Code:
    <html>
    <head>
    <title>Starbuzz Coffee</title>
     <style type="text/css">
    #wrapper{width:400px;}
    #one{width:200px; height:200px; float:left; background:blue;}
    #two{width:200px; height:200px; float:left; background:black;}
    #three{width:200px; height:200px; float:left; background:black;}
    #four{width:200px; height:200px; float:left; background:purple;}
    p{color:yellow;}
     </style>
     </head>
     <body>
    
    
    <div id="wrapper">
    <div id="one">one</div>
    <div id="two"><p>two</p></div>
    <div id="three"><p><span style="color:white;">three</span></p></div>
    <div id="four">four</div>
    </div>
    </body>
    </html>
    Attached Thumbnails Attached Thumbnails css is ignored-delete.png  

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


  •  

    Posting Permissions

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