ADVERTISEMENT
ADVERTISEMENT

What does the '+' (plus sign) CSS selector mean?

Learn, what is the use of '+' (plus sign) CSS selector mean?
Submitted by Apurva Mathur, on May 21, 2022

CSS is a design language intended to simplify the process of making the web pages presentable. Selectors are used to selecting the elements and style them accordingly.

The "+" sign is also a type of selector which is used select the element which is just after another element.

Example:

<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>Title</title>
   </head>
   <style>
      div +p {
      color: white;
      font-size: 20px;
      font-family: "Baskerville Old Face";
      font-weight: bold;
      background-color: deeppink;
      }
   </style>
   <body>
      <div>
         <h2>
            "+"sign selector on this tag........
         </h2>
      </div>
      <p>
         Another "+"sign selector on this tag........
      </p>
      <h2>
         hello
      </h2>
   </body>
</html>

Output:

Example | plus sign CSS selector mean

CSS Tutorial & Examples »


ADVERTISEMENT
ADVERTISEMENT


Comments and Discussions!



ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.