Are You W3C and CSS compliant?

Discussion in 'HTML & Website Design' started by Allinpoker.cc, Jan 1, 2008.

?

Is Your Site W3C Compliant?

  1. Yes

    71.4%
  2. No

    28.6%
  1. #1
    Allinpoker.cc, Jan 1, 2008 IP
  2. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Using tables for layout, presentational attributes, unsemantic markup, invalid values, I can go on.

    You should not be proud of that markup, nor should anyone who still has presentational elements, classes, or attributes even on html 4.01 strict / xhtml valid pages.
     
    soulscratch, Jan 2, 2008 IP
  3. Allinpoker.cc

    Allinpoker.cc Peon

    Messages:
    252
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Uh... yeah... that's why I said I'm still working on strict... but Transitional is valid HTML 4.01. :confused:

    So... how is your site? Or did you just come to this thread to talk crap? How about giving some suggestions on how to fix what you don't like? As it stands now, your post is absolutly useless to this thread and this forum.





    :cool:
     
    Allinpoker.cc, Jan 2, 2008 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #4
    soulscratch is one of the more vocal evangelists out there for clean, minimal, semantic and valid markup out there, so he can get a bit emotional at times.

    That, and his job demands that he convert decade-old code into modern, accessible and usable Web sites as well.

    As for me, I'm 100% XHTML 1.0 Strict and CSS 2.1 (both valid and warning free, of course).
     
    Dan Schulz, Jan 2, 2008 IP
  5. lock

    lock Banned

    Messages:
    205
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    not currently but i want to be so will be looking around this section for tips on "POSH" is it?

    Thats a new term i've learnt today.
     
    lock, Jan 2, 2008 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Ah, "Plain Old Semantic HTML". Leave it up to Tommy Olsson and Roger Johannson. ;)
     
    Dan Schulz, Jan 2, 2008 IP
  7. Allinpoker.cc

    Allinpoker.cc Peon

    Messages:
    252
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    For me, one of the most difficult things was to get my Magpie RSS news feed to display with W3C compliance. I love the magpie RSS parcer, but the documentation and support was a little difficult. If you want to add RSS content to your website, magpie has to be the best way to go, though. After getting magpie working properly, I was upset to see the results were not W3C compliant. Those damn ampersands... what to do... A little creativity and research, and here we go... I'm sure a better way exists, and would be happy for someone to post it here. ;)

    The php coding ended up looking like this in case anyone is interested, or needs the reference. You can see the results on my main page ( www.allinpoker.cc )

    
    <?php
    
    ini_set('display_errors', 0);
    define("MAGPIE_OUTPUT_ENCODING", "UTF-8");
    require_once("rss_fetch.inc");
    
    	$url = $_GET['url'];
    	$num_items = "10";
    	$rss = fetch_rss('http://www.allinpoker.cc/directory/rss.php?c=1);
    	$items = array_slice($rss->items, 0, $num_items);
    	echo "<ul>";
    	foreach ($rss->items as $item) {
    		[B][COLOR="Red"]// This section below replaces ampersands for w3c compliance[/COLOR][/B]
    		$item['link'] = str_replace("&", "&#38", $item['link']);
    		$item['link'] = str_replace("&amp", "&#38", $item['link']);
    		$item['link'] = str_replace("&#38&#38", "&#38", $item['link']);
    		$item['title'] = str_replace("&", "&#38", $item['title']);
    		$item['title'] = str_replace("&amp", "&#38", $item['title']);
    		$item['title'] = str_replace("&#38&#38", "&#38", $item['title']);
    		$item['description'] = str_replace("&", "&#38", $item['description']);
    		$item['description'] = str_replace("&amp", "&#38", $item['description']);
    		$item['description'] = str_replace("&#38&#38", "&#38", $item['description']);
    		$item['pubdate'] = str_replace("&", "&#38", $item['pubdate']);
    		$item['pubdate'] = str_replace("&amp", "&#38", $item['pubdate']);
    		$item['pubdate'] = str_replace("&#38&#38", "&#38", $item['pubdate']);
    		
    		// Define attributes to be displayed
    		$href = $item['link'];
    		$title = $item['title'];
    		$description = $item['description'];
    		$pubdate = $item['pubdate'];
    		// Display the processed content
    		echo "<li><a target=_blank href=\"$href\">$title</a><ul><li>$pubdate</li><li>$description</li></ul></li>";
    	}
    	echo "</ul>";
    ?>
    
    Code (markup):
     
    Allinpoker.cc, Jan 2, 2008 IP
  8. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #8
    hmm... there might be quite a few who will call him semantic nerd.
     
    VimF, Jan 2, 2008 IP
    AdamSee likes this.
  9. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hmm, the ampersands from PHP shouldn't ever show up in the HTML, so the validator should never see it. Ampersands within the html (like in links/urls for instance) should be &amp; or the unicode one you used,
    &#38
    Code (markup):
    .

    Oh, and my sites sure start out XHTML1.0 and generally CSS compliant (unless I need a Holly hack, not valid : ( but after they get set in a template by my colleague, who isn't quite so... anal about semantics shall we say? they get all sorts of <center> tags added, spaces above the doctype, single quotes mixing with double quotes, forms surrounded by fieldsets, spans holding divs, and JavaJunk crawling around in the HTML where it doesn't belong. But I usually manage to browbeat him into letting me see the code after he makes a change so I can make him validate it. But it's hard, it's like what's the point in writing it correctly if someone's going to come along and screw it up anyway?

    So the hard-coded stuff is complaint yes. I may take my name off the end-product though : (
     
    Stomme poes, Jan 3, 2008 IP
  10. ChaosFoo

    ChaosFoo Peon

    Messages:
    232
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The site that I am currently working on is completely valid XHTML 1.0 Strict and CSS 2.1 with the exception of the use of a CSS expression to get min-width functionality in IE 6.
     
    ChaosFoo, Jan 3, 2008 IP
  11. Frankitude

    Frankitude Member

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #11
    I validate, but I prefer to use the official XHTML/CSS validators at WWW consortioum http://w3.org

    http://validator.w3.org
    official validator for XHTML, XML and all HTML types, it also validates sitamaps

    http://jigsaw.w3.org/css-validator/
    official CSS validator

    Good link-bait thought ;)
    You'd be faster done if you've used w3.org validator API.
     
    Frankitude, Jan 3, 2008 IP
  12. Allinpoker.cc

    Allinpoker.cc Peon

    Messages:
    252
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #12
    The problem is when magpie parses the RSS feed, the variable string it creates to be echoed does not have the amersands in the correct format, hence the need to replace the 'bad ampersands" information in the string with the correct code as above.
     
    Allinpoker.cc, Jan 14, 2008 IP
  13. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Oh, you mean the parser is making the invalid code? It shouldn't, so maybe you've got to get another one. You shouldn't have a finished product and then have to re-write it to fix it.

    Dan Schulz has a PHP parser that he's offered to people before. Maybe PM him?
     
    Stomme poes, Jan 14, 2008 IP
  14. Austell

    Austell Peon

    Messages:
    110
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #14
    What is so great about being compliant anyway?
    Like one wise man said - browser is the only validator...
     
    Austell, Jan 14, 2008 IP
  15. Dondon2d

    Dondon2d Peon

    Messages:
    3,193
    Likes Received:
    146
    Best Answers:
    0
    Trophy Points:
    0
    #15
    soulscratch is just giving constructive criticisms, so you should not get mad or pissed or anything, you learn from it instead. My site freewarehunter.net is valid XHTML Strict and CSS, it has minimal design though.
     
    Dondon2d, Jan 14, 2008 IP
  16. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #16
    Search Engine Indexing, bragging rights, faster parsing.

    Of course, validation means crap all if you are using things like tables and presentational tags...(even though I sometimes use <center>..).

    Generally my pages validate xHTMl 1.0 Strict, with no tables or presentational tags. If for some reason CSS centering doesn't work I'll downgrade to Transitional and use <center>, although thats only happened twice.

    I don't bother with CSS validity, its just a nice bonus, though most of the times my sites pass CSS by fluke...
     
    blueparukia, Jan 15, 2008 IP
  17. Mooseman

    Mooseman Peon

    Messages:
    453
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Last time I checked my site validated as XHTML transitional and CSS. Not sure right now, can't be arsed to check :)
     
    Mooseman, Jan 15, 2008 IP
  18. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Deathshadow wrote the parser after I tried my own hand it at. I merely have it stored on a Web site I'm in the process of developing (despite being on the back burner). He wrote an update to one of the files, but I haven't incorporated it yet. Oh, and it uses XHTML syntax, but it can be converted to HTML with a few minor changes.
     
    Dan Schulz, Jan 15, 2008 IP
  19. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #19
    You mean it'll be on Minimal Markup?

    Do you know why the Magpie parser is doing this with the &'s? Why would it (is it really written that way??)
     
    Stomme poes, Jan 15, 2008 IP
  20. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Yes. As for Magpie, it's probably not escaping the amphersands. Other than that, I wouldn't know since I don't use it.
     
    Dan Schulz, Jan 15, 2008 IP