Duplicated icons with toastr - toastr

I have several icons on top of each other in a toastr message. This is what it looks like:
My code is very simple, I use toastr after an Ajax call :
success : function(reponse) {
$(event.target).next('i').hide();
if (reponse.retour == 0){
toastr["success"](reponse.texte_retour);
} else {
toastr["error"](reponse.texte_retour);
}
}
I have the same problem whatever the type (error, info, warning, success). What is going wrong?

Another way to resolve this issue is to load the toastr css before you load the inspinia css. This way Inspinia overwrites the toastr css with its own custom css

The issue is solved.
I use 'inspinia framework'. in its style sheet there is already somme css declaration about toastr :
I commented these few lines and now it works fine. Don't know if it is a bug or not on the "inspinia" side.
Dominique

I had same issue, I checked my reference links to my css, I found that I was calling "toastrStyles" css after "inspania" css. I moved calling my "toastrStyles" css before calling "inspania" css, and it worked for me.

It looks like you are using font-awesome icons along with the default icons.
Adding this to your css should fix the overlapping icons by hiding the default image.
#toast-container > div.toast {
background-image: none !important;
}
Also if you want to vertical center your image add
#toast-container > .toast:before {
position: absolute;
margin: auto 1.5em auto -1.5em;
top: 50%;
transform: translateY(-50%);
}

Nothing to be done with any of the css customisations.Just keep your
toastr css immediately after boostrap(if using) and before any other css links.Its will work without any issues.
likes this:
<link href="~/Content/bootstrap.min.css" rel="stylesheet">
<link href="~/Content/plugins/toastr/toastr.min.css" rel="stylesheet">
....remaining links here after.....comes

I experienced the same issue with Inspinia. The reason was I loaded the toastr css file after the inspinia css file (style.css) causing the toastr css to overwrite the inspinia styles.

In my case changing css import order was not helpful at all. In that happens to you as well, you could override classes:
#toast-container > .toast-error:before {
content: none;
}
#toast-container > .toast-success:before {
content: none;
}
It is similar to #Dom answer, but without changing inspinia or toastr code itself.

loading toastr css before any other css, fix this problem for me.

use ng7-snack-bar
https://angular-4hvr9p.stackblitz.io
4 different states, rank and avoid duplicates.
Auto close on transition.
AOT

Related

Cursor code, not showing the custom cursor set. CSS

pretty new to CSS and HTML and was hoping somebody could help me fix this. I wanted to be able to change the icon for the cursor although when I run the code, simply no change. A few visits to chatGPT hasnt done me much either. Here's my code:
body2 {
cursor: url("assets/img/wiiu/Smile_icon_32x32.png"), url("assets/img/wiiu/cursor.svg"), auto;
}
And yes, it is 32x32.
I've tried moving it to different classes, changing words, changing everything. Although nothing has worked.
here is a good reference: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor?retiredLocale=de
So basically you try to applie to a body2 HTML element you're CSS code. If its a class try the CSS selector .body2 {} or in the case its an id of a HTML element #body2 {}.
In you're css you've got one main picture and the second one as fallback. Just make sure you set the correct path corresponding to the location of you're CSS file.
To ensure that, you can also try the full path instead of the relativ one like C:\Users\xxx\Smile_icon_32x32.png
You are using the wrong css declaration, your code will only work if you have defined a custom html element having <body2> as tag.
What you probably want is:
body { ... }
applied to <body> tag
or a css class
.body { ... }
applied to or any other tag having body as class.
or a css id
#body { ... }
applied to or any other kind of tag with body as id.
Alternatively check in the browser console if the rule is applied and if the image path is resolved correctly.
Here is an example where http://example.com/32x32/990000/fff.png&text=PNG don't exist and https://dummyimage.com/32x32/009900/fff.gif&text=GIF exist so the gif will be used instead of the png :
.body2 {
display:inline-block;
cursor: url("http://example.com/32x32/990000/fff.png&text=PNG"),url("https://dummyimage.com/32x32/009900/fff.gif&text=GIF"), auto;
}
<div class="body2">display</div>

bbPress css - theme has hidden breadcrumb

