- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
CSS Descendant Selector
The descendant selector in CSS is used to match all elements that are descendants of a specified element.
Example
You can try to run the following code to implement CSS Descendent Selector:
<!DOCTYPE html> <html> <head> <style> div p { background-color: orange; } </style> </head> <body> <div> <p>Para 1 in the div</p> <p>Para 2 in the div</p> </div> <p>Para 3 outside the div.</p> </body> </html>
Output
Advertisements