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

is there a reason to use inline html rather than <span>? Will it give search engines or readers extra info?

Is there a semantic reason to use inline html elements like <strong> <em> or <small>? Or do these elements simply change the style? If they simply change the style why have they not been depreciated in favor of css? If they do have semantic meaning where can I find out the meanings?

My best guess would be that those tags haven't been deprecated because it makes it easier to use such effects when manipulating the DOM. For basic styles, CSS is great.

However, if I manipulate the DOM with JavaScript and want to set the output to italics (or whatever else), I suspect it would be easier to use HTML tags to affect the result.

One example from w3schools is contained in the following code example...

<!DOCTYPE html>
<html>
<body>

<p>Click the button to create an EM element with some text.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    var x = document.createElement("EM");
    var t = document.createTextNode("Some emphasized text");
    x.appendChild(t);
    document.body.appendChild(x);
}
</script>

</body>
</html>

2 Answers

Both James Ackerman's answer and your guess are correct. Things like strong and italics are triggers for finding importance or relevance when it comes to SEO. So, I'm sure that on some level both are correct.... Functionality and the ever present need for web presence.

As far as information for search engines, you can use the following meta tag...

<!-- Meta Description -->
<meta name="description" content="Description of the page less than 150 characters">

This provides text in a search engine result. You can read more about that here

Thanks to David Dias for his Front End Checklist for helpful links and info on that subject.

Eh... yes. That is one part of SEO. It is, however, a very small part.

Things like h1 relevance to keywords, emphasis and the relation to target topics, image and video naming, order of keywords found on the page and a balance of how often a keyword and related words to a topic are repeated without "stuffing" ...and A LOT of other things go into true SEO optimization.

This, another small part, place quite a role and must not be left off if you truly intend on being found. (except there are now ways to have this information put in, but not visible in the source code directly....to prevent your competition mimicking you kw strategies). Thank you Google. :P But for getting started and getting found... unless you're a fortune 500 company or have major competitors in your area... this will work. But definitely don't forget the "description" meta tag as well.

<meta name="keywords" content-="place keywords, here, separated by, commas, like this"

Place them in order of importance you wish to target (this along with where they are found on page is important), use short tail and long tail (basic difference: Short targets One word or so vs Long tail targets a phrase). But...this is beginning to venture on into a class on SEO, which if you let me, I could teach a class on it since it was my specialty for SEVERAL years before I decided that I wanted to do more than just make pages and content visible on the web, but I wanted to create those pages and content. :)