Selctors in css

technical talkiess
0

 <!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>Selectors in css</title>
</head>
<style>
/* attribute selectors */
h1{
    text-align:center;
    background-color: black;
    color:white;
}

/* nestd selectors in css
div ke ander ka p select karenga
*/
/* div p{
color: red;
background-color: aqua;
} */

/* specific element or id slect
div ke andar ka khali ek pahila p select karna hai to ye use karte hai
*/
/* div > p{
    color: red;
background-color: aqua;
} */
/* sibling ho to hi select karrta hai    */
div +p{
    color: red;
background-color: aqua;
}
</style>
<body>
    <h1>
        This is css selctors
    </h1>
    <div class="container">
        <div class="vishal">
            <p>This is vishal class paragraph</p>
        </div>
        <p>This paragraph is inside th containers</p>
    </div>
    <p>
        This paragraph is out side the containers
    </p>
</body>
</html>



css selecotrs


Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)