Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
/* Descendant — any <a> inside .nav */ .nav a { text-decoration: none; color: #fff; } /* Child — only direct <li> children of <ul> */ ul > li { list-style: square; padding-left: 8px; } /* Adjacent sibling — <p> right after an <h2> */ h2 + p { margin-top: 0; font-size: 1.05rem; color: #555; } /* General sibling — all <p> after a .intro */ .intro ~ p { border-left: 3px solid #e0e0e0; padding-left: 12px; }
Result
Open