Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Slashdot.org News

Slashdot HTML 4.01 and CSS 748

After 8 years of my nasty, crufty, hodge podged together HTML, last night we finally switched over to clean HTML 4.01 with a full complement of CSS. While there are a handful of bugs and some lesser used functionality isn't quite done yet, the transition has gone very smoothly. You can use our sourceforge project page to submit bugs and we'd really appreciate the feedback. Thanks to Tim Vroom for putting the HTML in place, Wes Moran for writing the HTML in the first place, and Pudge for writing the code to convert 900k users, 60k stories, and 13 million comments to comply. And for the brave, download the stylesheet and start experimenting with new themes and designs for Slashdot: some sort of official contest to re-design Slashdot is coming soon, so you can get a head start now.

Response to some reader notes in the forum:

  • There are a handful of validation errors. Some will be fixed in the next day or so. Others are external HTML that is out of our hands. We may never toally validate with zero errors. yes we're comfortable with that.
  • We're not going to XHTML for the same reasons as above- we control almost all of our HTML, but some of it (like the ads, and imports from other sites) just isn't ours to muck about with. We could go to XHTML, and someday we might, but today we're happy to just get to HTML 4.01 and CSS.
  • Light Mode will be back in some form or another. The problem is that light mode served two purposes: Low Bandwidth, and Simplified Design. The later will probably be handled with a CSS theme (we have a handheld theme already). Low Bandwidth is a little trickier, but we will resolve that soon.
  • All of our code is beta tested on www.slashcode.com and use.perl.org. Unfortunately there's always a few issues from those tiny tiny sites and the giant bohemoth that is Slashdot itself.
This discussion has been archived. No new comments can be posted.

Slashdot HTML 4.01 and CSS

