0

So, after I tried all the answers in the forums over here, the font size of my webpage won't change. Here's what I currently have: <font size="40px" face="Didot">Hello</font> Okay, it will set to 40px, but if I try to make another one using 20px it won't change the font size: <font size="20px" face="Didot">World</font>
Whole code for those who want to check for themselves

<html>
<font size="40px" face="Didot">Hello</font>
<font size="20px" face="Didot">World</font>
</html>

3 Answers 3

3

<font> tag is deprecated. ( https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font )

Use CSS styling instead. See the example below.

.size40 {
  font: 40px/1.5 Didot, serif;
}

.size20 {
  font: 20px/1.5 Didot, serif;
}
<span class="size40">Hello</span>
<span class="size20">World</span>

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot for the support, and the inclusion of the website 😅 Should work, I'll try replace some stuff and see if it works! Already feeling confident about it.
1

If you are looking for ways to do inline styling you can follow this approach

<html>
<div style="font-size:40px; font-family:Didot">Hello</div>
<div style="font-size:20px; font-family:Didot">World</div>
</html>

But I would recommend to create a separate css file and define styles there. And import those styles in your html using script tags

Comments

0

As said in the previous answer the source is deprecated but if you insists on wanting to try you can use the following:

<font face="Verdana, Geneva, sans-serif" size="+7">Hello</font>
<font face="Verdana, Geneva, sans-serif" size="+4">World</font>

If it still doesn't work, use CSS:

<p>Hello</p>
<p>World</p>

p:nth-child(1){
   font-family: Didot;
   font-size: 40px;
}
p:nth-child(2){
   font-family: Didot;
   font-size: 20px;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.