Css

Knowing

Share

Using rules can be a dangerous way to style your webpage that usually means you are forcefully doing this, but they exist for some reason.

The paragraph will be colored red, even there is a ID selector that has higher priority. So, the this rule overrides all the particular property.

An rule works like this:

<!DOCTYPE html>
<html>
<head>
<title>Knowing </title>
<style type="text/css">
div { color: red ; }
#one { color: green; }
</style>
</head>
<body>
<div id="one">RED COLOR</div>
</body>
</html>

Normally use a rule defined in an external CSS style sheet that is overruled by a CSS style defined in the head of web document, which, in turn, is overruled by an in-line style within the element itself (we are assuming equal specificity of the selectors). So, defining a rule with a ‘attribute’ discards the normal concerns as regards the ‘later’ rule overriding the ‘earlier’ ones.

Read Also: Clearing floats

This rule is a part of CSS1.
Supported browsers: IE5.5+, Firefox 1+, Safari 3+, Chrome 1+.

Also, this is something that you do not want to use this pretty often, because you know you’re working with some other people around you who can override other properties.

In the mid to late 90s, when the CSS1 specification was drafted, CSS introduced declarations which can help developers and other users easily override the normal specificity when making any changes to the style sheets. In CSS2, declarations have remained the same with the one change only. Also in CSS3, nothing new added or altered in connection with this unique declaration.

Recent Posts

Unlock Growth – Guide to Online Financing and Business Loans for Entrepreneurs

If you are in a financial crisis , or need to start a new business…

22 hours ago

Optimize Your Hormonal Balance: Enclomiphene Citrate for Enhanced Wellness

Hormonal balance plays a pivotal role in overall well-being, influencing various aspects of health, from…

2 days ago

Paul Kanes Explores the World of Canine Companionship through Dog Walking

Dog walking is an excellent way to maintain your furry friend's camaraderie and provides many…

2 days ago

Top 5 Must-Have Features Every Mobile App Needs to Succeed

Introduction Businesses understand the diverse requirements of mobile applications, which provide a competitive advantage. There…

2 days ago

IoT Data Analytics: Ways to Gain Value from IoT Data

The Internet of Things (IoT) has recently changed the world. It links gadgets together and…

2 days ago

The Rise of NFTs: Exploring the Impact of Non-Fungible Tokens on the Digital Economy

NFTs, or Non-Fungible Tokens, are revolutionizing the digital economy. These unique digital assets, authenticated through…

3 days ago