I have installed bbPress in my website and my theme override some bbPress css which I do not want.
The forum breadcrumb is hidden with the following code:
div.bbp-breadcrumb, div.bbp-topic-tags {
font-size: 12px;
}
bbpress.css?ver….5.14-6684:404
div.bbp-breadcrumb {
float: left;
}
vlog-bbpress.css?ver=1.8.1:335
.bbp-breadcrumb {
display: none !important;
As you can see in the picture the CSS comes from two different files:
bbpress.css
vlog-bbpress.css
Somehow the rendering seems to override bbpress.css.
What code should I use to make the breadcrumb visible?
Having installed a plugin (Simple Custom CSS) to write custom css, what should I write there in order to have the forum breadcrumb visible?
Please look at the real website here http://italiancrypto.it/forums/
The breadcrumb is hidden by:
.bbp-breadcrumb {
display: none !important;
}
What you see is that it is addressed by one class, and an !important. One class isn't a problem, but !important is (and is generally viewed as bad practice).
The easiest way to overcome this, is by addressing the same bbp-breadcrumb with an extra class, that's above it. For example:
.entry-content .bbp-breadcrumb {
display: block !important;
}
You could also use the above ID of bbpress-forum, but that is generally viewed as bad practice as well. Then again, desperate times call for desperate measures ;-)
Try add an id to the class .bbp-breadcrumb with JS
document.querySelector('div.bbp-breadcrumb').id = 'breadcrumb';
this will add the id to the element, then in your css use
#breadcrumb {display:block !important;}
since the id takes precedence over class I think this should work.

CSS override, first loaded style sheet taking precedent

I have a very strange issue I cannot quite figure out with my css style sheets. I have 2 stylesheets, one is from a cdn, one is minified then injected onto my index.html (locally) on my local dev server right now. So just for a quick reference, in my header I have something like this :
<link rel="stylesheet" href="myCDNStyleSheet.css">
<!-- injector:css -->
<link rel="stylesheet" href="css/localMinifiedStyles.css?1474574347809">
<!-- endinjector -->
So that is just using a grunt task with grunt-cssmin and grunt-injector to put that stylesheet with it's own hash on.
Now what's weird is, even though the myCDNStyleSheet is loaded first, some styles from it are taking precent over styles in the localMinifiedStyles, and so currently, I've had to put some !important on the styles in 'localMinifiedStyles', which is very strange to me.
So to be super clear, what I mean is :
myCDNStyleSheet.css has :
.styleMe {
margin-left: 5px
}
and localMinifiedStyles.css has :
.styleThis {
margin-left: 12px
}
And the rendered html looking like :
<div class="styleMe styleThis">
is using the margin-left: 5px instead of the 12. I can see them both in the inspector.
Swapping their load order does not fix this, in fact it breaks it further because there are some styles in localMinifiedStyles that are taking priority correctly.
Even when inspecting the styles in chrome devtools, I see the localMinifiedStyles is below the style that is taking precent. I can't figure out the cause of this, is it possible the grunt injection does something I am not aware of? My assumption thus far in working with css is the last loaded stylesheet takes priority, and I missing something here?
I'm really not sure what caused the behavior you describe (If you have the exact same "priority" of css rule - the latter will win), however a simple way to fix your problem is to duplicate the class in your css definition. If you want the styleThis class to take over you can use:
.styleThis.styleThis {
margin-left: 12px;
}
It's kind of a hack, but it works in up to date versions of chrome, firefox and ie.
.green.green {
color: green;
}
.red {
color: red;
}
<div class="red green">
This text's color should have been red because the red rule is latter in the CSS, however it will be green due to the <code>.green.green</code> in the css rules.
</div>

Unable to override bootstrap css

I am trying to override the following found in the bootstrap class of "modal-footer"
margin-top: 15px;
I have the following HTML code that does this:
<div class="modal-footer my-modal-footer-override"></div>
and the following custom css :
.my-modal-footer-override {
margin-top: 0px
}
But this does not work.
Any suggestions ?
You could try a more specific selector. This could do the trick
.modal-footer.my-modal-footer-override {
margin-top: 0px;
}
Multiple class selectors should work in everything newer than IE6. Please note the absence of whitespace between the classes: this means that both classes are applied on the same element.
If this still does not cut it, you could put .modal before this selector, so: .modal .modal-footer.my-modal-footer-override.
The important! declaration could be used as a dirty hack, but I would advise against it.
Check your CSS import order. Make sure your custom css is loaded after Bootstrap. Use firebug or chrome dev tools to see if your styling is being overriden because of something imported laterin the html.
Have you tried this?
.my-modal-footer-override {
margin-top: 0px !important;
}
Using !important before the ";" will give this rule more weight than the bootstrap css.
You can add that inside yout HTML using ..css.. in the head, or in a new css document.

Custom CSS won't work in WP?

I am trying to do a slight change on a WP theme, I can't find the exact place to put in CSS and make it functional as I have test the same CSS code on FireBug's CSS Tab and it worked fine.
I have tried putting in style.css and also in Custom CSS which the theme offers but no effect. Thoughts?
This is my CSS and I am sure it is correct:
.top-links ul li {
position: relative;
z-index: 1;
}
Please use fire bug / source view to find the css path that attached with your theme. In common wordpress layouts that is loaded under your theme folder and may be the file name is styles.css. If that is not working properly please use the css like this.
.top-links ul li {
position: relative!important;
z-index: 1!important;
}
Maybe you just need to clear your browser's cache?