Answers for "how to exclude element css"

CSS
1

how to exclude element css

/* You must use :not at the end of your style */

.class {
	color: black;
}

/* Excluding normal will be */

.class:not(#normal) {
  color: blue
}

/*
HTML

<body>
	<div class="class">
		<p>text specially in blue</p>
		<p id="normal">normal text</p>
	</div>
</body>
*/

/* first paragraph will be in blue but not the second one */
Posted by: Guest on August-04-2021

Browse Popular Code Answers by Language