More CSS text properties | Intro to HTML/CSS: Making webpages | Computer Programming | Khan Academy


– [Voiceover] Listen folks, the CSS text properties are never ending. Let me show you a few more. What if I wanted to change the spacing between the lines in my song lyrics? I could use the line height property and specify something like 15 px or maybe better would be one point five m. And that makes the line height 150 percent of whatever the text size was. What if I want my song
lyrics to be center lined? I could use the text line
property, and specify center. I could also change it
to right or justify, though I think that would look a bit odd. What if I want to underline
my main paragraph? I could use the text decoration property and specify underline. What if I want to remove
the underline from my links? Like that link to Wikipedia. Well, the browser has
a default set of styles it applies to everything. Like text decoration underline for links. But we can use CSS to override
the browser’s default styles and say text decoration none. Just add this rule here,
a text decoration none. And you see now it’s no longer underlined. But we should be careful when we do that because the defaults are
usually picked for a reason. If links aren’t underlined, how will people know that they’re links? What if they never click them because they think
they’re just normal text? If we do remove that underline,
we should be making sure that the links look
significantly different in some other way. Otherwise we’ll make users
sad, and sad users make me sad. They should make you sad, too. I could tell you about
text properties all day, but I won’t because we
have so much more to cover. There are hundreds of CSS properties and browsers are adding more every year. I probably won’t ever tell
you about all of them, but hopefully I can tell you
enough to get you excited and then if you’re wondering
if there’s a CSS property for some style and it’s not
in our documentation here, you could just visit your local
search engine and find out. For example, if you’re
wondering if there’s a way to add drop-shadow to your text, just search CSS
text-shadow on the internet and you’ll see lots of results. Generally, being able
to search the internet for answers to your questions
is a really important skill for a web developer because so many people have had the same questions as you, and 99 point 9 percent of the time, the answer is out there. You just have to get good at finding it.

One Reply to “More CSS text properties | Intro to HTML/CSS: Making webpages | Computer Programming | Khan Academy”

Leave a Reply

Your email address will not be published. Required fields are marked *