Comments Filter:
  • by AKAImBatman ( 238306 ) * <akaimbatman@ g m a i l . com> on Thursday September 22, 2005 @09:19AM (#13621191) Homepage Journal
    I was wondering if there was going to be a story on this. I noticed the upgrade last night. Let me be the first (post? ha ha) to say, "Good job guys!" Yeah. it took you awhile. But better late than never, eh?

    And for the brave, download the stylesheet and start experimenting with new themes and designs for Slashdot:

    I was just going to ask if we could get a few more CSS styles like we saw in the Beta. Glad to see you're already on top of it. :-)

    I did some testing with a FireFox version I *know* contains the infamous "Slashdot bug". (Not sure if it's corrected in recent versions since I normally use Mozilla or Safari.) As far as I can tell from testing, the bug is completely fixed. Considering the upgrades, one would expect this to be the case, but you can never be too sure.

    Last but not least, the "Politics" and "Apple" sections look as nice as ever, but I'm afraid that the other sections look worse than ever. Can we turn off the colors for the other sites until better CSS sheets can be made? (Preferrably ones that don't hurt our eyes?) Yeah, the games section has the full treatment too, but I swear that the shades of purple it uses are causing me to go blind.

    An alternative solution to turning off the CSS for the other sections is to provide the front page CSS as a style option on all the pages. That way we could simply shut off the crazy colors without pulling the whole "games.slashdot.org/article.pl -> slashdot.org/article.pl" trick.

    Well, that's my 3.14159265 cents worth. Again, good job /team!
  • by YankeeInExile ( 577704 ) * on Thursday September 22, 2005 @09:19AM (#13621194) Homepage Journal

    I for one, welcome our new Standards Compliant Overlords.

  • HTML 4.01?! (Score:3, Insightful)

    by Anonymous Coward on Thursday September 22, 2005 @09:20AM (#13621205)
    Why not XHTML?
    • Re:HTML 4.01?! (Score:4, Informative)

      by dolphinling ( 720774 ) on Thursday September 22, 2005 @09:30AM (#13621347) Homepage Journal
      Because. [hixie.ch]
      • Re:HTML 4.01?! (Score:3, Insightful)

        by smallguy78 ( 775828 )
        what baffles me about xhtml is that browser engines handle HTML in a fast and effective way, so the desire to switch to xhtml for standard's sake seems pointless - the markup language was created for the parsing engine.

        The parsing engines are now all mature and so having to squeeze layout, scripting etc. into an XML format that doesn't necessarily lend itself to this makes no sense to me. Yes have well formed HTML, but making it XML compliant, why bother?
        • Re:HTML 4.01?! (Score:5, Insightful)

          by Lewisham ( 239493 ) on Thursday September 22, 2005 @10:46AM (#13621970)
          This is a lot like the argument for why bothering to comment, or why bothering to make code easy to understand, or why bother to code a web page in a half-arsed way as long as IE renders it OK.

          Because its the Right Thing To Do.

          Sure, it works fine as is. That's great. But if you can code in XHTML, why not? There are no good reasons not to apart from the fact you are lazy (I don't buy any of the arguments from that .ch site). Good HTML will look almost exactly like XHTML, why not make that extra step?

          XHTML enforces nice, clean code. None of the HTML fanboys can argue that. It can be parsed nicely in an XML parser, making it portable into all sorts of applications, from automagic web spiders making massive search engines, to little Java programs. HTML makes parsing more complicated, and the error handling an even bigger pain. Getting everyone to XHTML, especially technology flagwavers like /. should be easy.

          No, you don't have to do XHTML. But you should.
          • Re:HTML 4.01?! (Score:4, Interesting)

            by Anitra ( 99093 ) <slashdot@nOsPAm.anitra.fastmail.fm> on Thursday September 22, 2005 @11:52AM (#13622572) Homepage Journal
            Did you even read what CmdrTaco wrote? They have a reason NOT to go to XHTML, at least for now. But he leaves the possibility open.
            We're not going to XHTML for the same reasons as above- we control almost all of our HTML, but some of it (like the ads, and imports from other sites) just isn't ours to muck about with. We could go to XHTML, and someday we might...

            There are several browsers (and other tools, like XML parsers) out there that will break if an XHTML format doesn't validate as perfect XML. Since Slashdot does not control all of the code they pull in (especially ads, but also comments - neither of which are guaranteed to be valid XHTML), they want to play it safe.
      • Re:HTML 4.01?! (Score:5, Informative)

        by drew ( 2081 ) on Thursday September 22, 2005 @11:28AM (#13622330) Homepage
        I've read this rant a few times now, and of all of his reasons, none are very compelling.

        * <script> and <style> elements in XHTML sent as text/html have to be escaped using ridiculously complicated strings.
        Or you could refer to external files which you should probably be doing anyways. Besides, it's 2005. Are there still browsers in use that don't recognize the script tag? I haven't run across one in at least five years. Even browseres that don't support JavaScript at least know to ignore the contents of this tag.

        * A CSS stylesheet written for an HTML4 document is interpreted slightly differently in an XHTML context (e.g. the element is not magical in XHTML, tag names must be written in lowercase in XHTML). Thus documents change rendering when parsed as XHTML.
        Well, the second case is easily solved by writing tag names in lower case anyway. Wow, that was tough. I can't remember ever seeing a non-contrived case where the first was an issue, and even then it could be trivially worked around.

        * A DOM-based script written for an HTML4 document has subtly different semantics in an XHTML context...
        This is probably his one valid point. I do agree with this one, but also feel that it could be worked around with a little thought if you had a valid reason to use XHTML. Mainly you just need to use .toUpperCase() or .toLowerCase() when checking tag names, and you have to be able to detect whether to use namesapace aware functions or not based on which mime type you are using. Also, for sites (like slashdot) that don't use much javascript, this is probably not really an issue.

        * Scripts that use document.write() will not work in XHTML contexts.
        Good! document.write() should have been put out to die years ago.

        * Current UAs are, for text/html content, HTML4 user agents (at best) and certainly not XHTML user agents. Therefore if you send them XHTML you are sending them content in a language which is not native to them, and instead relying on their error handling. Since this is not defined in any specification, it may vary from one user agent to the other.
        And this is different from sending your document as HTML 4 how?

        * XHTML documents that use the "/>" notation, as in "<link />" have very different semantics when parsed as HTML4. So if there was to be a fully compliant HTML4 UA, it would be quite correct to show ">" characters all over the page.
        Probably technically true, but I've never seen this "SHORTTAG minimisation" discussed anywhere else, and I can't recall ever having dealt with a UA that treats self closing tags in such a manner.

        In short, there are issues to watch out for, but there are a lot of cases when XHTML may be preferable to HTML 4 (e.g. using an XML based content management system), and as the most popular web browser on the internet doesn't handle XHTML when served as application/xhtml+xml (and it has been announced that the next version will not either) and all remotely modern UA's will handle XHTML served as text/html, there are a lot of cases where it doesn't put make sense to put off adoption of XHTML for 2 years or more until the majority of browsers can handle it properly.

        That said, HTML 4 is still a perfectly valid alternative, and for a site like Slashdot where there are no compelling reasons to go with XHTML, and a lot of valid reasons for not, I don't see why anybody should complain that the site was done as HTML4+CSS and not XHTML+CSS.
    • Re:HTML 4.01?! (Score:4, Informative)

      by Freexe ( 717562 ) <serrkr@tznvy.pbz> on Thursday September 22, 2005 @09:31AM (#13621359) Homepage
      I let someone else explain this one, but basically you should be using html 4.01 and not xhtml unless you really know what you are doing and have good reason to do so.
      http://hixie.ch/advocacy/xhtml [hixie.ch]
    • Re:HTML 4.01?! (Score:5, Informative)

      by m50d ( 797211 ) on Thursday September 22, 2005 @09:36AM (#13621413) Homepage Journal
      Because XHTML is harder to write, and browsers can render HTML fine anyway, so what's the point? Yes, XHTML makes a cleaner spec if you're starting from nothing, but HTML is a standard that browsers have to be able to render, so XHTML doesn't make things any easier for anyone.
    • Re:HTML 4.01?! (Score:5, Informative)

      by Bogtha ( 906264 ) on Thursday September 22, 2005 @09:43AM (#13621486)

      This topic was done to death last time. [slashdot.org]

      Short summary: there are a few compatibility downsides and there's no real point because there's no benefit to using XHTML yet.

  • Testing process (Score:3, Interesting)

    by FortKnox ( 169099 ) * on Thursday September 22, 2005 @09:21AM (#13621209) Homepage Journal
    Why don't you guys have a formal testing process in place for slashcode?

    Seriously, its like every Thursday morning its a big test to determine how many '503 Service Unavailable' we will get.

    If this was done in a real web app environment, you'd guys wouldn't have your cushy jobs, ya know...

    Having said that, I get a 500 error randomly on any post...
    • Re:Testing process (Score:5, Informative)

      by AKAImBatman ( 238306 ) * <akaimbatman@ g m a i l . com> on Thursday September 22, 2005 @09:27AM (#13621298) Homepage Journal
      Why don't you guys have a formal testing process in place for slashcode?

      They do. Beta code gets tested here [slashcode.com] before it's put on Slashdot. Now the upgrade process often generates quite a few 503s (since Slashdot is actually down during that time), but it's just a temporary problem.

      If you're still getting 500s and 503s, try deleting all your cookies that point to "slashdot.org". Sometimes the upgrades have problems with old cookies.
    • Re:Testing process (Score:3, Insightful)

      by garcia ( 6573 )
      Why don't you guys have a formal testing process in place for slashcode?

      I'd prefer that they worry less about standards compliant code, testing, and other bullshit and instead work on eliminating worthless editorials, duplicate stories, and any number of other far more important issues to make Slashdot better.

      It's nice to see that they are working on *something* but it *was* working all those years just fine. It's just been the last two years that Slashdot has gone *really* downhill with stuff that has not
    • Why don't you guys have a formal testing process in place for slashcode?

      They do, we're it.

  • stylin' (Score:3, Insightful)

    by maharg ( 182366 ) on Thursday September 22, 2005 @09:22AM (#13621217) Homepage Journal
    nice one guys !
  • Thanks a bundle! (Score:3, Informative)

    by ceeam ( 39911 ) on Thursday September 22, 2005 @09:22AM (#13621218)
    Yes, and for those of us using "Light" slashdot version (it's in "Preferences" - white background etc, _much_ easier to read IMHO) now it looks like a buttload of shit. $(SUBJ). Will it be fixed?
    • Re:Thanks a bundle! (Score:5, Informative)

      by jamie ( 78724 ) <jamie@slashdot.org> on Thursday September 22, 2005 @10:35AM (#13621883) Journal
      Light mode has questionable reasons for still existing after this change. We're probably going to obviate/replace/improve it in the coming months (pick your verb).

      We obviously did not forget about it, as another commenter suggested. Tim and Wes put in quite some effort to make sure it was still supported in some form. But much of its reason for existence will (soon) be able to be accomplished by simply changing style sheets. You the user can do that with various hacks; on our side, as Rob mentioned in his writeup for this story, we hope to provide some mechanism for users to pick different style sheets sometime soon.

      Light mode was a kind of a half-assed hack that tried to do "show me Slashdot a little cleaner," "reduce my bandwidth for my 56K modem," and "give me the bare necessities for my mobile device," and IMHO didn't do any of those very elegantly. And the implementation kinda sucked too, so we want to get rid of it for code cleanup reasons. We're going to do mobile support properly (eventually) and let style sheets do the cleaning up. The third justification was bandwidth, and webpage bandwidth is pretty irrelevant in 2005.

      For now (at least), Light mode means no slashboxes, which makes sense to me (at least). If you want slashboxes, the workaround is to turn Light mode off. If you're in the ~1% of Slashdot readers who simply must have the Light-mode look and slashboxes too, I'm afraid you'll have to bear with us until we get the changes I described above implemented.

      And now I just realized Rob said much the same thing in his updated "response to reader notes," so go read that [slashdot.org] :)

      • If you want to clean up your code more, all the menu items are anchors wrapped in list items. this can be much cleaner styled as:

        <style>
        //should be in an attached stylesheet, not inline
        div.menu span { display: block; background-color: green; }
        div.menu a { display: block;}
        </style>

        <div class="menu" id="about">
        <span>About</span>
        <a href="/supporters.shtml">Supporters</a>
        <a href="/code.shtml">Code</a>
        <a href="/awards.shtml">Awards</a>
        </div

        • by Bitsy Boffin ( 110334 ) on Thursday September 22, 2005 @12:54PM (#13623103) Homepage
          Err, except the way it is now is semantically correct - it's a list of links. Your way it's just a bunch of links all mooshed togethor with no semantics at all.

          There is a lot of "div-itis" though, but I'm guessing that was to provide flexability for user defined stylesheets in the future, so can be forgiven i guess.
        • by binary paladin ( 684759 ) <binarypaladin@nOSPAM.gmail.com> on Thursday September 22, 2005 @01:20PM (#13623302)
          In a normal browser, that's fine and dandy. However, HTML itself (devoid of CSS) is read and used by other devices. For instance if I am browsing in Lynx, that list makes a huge difference in display and don't even get me started on voice readers and other things.

          HTML is not there purely to be used as an anchor for style. It is there to explain what kinds of content a document contains. I mean, why use an h1 - h6 or a p or em or strong? You could simply create contextual style definitions for divs and spans which would, more or less, do everything that other tags do.

          I mean really, if HTML was really just there for CSS all you'd need would be , , ,
          , , , , and . You wouldn't even need since you could could just define inline divs.
  • by jandrese ( 485 ) * <kensama@vt.edu> on Thursday September 22, 2005 @09:22AM (#13621223) Homepage Journal
    Although the Slashdot guys have blocked it again, there was a short time this morning where the validator could get through. It showed the main page as validating Ok for the most part, but some of the sidebars (especially the Freshmeat sidebar) as failing miserably. Just looking at the source doesn't give me a headache anymore though, which is a massive improvement.
  • Getting There... (Score:5, Interesting)

    by lukewarmfusion ( 726141 ) on Thursday September 22, 2005 @09:24AM (#13621257) Homepage Journal
    I'm glad to see the improvements. I was surprised to see a couple of the pages loading much faster and my text-size was slightly decreased from the previous version. Looking under the hood, I saw that the move was made. However, there are a few items I noticed (I'll submit to the SF page as appropriate)...

    Validator says it's not correct Strict. There are 13 errors. Some areas still have FONT tags and whatnot, but I don't know if those are includes from external sites (and therefore out of /.'s hands).
    <font size="3" color="#006666"><b>Search Freshmeat:</b></font><br>
    Anyway, I'll be working on an alternate design right quick. I also expect to see a Firefox extension to load up a custom Slashdot stylesheet (and maybe a /. styles database site to find good ones).

    Welcome to the 21st Century.
  • by OS24Ever ( 245667 ) * <trekkie@nomorestars.com> on Thursday September 22, 2005 @09:25AM (#13621267) Homepage Journal
    At first glance, it doesn't look any different to me, so you must have done something right.

    Except then I hit reply and the post a comment dialog looks a bit different but not bad.

    Must have been quite the effort, congrats.
  • close... so close (Score:4, Insightful)

    by Thng ( 457255 ) on Thursday September 22, 2005 @09:25AM (#13621271)
    http://validator.w3.org/check?uri=www.slashdot.org [w3.org]

    summary: "This page is not Valid HTML 4.01 Strict!"

    Sure, only 13 on the front page of /. (don't remember how much before) and they all seem relatively minor. Still, sure is better than what it was. Glad to see it. thng

  • Well (Score:3, Funny)

    by chrisgeleven ( 514645 ) on Thursday September 22, 2005 @09:27AM (#13621296) Homepage
    Time to get on the Duke Nukem watch...
  • Count on 'Em (Score:5, Interesting)

    by Doc Ruby ( 173196 ) on Thursday September 22, 2005 @09:27AM (#13621305) Homepage Journal
    Can we get some stats APIs? Like per-story counts of unique repliers (+/- ACs), broken down by point score, with metadata (date/time posted, categories, submitter ID, "author" ID). And links in the story, and comments (per point score)? How about some karma details?

    I'd like to see a Slashdotter make an app that shows trends of posting results. And an app that draws networks between posters, destinations, categories, etc. Let's rub Slashdot's soft green underbelly!
  • by bhtooefr ( 649901 ) <bhtooefr@@@bhtooefr...org> on Thursday September 22, 2005 @09:29AM (#13621329) Homepage Journal
    Wow, this looks NICE. You guys needed to go to CSS for a LONG time.

    Now, how 'bout taking a cue from AvantSlash [fourteenminutes.com], and making http://slashdot.org/palm [slashdot.org] actually work nicely?

    AvantSlash is horribly broken, now, due to your changes (although I knew it was coming, and so did they.) So, one of two things needs to happen: the guy behind AvantSlash needs to update it, or you guys need to make the Palm site work.
  • Aha! (Score:4, Funny)

    by GreatDrok ( 684119 ) on Thursday September 22, 2005 @09:30AM (#13621344) Journal
    So that's what is wrong with it. I have been looking at the page all day thinking there was something weird going on and now I know!
  • Styles - firefox (Score:4, Informative)

    by hrbrmstr ( 324215 ) * on Thursday September 22, 2005 @09:31AM (#13621355) Homepage Journal
    Most die-hard firefox users will know this, but since Taco threw down the gauntlet, those mere firefox mortals who wish to muck with the CSS and "win a prize!" can take a look at: Jesse Ruderman's page [squarefree.com] on using local style sheets (good links there) and there's always the style sheet chooser plus [geckozone.org] add on (yeah, the site's in French and I haven't tried that extension in a while since I use Safari mostly, but it should work).
  • Well Done. (Score:4, Funny)

    by feargal ( 99776 ) on Thursday September 22, 2005 @09:32AM (#13621367) Homepage
    After eight years, this news website has finally gotten around to using proper HTML.

    So, will it be another eight years before this news website gets around to using some proper editors?
  • Impact on Bandwith? (Score:5, Interesting)

    by fons ( 190526 ) on Thursday September 22, 2005 @09:40AM (#13621454) Homepage
    I would be very interested to know wheter this change has a big effect on the slashdot bandwith usage.
    • I once tried cleaning up a site with lots of tables and inline formatting, converting it to CSS. Stripping the formatting down saved roughly 15-20% on that site the more pages were visited using the cached stylesheets. If you only visited the front page, the bandwidth usage was actually a bit higher. It all depends how much inline formatting you have, but I thought 15% was significant enough to make the effort for, especially if traffic (hence bandwidth expense) is high.

  • by ishnaf ( 893700 ) on Thursday September 22, 2005 @09:41AM (#13621463)
    'Times New Roman' is so 27BC. It'd only take one line of css to get something with class. Like 'Comic Sans MS'. Everyone loves 'Comic Sans MS'.
  • by MCraigW ( 110179 ) <{moc.revaewgiarcm} {ta} {giarc}> on Thursday September 22, 2005 @09:47AM (#13621519) Homepage
    Not according to the W3C (world wide web consortium) validity checker http://validator.w3.org/check?uri=referer [w3.org]! It finds a number of errors on all the Slashdot pages I've checked. The CSS passes as valid though.

    Since HTML 4.01 strict and XHTML 1.0 Transitional are so close, only minor differences really, you could easily make Slashdot XHTML 1.0 Transitional.

  • Could we also... (Score:5, Informative)

    by TCM ( 130219 ) on Thursday September 22, 2005 @09:48AM (#13621529)
    ...get the following fixed? When you browse with a threshold that doesn't show all comments, the page numbers to click are completely broken. Sometimes, when I click on the 3rd or 4th page, I _still_ see the first post according to my threshold.

    There is actually no way to view all comments in order. I usually resort to clicking a page way later, like the 6th or 7th until I see a comment other than the first. But then I don't know if I missed any.

    The pages seem to count all comments regardless of score. The proper way is to count the posts _after_ the threshold is applied.

    This has been bugging me _for ages_!
  • by Doc Ruby ( 173196 ) on Thursday September 22, 2005 @09:59AM (#13621623) Homepage Journal
    Now that pages take so much less time to render in browsers, Slashdot.org has reduced the overall computational load on the Web. So much less heat generated by browsing computers, so much less power consumed, foreign oil and coal burned. Of course, now we'll more swiftly move from the Front Page directly to Slashdotting some poor server unwittingly mentioned in the story. Maybe the smoke from burning servers will make up for our horde of cleaner-running Slashdotters.
  • by mcc ( 14761 ) <amcclure@purdue.edu> on Thursday September 22, 2005 @10:04AM (#13621652) Homepage
    In safari and it seems firefox for macintosh weirdness abounds throughout the new slashdot layout. Things show up in sans-serif fonts at random, for example the contents of the "recent posts" box on user pages, or the "allowed html" beneath a post. Things have unexplained margins or indents; for example the "Subject" box when you submit seems to be over one space from the comment box. When showing comments, all the gray boxes have surprisingly large internal margins but everything else has no margins at all, all the comments are scrunched together. Font sizes seem to vary sometimes at random, for example the first three headlines on the front page are a totally different size from the ones beneath. The whole thing looks a bit hodgepodge.

    Of course, web design is unpredictable and I'm sure it'll get sorted out eventually.
  • Tags (Score:3, Insightful)

    by slummy ( 887268 ) <shawnuthNO@SPAMgmail.com> on Thursday September 22, 2005 @10:28AM (#13621821) Homepage
    There's one thing you easily conform to standards with, end your img and br tags properly.

    Example 1: <img src="img.png" />
    Example 2: <br />

    • Re:Tags (Score:3, Informative)

      by Anonymous Coward
      Those are simply empty tags in XHTML, but in HTML4 (and any other SGML application using the Reference Concrete Syntax) they are empty tags followed by ">" characters treated as content. Some browsers get this wrong, but it's not a good idea to rely on it. No matter what W3C claims, it's not really possible to modify a document so a HTML4 parser gives the same DOM as an XML parser--the grammars conflict.
  • by ellem ( 147712 ) * <ellem52@@@gmail...com> on Thursday September 22, 2005 @10:29AM (#13621837) Homepage Journal
    but is this getting us any closer to the new Duke Nuk'em? Shouldn't you boys be working on that?
  • Holy Shit! (Score:5, Interesting)

    by Anitra ( 99093 ) <slashdot@nOsPAm.anitra.fastmail.fm> on Thursday September 22, 2005 @10:36AM (#13621887) Homepage Journal
    Ever since the November 2003 article on A List Apart [alistapart.com], I've been wondering if this day would come. Almost two years later, it looks like it's finally here!

    Having worked on smaller sites, I can imagine how difficult this change was. I took a quick peek at the code; it's so much cleaner now, and it loads so much faster! Congratulations, guys.
  • Bohemoth (Score:3, Funny)

    by 14erCleaner ( 745600 ) <FourteenerCleaner@yahoo.com> on Thursday September 22, 2005 @11:52AM (#13622575) Homepage Journal
    Your typo has created a new word, and I like it!

    bohemoth n: A bohemian behemoth.

    I'm visualizing a 300-pound beatnik. ooo, that's nasty...OK, maybe that's a typical slashdot member...

Swap read error. You lose your mind.

Working...