Linked Questions
74 questions linked to/from What is the order of precedence for CSS?
2
votes
1
answer
930
views
CSS Precedence to same class from different CSS files loaded separately [duplicate]
Suppose we have 2 css files loaded into a web application, and both declare the .myStyle class with different, overlapping properties:
file 1
.myStyle{
padding: 10px;
background-color: rgba(...
0
votes
2
answers
470
views
CSS specificity: Tag selector overrides class selector [duplicate]
I'm new to web development and stuck at a problem in CSS. As per CSS specificity, it follows as inline > id selector > class selector > tag selector > browser default but in my case tag ...
0
votes
2
answers
119
views
CSS styling precedence [duplicate]
I have two CSS classes:
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius:10px;
}
.smaller-image {
width: 100px;
border-radius:30px;
}
Usage in HTML ...
1
vote
1
answer
58
views
DT: Custom CSS is being overwritten by default [duplicate]
I am trying to style the row highlight of my DT.
I'm adding custom css in ui.R using :
table.DataTable tbody tr.selected td {
background-color: aliceblue !important;
color: white;
}
This ...
-2
votes
2
answers
66
views
CSS - Two classes applying different styles [duplicate]
Say I have an element on which two classes are getting applied with conflicting styles. How is the precedence of the styles chosen?
<h1 className="red blue">What color will I be?</...
0
votes
0
answers
16
views
How is css specificity determined for elements with the same selector? [duplicate]
I have two styles affecting the same element (myDiv) from different stylesheets.
Stylesheet1.css
.myDiv{
background-color:#000;
}
Stylesheet2.css
.myDiv{
background-color:#FFF;
}
Neither style ...
173
votes
11
answers
202k
views
In which order do CSS stylesheets override?
In an HTML header, I've got this:
<head>
<title>Title</title>
<link href="styles.css" rel="stylesheet" type="text/css"/>
<link href="master.css" rel="stylesheet" type="text/...
26
votes
8
answers
29k
views
CSS precedence
My webpage contains:
<link href="/Content/Site.css" rel="stylesheet" type="text/css" />
<style type="text/css">
td {
padding-left:10px;
}
</style>
The referenced stylesheet ...
15
votes
7
answers
35k
views
Design system: styles override using TailwindCSS
I am trying to create a Design System using ReactJS and TailwindCSS.
I created a default Button component with basic styling as follow:
import React from "react";
import classNames from &...
11
votes
3
answers
10k
views
In CSS is .a.b different than .a .b?
In my css file is .a.b different than .a .b?
It's a simple question but it's always annoyed me. I tried it, but figured I would post it here in case this was useful as a reference.
6
votes
4
answers
69k
views
css, disable display: none;
I have this situation in my code:
<!-- This is the global CSS file -->
<style type="text/css">
#show_div{
display: none;
}
</style>
<!-- This is the local CSS file (only in ...
19
votes
3
answers
10k
views
Tailwind CSS breaking existing styles
When I added Tailwind to my React project, it breaks existing styles.
I was hoping to just use Tailwind classes (like mb-3) for shortcuts.
I didn't expect it to overwrite existing styles, like ...
16
votes
2
answers
26k
views
Is it a good practice to use Material Ui and tailwind in a same project
I am using next.js with tailwind css and i somehow need some of the ready to use components in my project so i can save my time, for that i have used material-ui. My application works fine but i have ...
5
votes
4
answers
9k
views
How to remove <td> border in bootstrap 3.0?
I need help, my css override for my table-bordered table seems not working. I'm trying to create a table something like this:
<table class="table table-bordered">
<tbody>
<...
4
votes
4
answers
7k
views
How to resolve Tailwind and Bootstrap conflicts in an Angular project
I am using Tailwind CSS and Bootstrap (ngx-bootstrap) in the same Angular project. For the most part, they play along nicely. However, when it comes to padding and margins, they fight like siblings. I ...