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

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs