Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: CSS warning, colour in 2 contexts

  1. #1
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default CSS warning, colour in 2 contexts

    Hi guys,
    So currently, through the W3C CSS validator, I'm getting a few warnings, and basically they're all the same kind of warning. The basic jist of it is:

    Same colors for color and background-color in two contexts label.access-info and #masthead .strip-nav

    Same colors for color and background-color in two contexts #columns and td.darkblue a


    A couple of the warnings are to do with the background color being the same as the border of the table's color.

    Unfortunately, however much this warning doesn't change anything, leaving it be is not an option, I would like valid CSS.

    Any advice would be appreciated
    thanks,
    Bernie

  2. #2
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    erm... I'll take a wild stab in the dark and say, change the colours? :s






    You can use color: transparent; to effectively "hide" borders, or just not have them visible at all, then they won't need a colour.

    Also, the only reason you'd have text colour the same as your background colour is to hide the text. For this you can set display: none; to stop it from displaying on the page, or visibility:hidden; to hide it but keep the spacing.

    If your colour scheme is causing validation errors, you may want to read up on Usability in Web Page Design. The colour scheme of a site is important to think about from your audiences perspective. Can your site be used by people with colour blindness? And remember there's more than one form of colour blindness. Most people won't struggle through trying to read a page if the information can be found easier with one of your competitors.

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    That's just a warning. It's like a possible typo. Maybe you intended to have a typo for some reason, or more likely the computer just doesn't know that what you wrote is a word-- maybe it's in another language. There's no reason to change it just so that your text editor doesn't think it's a typo.
    That's your situation here. Sure, you can use some of the tricks in the post above, but as long as you know why you're breaking the "rules", there's really no reason not to do it. Clearly having the same color in two places isn't going to hurt anything for compatibility, as long as you do want that look. Up to you though.
    Last edited by djr33; 06-13-2012 at 08:39 PM.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Thanks guys,
    Apache tech, your solutions are working fine thanks, Djr, I understand what your saying about how those warnings actually matter, I did clearly state in the question that ignoring them wasn't an option, but thanks anyway.
    Bernie

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I understand. What I'm suggesting is that sometimes part of doing web design well is to know when to ignore standards. It's NOT often, but when it comes up and you have a good reason, it can be important. It's totally up to you and I realize there are other concerns.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    It's true what djr is saying. The Web Standards are not laws.

    With Web Page Design, it's nigh on impossible to please all of the people, all of the time. Infact, for those poor people still using Internet Explorer to view your site, a lot of the 100% valid markup is meaningless. And then you have the webkits and CSS toolkits and stuff that are perfectly valid but are not yet supported by W3C's validation system.

    Have a look at the validation for google.com, even the big companies and the companies that sponsor Web Development don't have 100% valid markup.

    Another thing to think about, a vicious circle if you will. To be valid, every web page needs to have a <!DOCTYPE .../> tag as it's first line. It is invalid to have a) no DOCTYPE, b) More than one DOCTYPE, or C) a DOCTYPE anywhere than the top of the page.

    When you add an iframe to a page, assuming all your pages individually are 100% valid, you instantly invalidate the parent page because you're adding a second DOCTYPE into the body of the page. This can be seen effectively by using something like FireBug in FireFox. Taking the DOCTYPE out of either file will invalidate it, so you're stuck in a catch 22.

    The Web Standards are idealisms. They are guidelines to writing effective and well formed code. For the most part, they are very important; they allow standardisation (of sorts) in webpage design over a large array of mediums and platforms. Where they fall down, however, is when you come to individual cases. The validator is a machine, it works through your code programmatically and doesn't always see they final end result of the page as the user would see it. The more involved the page (Partial page rendering, iframes, user authenication, dynamic content, ajax, database access, etc) the less it will perceive it to be valid; even though the page is displayed exactly as it should be with no conflicts.

    Bottom line; get the important stuff right. Learn the fundamentals, try to work to Bullet Proof standards and write your pages for the benefit of the end user; but, when it comes to the snagging warnings and minor details within the validation, don't try to iron out every crease.

    P.S. Pressing Thanks on helpful posts are always appreciated, if the information I provided before was beneficial to you. *shameless vanity plug*
    Last edited by ApacheTech; 06-13-2012 at 11:49 PM.

  7. #7
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Thanks guys,
    I realize what your saying, and normally I would entirely agree, but this particular we page needs to be valid.

    And yes, I was going to thank you anyway apache
    Bernie

  8. #8
    Join Date
    Apr 2012
    Location
    Chester, Cheshire
    Posts
    329
    Thanks
    7
    Thanked 35 Times in 35 Posts

    Default

    May I ask why it needs to be valid 100%? Is it for an assignment?

    Also, which IDE do you use for coding your pages?

  9. #9
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    @ApacheTech -
    Very few web-designers actually use an IDE (With the exception of Dreamweaver). I believe that most people actually just use text-editors.

    Edit: I believe he's using komodo....

    Apparently not
    Last edited by keyboard; 06-14-2012 at 05:02 AM.

  10. #10
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    Currently I use aptana studio.

Bookmarks

Posting Permissions

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