DEV Community

Miss_code_creaker
Miss_code_creaker

Posted on

HTML hujjatda CSS ishlatishni 3 usuli mavjud

1.Satrli stillar (Inline styles)

HTML
     <body>
          <h1 style="color: red;">Sarlavha</h1>
          <a href="https://google.com" style="color: green;">Googlega o'tish</a>
     </body>
Enter fullscreen mode Exit fullscreen mode

2.Ichki stillar (Internal styles)

<head>
     <style>
         .heading {
            color:red;
           }
          .Link {
            color: green;
          }
        </style>
      </head>
   <body>
         <h1 class ="heading">Sarlavha</h1>
         <a href="https://google.com" class="Link">Googlega o'tish</a>
   </body>
Enter fullscreen mode Exit fullscreen mode

3.Tashqi stillar (External styles)

index.html
    <head>
        <Link rel="stylesheet" href=./css/styles.css">
    </head>
    <body>
         <h1 class="heading">Sarlavha</h1>
         <a href="https://google.com" class="Link">Googlega o'tish</a>
     </body>

  styles.css
   .heading {
     color: red;
    }
   .Link {
     color: green;
    }
Enter fullscreen mode Exit fullscreen mode

    

Top comments (0)