Tag Info

Hot answers tagged

32

HTML5 is huge, but also awesome. In my view, it is mostly about interoperability. The spec goes and specifies even edge cases to try and make sure that all browsers read the markup the same way. In second place, HTML5 has video and audio, which do exactly what the name says it does. If you want to include video or audio, HTML5 should reduce your plugin ...


18

To keep track of features and specifications support you can check When can I use. It includes HTML5 and CSS3 features and things like SVG, PNG, CSS2.1 and CSS2. It also tracks their status of approval (Recommendation, Proposed Recommendation, Candidate Recommendation, Working Draft, IETF standard). FindMeByIP maintains matrices of supported CSS3 features ...


18

Someone is going to say that the markup should be Gzipped, so I might as well be the one. Here's a lengthy explanation of what Gzip is with links on how to set it up on Apache and IIS. An article on WebReference states that you'll find the following performance gains when using the mod_gzip Apache module. Webmasters typically see a 150-160% increase ...


12

Probably. There are parts of HTML5 that you can use right now, today. Forms for example. If you have <input type="email"> in a browser that doesn't support HTML5 (yes, even IE6) you will simply see the same thing you'd see if you used <input type="text">. Yet on a browser that supports HTML5 form elements, you gain the advantages of the email ...


12

HTML5 is supported by all browsers now, even IE5!(if you use the html5shiv script). I highly recommend reading http://diveintohtml5.org It is one of the best HTML5 resources out there. As for CSS3, if you do use it, make sure to use vendor predix too, on top of the regular syntax. e.g. border-radius -moz-border-radius -webkit-border-radius I believe in ...


9

Here is probably the best article about quirks mode that I have found. I personally try to always use standard mode whenever possible since it has the best chances to work with the majority of browsers.


9

It probably isn't worth it. I've played with removing whitespace in HTML a little bit, and saw only a 10% size reduction in payload after gzipping. Realistically, whitespace and linefeed removal is doing work that the compression would be doing for us. We're just adding a dab of human-assisted efficiency: Raw Compressed ...


8

To answer your question: yes, your current DTD is fine. But it's also the wrong question. Standards don't work like this. It's not about making sure you're always using the latest one, and they don't really "expire" in the way that your question seems to suggest. They're about picking one and following its rules. Even if your site were using HTML 4 and ...


7

For the iPhone in particular you should consider configuring the viewport, which controls the scale at which your page will get rendered. This is especially useful if your site is significantly narrower than the default viewport width of 980px. You can do this with a meta tag: <meta name = "viewport" content = "width = 590"> You can also set the ...


6

ok, a small one: keep tag names and attributes lowercase and consistent (as the standard mandates, by the way). It will increase the compression ratio by a percentage or two.


6

Well formed (x)HTML means there's less of a chance that the crawlers will incorrectly parse your documents. Poorly written (x)HTML leaves the possibility open that the crawlers either cannot interpret, or misinterpret your page's content causing the page to not be indexed or to be indexed incorrectly (to your detriment). The clues given by (x)HTML is a very ...


6

It most likely doesn't matter at all.


5

Google has outlined and explained their recommendations to best Minimize Payload Size. They include the following techniques: Enable compression Remove unused CSS Minify JavaScript Minify CSS Minify HTML Defer loading of JavaScript Optimize images Serve scaled images Serve resources from a consistent URL These suggestions are a part of their open-source ...


5

With more and more phones with higher resolution, good browser scaling and normal javascript/css support it's much less needed to make a special version of your site for mobile. Make sure you don't rely on :hover and you will do fine I guess. There is a good article on A list apart about fluid layouts which fit for all devices, take a look: ...


5

Use whatever technology suits your needs most. Eric Meyer wrote a nice article about why starting to use vendor-specific prefixes on CSS rules isn't lame like using css filter hacks used to be. I think the same applies to HTML5. If you can check browser support for different features, why not use it. So long as the site degrades gracefully, live it up.


5

