css selectors

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS Selectors</title>
    <style>
        p{
            border2px solid red;
        }
        /* id selector */
        #bgblue{
            color: yellow;
            background-color: blue;
        }
        /* class selector */
        .redelement{
            color:red;
        }
        /* grouping selector */
        footerspan{
            background-color: pink;
        }
    </style>
</head>
<body>
    <h3>CSS Selectors</h3>
    <p id="bgblue">This is a simple paragraph to demonstrate css selectors.</p>
    <p id="secondpara" class="redelement">This is another simple paragraph to demonstrate css selectors.</p>
  <div>
      <p>This is yet another simple paragraph to demonstrate css selectors.</p>
      <span>this is span</span>
    </div>
    <footer>This is footer.</footer>
</body>
</html>

Comments

Popular posts from this blog

css tutorial

developer tools