skip to Main Content

I am working on a webpage and I am trying to use css to change the font sizes and style for my heading. The css is simply not doing anything even though when I put it in vs code it found no errors.

Here is the code:

h1{
  color: #FFFFFF;
  font-family: "Press Start 2P", "consolas", sans-serif;
 }
<h1>welcome to chili chef</h1>

If anyone knows what I did wrong or a fix please tell me.

Thanks

3

Answers


  1. Your problem is that you didn’t connect HTML with CSS

    .my-heading {
      color: #FFFFFF;
      font-family: "Press Start 2P", "consolas", sans-serif;
    }
    <h1 class="my-heading">welcome to chili chef</h1>
    Login or Signup to reply.
  2. In the code, you have added color to #ffffff, which is for text color working fine (#ffffff is white)

    and font-family is for font of the text.

    To change font size, add font-size style.

    h1{
      color: #000; 
      font-family: "Press Start 2P", "consolas", sans-serif;
      font-size: 24px;
     }
    <h1>welcome to chili chef</h1>
    Login or Signup to reply.
  3. did you add external <link> tag to your <head> in your html file?

    <head>
      <link rel="stylesheet" href="cssFileName.css">
    </head>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search