Methods to invalidate the css style: 1. By changing the element name to invalidate the css in this area; 2. By setting a high-priority css style to overwrite this css style and make it invalid.
The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.
Methods to invalidate the css style:
1. By changing the element name, we can achieve the purpose of invalidating the css in this area.
As we have already If the above separate style is set for #notice, you can cancel the style by changing the name of the element #notice
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> $(function() { $("#notice").attr("id", "notice00"); }); </script>
2. Overwrite this css style to make it invalid by setting a high-priority css style
Use !important to increase style priority.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> .aa{ font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #FF0000 !important } .bb{ font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; background-color: #FF0000; } </style> </head> <body> <div class="aa" style="background-color:#cc6600;font-size:16px;">中Class中包括:!important的样式 </div> <div class="bb" style="background-color:#cc6600">不包括的样式</div> </body> </html>
Rendering:
Recommended related tutorials: CSS video tutorial
The above is the detailed content of How to invalidate css styles. For more information, please follow other related articles on the PHP Chinese website!

I recently found a solution to dynamically update the color of any product image. So with just one of a product, we can colorize it in different ways to show

In this week's roundup, Lighthouse sheds light on third-party scripts, insecure resources will get blocked on secure sites, and many country connection speeds

There are loads of analytics platforms to help you track visitor and usage data on your sites. Perhaps most notably Google Analytics, which is widely used

The document head might not be the most glamorous part of a website, but what goes into it is arguably just as important to the success of your website as its

What's happening when you see some JavaScript that calls super()?.In a child class, you use super() to call its parent’s constructor and super. to access its

JavaScript has a variety of built-in popup APIs that display special UI for user interaction. Famously:

I was chatting with some front-end folks the other day about why so many companies struggle at making accessible websites. Why are accessible websites so hard

There is an HTML attribute that does exactly what you think it should do:


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.