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

How common are the pre/code and even the br tags?

I've never seen the pre/code tags before, but I do remember using the br tags back in like the HTML3 days quite frequently...but I just get the feeling that these 3: pre, code, and br aren't very common anymore as it seems with br tags that the browser interprets for spacing anymore if I'm understanding correctly....

So in the "coding wild" how often do you use these 3?

1 Answer

Ultimately, HTML is supposed to be the "content" layer of the website, where CSS is the "style" layer. HTML will dictate how search engines, people with impaired vision and sometimes people with slow connections will see your website. Even if you're not bothered about those things, it's good practice and a good habit to form to use correct tags where appropriate. It will make your code easier to edit in future, and easier for other developers to read and edit if you have to had a site over in the future.

Using <br> in the wild is fairly useful if you want to continue the content of a paragraph (<p>) on a new line without starting a new paragraph completely. I wouldn't say I use it often, but there are times I'm glad that tag's available to use.

If you are running a technical blog or website then <pre> and <code> suddenly become more useful. In fact, you're seeing the code tag in use right here! The code tag is used to highlight the tags I've mentioned above, and the pre tag is used to highlight the code example below!

<html>
  <body>
    <p>The <code>&st;code&gt;</code> tag is niche, but it has its uses!</p>
  </body>
</html>

So it really depends on what sort of content you're writing.

Hope that helps!