---
title: "CSS plus selector; what is it?"  
description: "CSS plus selector; what is it?"  
author: "Anonymous User"  
published: 2013-04-16  
updated: 2013-04-16  
canonical: https://www.mindstick.com/forum/769/css-plus-selector-what-is-it  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 2 minutes  

---

# CSS plus selector; what is it?

Hi Everyone!\
I have seen many time in [css](https://www.mindstick.com/forum/514/background-gradient-ie7-css-problem) [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp) greater than sign "+", but not understand why used it.Please provide any suitable demo.\
Please help me!\

## Replies

### Reply by AVADHESH PATEL

**Syntax:**\
element+element \
**Example**\
div + p Hi Tanuj!\
Selects all <p> elements that are placed immediately after <div> elements\
**For example**

```
<html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server">    <title></title>    <style type="text/css">        .bg + div {            background-color: #888888;        }        div + p {            color: red;        }    </style></head><body>    <form id="form1" runat="server">        <div id="red" class="bg" style="height: 50px; border: 2px solid #ff0000;">        </div>        <div id="green" style="height: 50px; border: 2px solid #00ff00;">        </div>        <div id="blue" style="height: 50px; border: 2px solid #0000ff;">        </div>        <p>Greater Than sign (+) CSS Selector demo</p>        <p>Greater Than sign (+) CSS Selector demo</p>        <p>Greater Than sign (+) CSS Selector demo</p>    </form></body></html>
```

\
From the above example, you can see "background-color" apply on "green" div and color apply on second <p> element only\


---

Original Source: https://www.mindstick.com/forum/769/css-plus-selector-what-is-it

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
