Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In the last lesson we saw how to change the font face of text using the font markup tag and now we're going to look at how to change the size of the text using the font markup tag. So here we have the same paragraph and I'm going to go ahead and insert a font tag. We'll use the size attribute. I'm going to close the font tag here. We'll say size = "3", 3 is the default size. So when I save this and reload it in the browser, we won't see any change at all.
If I go ahead and make it 4, so it gets little bigger. Save, reload, there it is. If I make it 2, I'll see that it gets little smaller. Go ahead and save that and reload. And we have now smaller text. So 3 is the default and numbers between 1 and 6 are valid. So 1 is very, very small. We'll look at 1. Save, reload. That's very, very small. And we'll look at 6, which is very, very big.
Save here and go ahead and reload and 6 is very big. Besides using the absolute numbers, you can also use relative numbers. If I say +1, it will make it one size larger than what it's current, which is the default. So it's just that bigger font, it's just like 4. If I say -1, it will make it one smaller than what's in effect at this place of the document, which is the default in this case. So it makes it smaller. So you can use relative sizes and you can use absolute sizes. I tend to like the relative sizes more.
So I'm going to ahead and set this to + 1, and then I'm just going to show you one more thing we can do here. We can combine the face and size attribute. So if I say face="sans-serif" and save that, you will see that we'll get a sans-serif font that's a little bit larger than the default. So that's the font size tag, and you see you can use it also in combination with the font face tag. Remember that the font tag is an inline tag, so it belongs inside of the paragraph not on the outside of the paragraph.
Get unlimited access to all courses for just $25/month.Become a member