DEV Community

AKSH DESAI
AKSH DESAI

Posted on

CSS Basic Selectors

4. Code

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <style>
    .aksh span {
      font-size: 30px;
      color: green;
    }

    ul#rudra li {
      color: purple;
    }
  </style>
</head>

<body>
  <h1> Hello World </h1>

  <div class="aksh"> <span> hi </span> Hello World </div>

  <h1> Hello World </h1>

  <div class="aksh"> Hello World </div>

  <ul>
    <li>1</li>
    <li>2</li>
  </ul>

  <ul id="rudra">
    <li>1</li>
    <li>2</li>
  </ul>

</body>

</html>
Enter fullscreen mode Exit fullscreen mode

Output

Output

Thank You.
You can follow us on:
Youtube
Instagram

Top comments (0)