Bummer! You must be logged in to access this page.

Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Html in different browsers

"<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->"

I'm having difficulty understanding how to make web pages that function properly/similarly in as many browsers as possible.

The above quote shows a snippet from html5 boilerplate (I think this is in relation to the browser-types).

I haven't found any tutorials that go into detail about how this all works.

Any info would be greatly appreciated.

4 Answers

Those are called Conditional Comments. They will detect if the user is using a specific version of Internet Explorer, and if so, the HTML within the if and endif comments will be rendered.

One application of this is to have different CSS files available and use a specific one depending on the browser in use. That way, if there are any known issues with that browser version, you can correct them in that specific CSS file and it won't affect the other browsers.

A more modern approach to this, however, is to either do a CSS reset or normalization, which will use just one CSS file to try and make all the browsers behave the same way with rendering.

i do not believe there is such a way since all HTML code is universal and should work on all web browsers! :)

Treehouse does not have a full tutorial on this specifically as far as I know. You can find information on the web about it, I haven't found a good step by step guide to ensure cross-browser support for ALL browsers ever. Check out sites like stack-overflow and maybe more blogs about HTML5 boilerplate. I think overall it depends on what you're trying to do though. Each element or situation is going to be different for the most part.

Thank you all for the help. =)