user2192865
user2192865

Reputation: 1

What is wrong with the styling in these lists (HTML)

I've been doing the web course on Codecademy and I'm stuck on the "Styling the font!" task. Any ideas what I'm doing wrong?

<li style= "font-family: Garamond; size:16px">This item is big Garamond.</li>

<li style= "font-family: Bodoni; size:12px;" >This item is medium Bodoni.</li>

<li style= "font-family: Futura; size:10px">This item is small Futura</li>

Thank you for all your help!

Upvotes: 0

Views: 423

Answers (5)

Billy Moat
Billy Moat

Reputation: 21050

Remember that most computers only have a limited amount of fonts installed: http://web.mit.edu/jmorzins/www/fonts.html

It's best practice to specify fall-back fonts too incase the users computer doesn't have the first font specified e.g.

font-family: arial, helvetica, georgia, verdana, sans-serif;

So if the computer doesn't have arial installed it will go down the list until it finds one it does have installed and it will display that.

Also you've declared size wrongly. It should be...

font-size: xxx;

Upvotes: 3

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85545

Defining font-family properties?

you could use multiple fonts like this font-family: arial, verdana, "Cooper Black";

Defining font size?

define like this font-size: 16px;

Alternatively you could define these font properties simultaneously like this font: 16px arial, verdan, "Cooper Black"; or font: 16px arial; or font: 16px/20px arial; below is line-height.

Upvotes: 0

RonEskinder
RonEskinder

Reputation: 527

Try this:

<li style = "font-size: 16px; font-family:Garamond">This item is big Garamond.</li>
<li style = "font-size: 12px; font-family:Bodoni">This item is medium Bodoni.</li>
<li style = "font-size: 10px; font-family:Futura">This item is small Futura.</li>

Upvotes: 0

St&#233;phane
St&#233;phane

Reputation: 83

<li style= "font-family: Garamond; font-size:16px;">This item is big Garamond.</li>

<li style= "font-family: Bodoni; font-size:12px;" >This item is medium Bodoni.</li>

<li style= "font-family: Futura; font-size:10px;">This item is small Futura</li>

Upvotes: 0

stldoug
stldoug

Reputation: 850

"size" should be "font-size".

<li style= "font-family: Garamond; font-size:16px">This item is big Garamond.</li>

Upvotes: 1

Related Questions