Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I have CSS class in use that has path
.override .sidebar label.firstheading
I'm trying to create style guide and use the same class in it as showcase, but style guide doesn't have sidebar element. Can I call ".override .sidebar label.firstheading" directly in class="" without full hierarchy?
If I add .sidebar element leading to it in style guide, it gets so much formatting from .sidebar that it messes the whole page up.
Your styling should always be as less specific as possible! You should have a basic styling for label specialized label.firstheading and if the structure is important for the label you should add more specifity (.sidebar label {} and/or .sidebar label.firstheading {...}).
If you follow this scheme you will be able to override styles and to use your html more modular.
In other words: you should reorganize the styling for the label.firstheading component
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
This is my html code
This is my css code
When in CSS I write the CSS code for .keys class like this and add class .transistionOfKeys to html then my border properties does not add to it
But when I change my CSS code to this by removing .container and just keeping it to .keys then it works
after changing CSS code
So I want to know reason for this...
Hope someone answer this question soon...
Change the selector for the second rule to .container .transistionOfKeys {...} to achieve the same CSS specifity as the first CSS rule.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am working on a Vue.js project that uses Vuetify and vue-flash-message. I am trying to set warning message background to 'blueviolet' by editing its style:
.flash__message.warning {
color: #ffffff;
background-color: blueviolet;
border-color: #ef9e3b;
}
but there is '.warning' class in Vuetify that overrides it, see the screenshot .
I wonder if anyone can explain what technique is used here. And what is the right way to make the message background 'blueviolet' in this situation?
The issue here is your second class which is telling the browser to set the background to yellow as the !important tag on the end of each property. !important tells the browser to override any other styles that overlap classes. You need to:
A) Remove the important from the yellow styles and apply them to the purple
B) Remove the yellow styles all together.
Option A will seem more 'logical' but it depends what environment your working in and how your code etiquette applies to your project. I prefer to keep everything simple and just remove the intrusive css and try and use less !importants in web projects.
For more information on the !important utility visit this helpful blog post: !Important Utility information
Hope this helps.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
How can i remove this image:
Image <--
Link: infinitefun20.blogspot.gr
when you want to use css, just say with element has wich display property :
ypu can use browser inspect to see yor element has wich class name
.post-avatar {
display: none;
}
Removing the Image from blog will require to check the code where its coming out from. So better will be to use CSS and hide it.
use this:-
.post-avatar{
display:none;
}
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have a question to web designers - do you think that it's fine to make CSS classes with one rule in them?
For example, I usually write classes like .float-right, .center or margin-top-40 to apply them to divs or some other elements. But I must say that I'm not writing all CSS this way, just applying these classes in some places when it's necessary to remain flexibility, like when I have to move one link to the right or something like that.
Do you think that it's the correct way of using CSS?
My suggestion is to create a base file which will include a lot of classes with one rule.
And in a different css file, you will use Sass with #extend to build your component css classes.
For example:
.foo {
color: red;
}
.bar {
#extend .foo;
}
For the examples you have mentioned, it is not necessary to write additional class for the particular style. You can write them where necessary.
Adding additional style rule adds extra class in the html markup.
You can use #mixin in SCSS which will be more efficient.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I have created css button style as here: http://jsfiddle.net/karimkhan/SgTy2/
When I used same css insite <style> in my page then it's effect changed. looks like below:
Actual css on fiddle gives this kind of view:
I am not good at css. What's wrong I am doing here?
What if you make an external css file? The same will probably happen, so see what styles are overlapping your element in inspector mode. I would not suggest to use !important, but rather make the style have more priority. One way to do this is to make your css selector more specific.
For example:
input[name="url"]
{
background: black;
}
has more priority as
input
{
background: red;
}
jsFiddle
Note that a more specifc path also takes longer to determ.
Hope you can work on a solution now.