CSS Combinators
How do I make an css combinators?
Example of CSS combinators. What is a css combinators? How do you make a css combinators? This script and codes were developed by Anthony Albertorio on 24 September 2022, Saturday.
CSS Combinators - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS Combinators</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="main"> <h1>Combinators</h1> <a href="#">A direct child of .main</a> <p> In sit amet consequat dolor. Fusce tempor odio vitae sem elementum, luctus luctus purus iaculis. Morbi mattis turpis nec orci tempus dictum. </p> <h2>I am a Heading 2</h2> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis egestas dapibus tristique. Nunc pharetra lacus a leo luctus pulvinar. <a href="#">Not a direct child of .main</a>. </p> <a href="#">A direct child of .main</a> <h2>I am a Heading 2</h2> <p> Aenean quis tellus vel dui viverra tempor. In sit amet consequat dolor. Fusce tempor odio vitae sem elementum, luctus luctus purus iaculis. Morbi mattis turpis nec orci. </p> <p> Nulla rutrum eleifend mi nec rutrum. Ut ornare diam dapibus, egestas elit aucto elit quis felis. <a href="#">Not a direct child of .main</a> </p>
</div>
</body>
</html>
CSS Combinators - Script Codes CSS Codes
body { padding-top: 35px; font: 1.1em/1.5 sans-serif;
}
.main { margin: auto; padding: 10px 20px 20px; width: 760px; border: 1px solid;
}
/* Using Combinators */
/* Direct Child Combinator
styles direct child only*/
.main > a { color: red;
}
/* Adjacent Sibling Combinator
styles sibling immeditely follow first selector
*/
h2 + p { color: white; padding: 10px; background-color: royalblue;
}
/* General Sibling Combinator
used to target other sibling, every y selector following x*/
h2 ~ p { color: white; padding: 10px; background-color: royalblue;
}
Developer | Anthony Albertorio |
Username | tesla809 |
Uploaded | September 24, 2022 |
Rating | 3 |
Size | 1,957 Kb |
Views | 16,192 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
CSS Basics | 1,996 Kb |
FreeCodeCamp-Tribute Page on Ethereum | 2,809 Kb |
Pomodoro Clock | 1,901 Kb |
Weather App | 2,717 Kb |
A Pen by Anthony Albertorio | 23,123 Kb |
CSS- Additional Pseudo-Classes | 2,690 Kb |
CSS- UI Element States Pseudo-Classes | 2,206 Kb |
CSS- Relative Length Units | 1,694 Kb |
Famo.us test | 1,753 Kb |
Tic Tac Toe | 4,263 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Simple Accordion | Wearebold | 3,683 Kb |
The Monty Hall Problem | Melatonind | 4,360 Kb |
Base-Style | Daniel_gooss | 2,614 Kb |
A Pen by Anoop | Anoopjohn | 330,760 Kb |
Import shader in three.js | Khangeldy | 2,636 Kb |
Free css icon set v2 - one div | Ben_jammin | 0 Kb |
Mobile Sub Menu Concept | Berdejitendra | 2,790 Kb |
TinFoil Boats | Chandralil | 4,577 Kb |
Funny menu | AxeLVaisper | 4,671 Kb |
A Pen by Mohomed Anees | Mohomedanees | 12,597 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!