+ 1

Hi guys! Just wanna ask why I thi isn't working. I just want a custom font in the word "Hello" and have a margin from the left.

<style> p.m { margin-left: 30px; } p.a { font-family: "Rockwell", regular; } </style> <p class="m" class="a"> Hello</p>

19th Feb 2021, 10:54 AM
Senkyu
Senkyu - avatar
4 Respuestas
+ 3
Alian Axel Nieto Crooc Your error is in HTML you can't use two class attributes. <style> p.m { margin-left: 30px; font-family: "Rockwell", serif; font-weight: regular; } </style> <p class="m"> Hello </p> One class name is enough. I hope it helps you. Happy Coding!!
19th Feb 2021, 11:23 AM
Matias
Matias - avatar
+ 2
You are using the wrong format. You cannot have 2 class attributes. Try this: <style> p.m { margin-left: 30px; } p.a { font-family: "Rockwell", regular; } </style> <p class="m a"> Hello </p> Or You can use them under the same class name if you want.
19th Feb 2021, 11:10 AM
Kenneth Azaka
Kenneth Azaka - avatar
+ 1
You may have as many class names as you like but only 1 class attribute is allowed. Correct <p class="m a"> Hello </p> Incorrect <p class="m" class="a"> Hello</p>
19th Feb 2021, 11:46 AM
Chris Coder
Chris Coder - avatar
+ 1
Thanks y'all
22nd Feb 2021, 2:32 PM
Senkyu
Senkyu - avatar