

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Selects all <p> elements that are placed immediately after <div> elements with CSS
Use the element+element selector to select elements placed after first specified element. You can try to run the following code to implement this,
Example
<!DOCTYPE html> <html> <head> <style> div + p { color: white; background-color: blue; } </style> </head> <body> <h1>Demo Website</h1> <h2>Fruits</h2> <div> <p>This is demo text.</p> </div> <p>Fruits are good for health.</p> <p>Fruits makes you healthy.</p> </body> </html>
- Related Questions & Answers
- Selects all <div> elements and all <p> elements with CSS
- Selects all <p> elements inside <div> elements with CSS
- Selects all elements with CSS
- Selects all <p> elements where the parent is a <div> element with CSS
- Selects specific elements like <p> with CSS
- Selects all elements with alt attribute with CSS
- Selects all elements with rel=”nofollow” with CSS
- Selects all elements with class="mydemo" with CSS
- How jQuery selects elements using CSS?
- Selects all elements with alt attribute containing the word "Tutorials" with CSS
- Selects all elements with a lang attribute value starting with "en" with CSS
- Selects every <ul> element that are preceded by a <p> element with CSS
- Style every <p> elements that is the last child of its parent with CSS
- Style every <p> elements that is the first child of its parent with CSS
- Overlap Elements with CSS
Advertisements