skip to Main Content

I am new to HTML and CSS, here I had tried inline CSS(when external one was not working), also tried it in Codepen and both were working. I want the External CSS to run on brackets. I am confused if it was a linking error or have I missed anything ?

Here is the code :

index.html :

<!doctype html>
<html>
    <head>
        <title>The CSS Basics</title>
        <link ref="stylesheet" href="main.css">
    </head>
    <body style="background-color: #cc99ff">
        <h1 style="color:aliceblue; text-align: center;">Skateboarding is Awesome!</h1>
        <div class="square"></div>
        
    </body>
</html>

main.css:

.square{
    width: 100px;
    height: 100px;
    background-color: azure;
    margin:auto;
}

2

Answers


  1. link rel="stylesheet"

    Login or Signup to reply.
  2. just change ref to rel in your link.

    also i wouldnt recomend you to use inline styling, instead, use either embedded or external styling.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search