Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm wondering if I should bother providing a fallback for HTML5 tags and attributes and CSS3 styling at this point in time.

I know that there's probably still a lot of people out there who use older versions of browsers and HTML5/CSS3 are still fairly new.

I read this article: Should I use non-standard tags in a HTML page for highlighting words? and one answer mentioned that people kind of "cheat" with older browsers by using the new tags and attributes, but styling them in CSS to ensure they show up right. This question: Relevance of HTML5: Is now the time? was asked about two years ago and I don't know how relevant it is anymore.

For example, I want to use the placeholder and required attributes in a web form I'm building and it has no labels to show what each <input> is. How do I handle this, or do I bother?

share|improve this question
    
A topic that would be relevant for review would be progressive enhancement. –  ClintNash Jun 29 '12 at 4:18
    
@ClintNash From what I'm seeing, "progressive enhancement" is the concept of supporting older browsers while still using cool new features. So providing "fallbacks" for older browsers, even ones rarely used (such as IE6 and etc.) is still a good idea? I've been doing it up to this point, but it was just getting tedious, hence the question. –  Abluescarab Jun 29 '12 at 4:28

1 Answer 1

up vote 1 down vote accepted

It really is up to who is your target audience? Is it fair to expect decent level of techiness (read: probably uses the latest browsers), so it would be a non-issue to use whatever technology the last couple versions of the major browsers support. If you can expect a sizable portion of the visitors using outdated browsers, you might want to consider using fallbacks.

In almost all cases, that means creating a separate CSS for mostly Internet Explorer, heh. For the issues not related to formatting, there's the possibility of using a separate container page for a HTML 4.01-based version. But of course keep the content separate, so you don't have to maintain two versions of the same data!

A simplified example, using PHP:

<html>
...
<?php
    $browser = new SupportChecker();
    if($browser->supports('html5') == true) {
        echo '<section id="news">';
        include('content.txt');
        echo '</section>';
    } else {
        echo '<div class="news">'
        include('content.txt');
        echo '</div>'
    }
?>
...
</html>

Of course for an actual page, a more sensible way to achieve that would be used. The above is just a description of the idea. The same will apply for the header of the page. You could start the page with the inclusion of a header based on the support:

<?php
    $browser = new SupportChecker();
    if($browser->supports('html5') == true) {
        include('html5_header.txt');
        $_SESSION['support'] = 'html5';
    } else {
        include('regular_header.txt');
        $_SESSION['support'] = 'regular';
    }
?>

That could be usable, I would presume. Then just compare to the session variable.

share|improve this answer
    
I've been using fallbacks since I learned about HTML5 and CSS3, it just gets tedious after a while, supporting browsers that aren't updated (which, you know, I don't blame people who don't update if they can't afford a new version of their OS). As it is, this is in general, so I suppose I should look at the audience for each separate project I do. Thanks! –  Abluescarab Jun 29 '12 at 7:33
    
Checking browser capabilities on the server is a bad, bad idea. –  tdammers Jun 29 '12 at 7:45
    
@tdammers Do you mean checking browser capabilities as the user loads the page? Or something else? –  Abluescarab Jun 30 '12 at 13:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.