Tuesday, June 7, 2022
HomeWordPress DevelopmentTips on how to use a "not equal" CSS attribute selector ?

Tips on how to use a “not equal” CSS attribute selector ?


Enhance Article

Save Article

Like Article

 Cascading Model Sheets(CSS) fondly known as CSS, is a merely designed language meant to simplify the method of creating internet pages presentable. CSS permits you to apply types to internet pages. Extra importantly, CSS allows you to do that impartial of the HTML that makes up every internet web page. CSS is simple to be taught and perceive, nevertheless it offers highly effective management over the presentation of an HTML doc.

On this article, we are going to study the best way to use a “not equal” CSS attribute selector.

The :not(selector) selector is used to model each component that’s not specified by the selector. Because it prevents particular objects from being chosen, it is usually generally known as the negation pseudo-class

Syntax:

:not(selector)
{
 CSS types
}

Instance: On this instance, we’ve used the :not selector and paragraph component. In easy phrases, no matter is current in not selector, besides that component, the whole lot will change its model.

HTML

<!DOCTYPE html>

<html>

  

<head>

    <title>    CSS | :not selector    </title>

    <model>

        

        {

          colour: black;

        }

          

        :not(p) 

        {

          colour: inexperienced;

        }

    </model>

</head>

  

<physique model="text-align:heart;">

  

    <h1>GeeksforGeeks</h1>

  

      

<p>    A pc science portal for geeks.</p>

  

  

    <div>

        We offer quite a lot of companies so that you can be taught,

        thrive and still have enjoyable! Free Tutorials,

        Hundreds of thousands of Articles, Stay, On-line and Classroom Programs ,

        Frequent Coding Competitions ,Webinars by Trade Specialists,

        Internship alternatives and Job Alternatives. 

        Information is energy!

    </div>

</physique>

</html>

Output:

:not() selector

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments