Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
HTML provides a new inline element called mark for highlighting text. Let's make a working copy of text.html here in the Chap04 folder, in your exercise files. Let me name this text-working.html, and open it up in the text editor. We'll go ahead and open this up also in the browser, so we can see these side by side, and open this up, so you can see the whole thing. And we have just a little bit a Loren ipsum in a simple HTML file.
Now let's say that I want to highlight this text here, which in the browser is this text here. And all I need to do, here I'm going to put it on a line by itself, just to let this stand out, is put the tag around it like that, and we'll come over in the browser and hit Reload, and we see our text is now highlighted, just as if we have used a yellow highlighter on our screen, except we don't have to clean it off later. Of course, if you want to, you can install this with CSS, you can say style= or you can put this in a external style sheet, and then I'll come over here and hit Reload and we see it's now green.
If I want to, I can even make the text white for the green background, and now it's highlighted with white on green. So the new mark element is for highlighting text. This is distinct from the or , which are for emphasis. You can easily modify the presentation of this feature using CSS.
Get unlimited access to all courses for just $25/month.Become a member