If you develop in quirks mode, then you are effectively asking the browser to emulate pre-IE6 bugs. Is that really something you want to be doing? Wikipedia explains the basics of triggering quirks mode, but there are a number of special cases it doesn't cover. The link provided by txwikinger gives a good explanation of the history and the main ...


4

I find the new HTML elements rather interesting...some of them are promising semantic replacements for generic divs. The promising new elements include article, section, aside, figure, nav, header, and footer, among others. I really like the idea of semantic elements replacing meaningless containers. Oh yeah, a related item: the much-simplified doctype - ...


4

(This is my answer to a similar question over on webapps.stackexchange.com) The Canvas and Web Worker Threads are the most exciting aspects of HTML5 to me. I have written some web apps that make use of those features: GioAUTHor [sic] makes extensive use of the canvas to let you plot paths on a map and then find the shortest route from the start to the ...


4

There are the basic layout thing like border-radius, shadows (box/text), rgba support, and so on; This is what CSS3 is most known for. More interesting are the canvas tag, video tag, local storage, websockets and so on that will create much richer user experiences in plain HTML/JS/CSS. These features have the potential to be a great alternative for Flash on ...


4

If you are an extremely high-volume site, you may want to consider using super-short entity id and class names, as these reduce the size of both the HTML page and the CSS page used to style it. Also, be careful about overly-structured site composition; it is easy to add div and span sections when they are not truly needed. You may also want to consider ...


4

Instead of reinventing the wheel, here's a great post explaining the difference between the two. But to quote w3schools and give you a basic summary: The Most Important Differences: XHTML elements must be properly nested XHTML elements must always be closed XHTML elements must be in lowercase XHTML documents must have one root element They're so similar ...


3

Combine common css, images and javascripts into one file. This doesn't reduce the file size but it will reduce the number of http requests. For smaller files the http overhead far outweighs the download time. It is easy to write a script to combine css and javascript files so you can manage them easier during development but deploy them to a single file. ...


3

As others have said, the largest benefit comes from gzipping. Make sure that you use appropriate HTML elements. Instead of <div class="page-title">Hello World</div>, use <h1>Hello World</h1>. And the obvious one: don't use tables for layout! Use a simple grid system like 960.gs (or roll your own lightweight version). There can be a ...


3

First up, using Javascript to add invalid attributes to elements is exactly as bad as putting them in the HTML in the first instance. You're just masking the "problem". Second, I said this in another answer but the key to good validation is knowing what are the important errors to tackle. Will adding target="_blank" to a link negatively affect someone using ...


3

I can't find any recent numbers on HTML usage, but this site has some figures from 2 years ago. Here's a small-scale poll of web developers (figures will be skewed since it's from a development site) from 2008 as well. But it's probably best to just choose your HTML version or doctype by looking at browser support. On new projects, you should just use the ...


3

Some search engines will give you penalty points for mismatched doctypes, encodings, botched HTML, etc...


3

It'll be fine for a long, long time - browsers will ignore whatever they don't specifically understand. XHTML itself will die out eventually (including 1.1), but browsers still have to support all HTML versions in some form, so it won't completely go away. The hip new (technically HTML5, but very usable right now) doctype is great though, might be worth ...


3

You can use the meta tag like Tom Gullen suggested, but then the only way to find out the author is to check the source of the page, since browsers don't tell you. Most people do not know how to do that. If you want to make it clear to all visitors who wrote the page's content, put the author's name direct on the page. There is no special element for that ...


3

Adding to the recent responses, it is beneficial to know the differences between HTML4.01 & XHTML 1.0 and the previous responses sum those differences up. Already stated too that you should start learning about the new elements introduced into HTML5 and the minor changes in semantics. The great thing about the HTML5 spec is that it was built, in the ...


3

HTML5 uses better markups that are not only easier to use but also is slightly better for SEO purposes, while its not amazing for SEO as Google yets to favor HTML5 websites it does better from Rich Markups and the ASIDE elements and Articles which helps Google establish what the page is about and maybe elements which have nothing to do with the page itself. ...



Only top voted, non community-wiki answers of a minimum length are eligible