Change font size

Asked

Viewed 357 times

1

I am trying to change the font in an html document, however, if I enter the font name, it does not change and the font size goes back to the original.

This is the code I’m using:

p { 
    padding:20px; 
    background-color: white; 
    font-size: 20px 
    font-family: Helvetica  
}
  • 1

    You can post your question in English?

  • Twice I went to the homepage and thought I had entered the site Soen. Please translate question.

  • I am trying to change the font in an html document, however, if I enter the font name, it does not change and the size goes back to the original. This is the code I’m using: p { padding:20px; background-color: white; font-size: 20px font-family: Helvetica }

  • 1

    @Sanicspeed already tried to join ; at the end of the last two lines, font-family before font-size?

  • 1

    Okay. Thank you, I thought I tried that but I didn’t. It worked.

1 answer

3

If you put the ; in the last two lines as the CSS syntax asks so it will work well. In CSS when you have multiple lines/statements followed the use of ; is required. You can read more about syntax CSS rules and selectors on MDN. I adapted one of the images from there:

inserir a descrição da imagem aqui

Your code should stay:

p {
    padding:20px;
    background-color: white;
    font-size: 50px;
    font-family: Helvetica;
}

Example of how it was: http://jsfiddle.net/2tj8ur8h/
Example of what it should look like: http://jsfiddle.net/2tj8ur8h/1/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.