Css File not loading properly in laravel - css

This is the inspect css file of the button whose background color is not changing. I changed it in the original file but after inspecting it shows the same
select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px;
}
this is my original file:
.select2-selection__choice {
border:1px solid #aaa;
border-radius:4px;
cursor:default;
float:left;
margin-right:5px;
margin-top:5px;
padding:0 5px
}
But why it keep loading that background color !!!

If you changed the styles in the original file that means - css is changed but browser can't render that. It renders the old cache files.
Possible solution: Refresh the cache of your browser and in my 90% case problem had solved.
Other possibilities of not showing css styles:
Sometimes we need to override any style and we write and link that. Here, link need to be in last.
That means- we have select2.css and main.css
in select2 there is something like
.test{
padding: 10px;
}
And we want to override that in our main.css like,
.test{
padding: 20px;
}
Then we've to follow the order of styles linkings. Like first add select2.css and then add main.css
<link rel="stylesheet" href="select2.css" />
<link rel="stylesheet" href="main.css" />
We also do that by adding !important of that style
.test{
padding: 10px!important;
}
Thus main.css's test class can't override the select2 's test class.
Hopefully you've cleared now about this..

Related

Angular 6 - html element background color does not change with component

I have a login page and I cannot color its background. I was able to color the app-login (name of my login component) element by adding
:host {
display: block;
background-color: blue
}
to my scss file. It was suggested in here
But only the background of component element is colored. The other parts of the page remains white. I can color the html element on browser
while inspecting. I added background-color:blue; to html{} tag.
I did the same thing on my .scss file but it didnt work. I also tried with !important but it still is not working.
My login.component.scss file:
:host {
display: block;
background-color: blue;
}
html{
background-color: blue !important; // not working
}
.card-container.card {
max-width: 400px;
padding: 50px 60px;
}
.card {
background-color: #F7F7F7;
padding: 20px 25px 30px;
margin: 0 auto 25px;
margin-top: 220px;
}
According to documentation (https://angular.io/guide/component-styles)
"The styles specified in #Component metadata apply only within the
template of that component."
This means everything you put in your login.component.scss affects only this particular component.
If you want to use
html{
background-color: blue !important;
}
You should put it in some global styles file (by default it is src/styles.scss).

Why is my header background/color not displaying?

I have no clue what's causing this, the last thing I modified was my footer and I verified, it wasn't that. So as I have no clue what's causing this I don't know how to show you my code. I don't know if the error is in CSS or HTML, I might have to show you both but they both have 100+ lines. For now I'm gonna put the footer and header CSS code here.
footer
{
box-shadow: 0px 0px 30px gray;
font-family:arial;
margin-right: -10px;
margin-left: -10px;
margin-bottom: -20px;
background-color: #a8a8a8;
}
header
{
background-color: red;
margin-top:-10px;
margin-left:-10px;
margin-right:-10px;
margin-bottom:-20px;
box-shadow: 0px 0px 25px black;
}
In your test.psichologique.com demo, your styles are failing because you have HTML comments in your style sheet. Change this syntax—
<!-- CSS CODE -->
to this
/* CSS CODE */
and your styles will work.

Jquery UI - can't seem to figure out the css to customize tab colors

I am struggling through the documentation on jquery ui (specifically tabs:
I've digested the js functions...but I am struggling with the css. For example, I cannot figure how to change the border color (it is like my customizations are not even being read)...
Here is my code so far...
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/base/jquery-ui.css" rel="stylesheet" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
ui.tabs-container {position: relative; background: #0000cd; }
ui.tabs {
float: left;
background: white;
height:400px;
line-height: 30 px;
padding: 0 16px;
width:409px;
scrollbar:false;
cursor: pointer;
}
ui.tabs:hover{ background: #f4f4f4; }
ui.contents {
float: left;
position: absolute;
left: 5%;
height: 300px;
margin-top: 31 px;
padding: 0 px;
border: 1 px solid #ccc;
font-weight: normal;
display: none;
}
When it comes to jQuery UI there's usually a lot of classes involved with different levels of cascading, so I recommend you use Chrome's developer tools or Firefox's Firebug to figure out what you need to target with your css.
For example, with this:
.ui-state-default.ui-corner-top.ui-tabs-active {
background: red;
}
You can change the color of the active tab...
Demo: http://jsbin.com/umixan/1/edit
Probably you are looking for two classes. ui-state-default and ui-state-active. So, just add the styling you need for each state. Example:
.ui-state-default {border:1px solid #000;}
.ui-state-active {border:1px solid #fff;}
Note, that your css (above code) must be after jQuery's jquery-ui.css, otherwise you have to use !important for changes to take place.
As darkajax mention though, you have to start using firebug (or Chrome's tools).

Google Translate is removing CSS

I've added googles translate app to a site using the following
code
<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
autoDisplay: false,
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?
cb=googleTranslateElementInit"></script>
The app seems to work for a couple of languages. When translating to other
languages all the css is removed.
I'm keeping an eye on specific elements (such as a li in the header, or a div), and then running the translation. I can see that neither the header scripts (ie the css), or the elements are being changed by the app. It's just that the styles are no long applied (firebug tells me 'This element has no style rules')
The problem occurs on Firefox but not Chrome or Opera.
Any ideas what's going on here?
In case anyone else has the same issue -
The php that compresses the css files was adding a title to the scripts so
<link title="Default" media="screen" type="text/css" href="/modules/pd_smoothgallery/jd.gallery.css" rel="stylesheet">
was being changed to
<link title="Par défaut" media="screen" type="text/css" href="/modules/pd_smoothgallery/jd.gallery.css" rel="stylesheet">
I removed the title and the translation works fine for all languages.
(not sure why firebug wasn't highlighting this change, but it wasn't).
#google_translate_element span{
color:white!important;
font-size:15px;
border-left:1px solid transparent!important;
line-height: 22px;
}
.goog-te-gadget-simple {
background-color: #5191CD !important;
border-left: 1px solid transparent !important;
border-top: 1px solid transparent !important;
border-bottom: 1px solid transparent!important;
border-right: 1px solid transparent !important;
}
.goog-te-gadget-icon {
margin-left: 0px;
margin-right: 0px;
width: 0px!important;
height: 0px !important;
border: none;
vertical-align: middle;
}

CSS: Problems with selecting html elements from CSS

I want to style a form in html using CSS. It's a really simple form, so I didn't expect to have any problems with accessing it with CSS selectors. But anyway, when I am trying to add something like:
#maincontent #left_side #comments{
margin: 100px;
}
or
#comments{
margin: 100px;
}
I see no visible effect.
Sorry, I think I am not very descriptive, but not sure how to describe the problem...
Maybe you could take a look at the demo url here:
http://chess-advices.com:8000/article/ololo/
And suggest how to fix my CSS, to pretify the form? (Well I actually just need to access it first)
Thanks in advance
You forgot to close this:
div.pagination span.disabled {
padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid #f3f3f3;
color: #ccc;
display:none;
change this to:
div.pagination span.disabled {
padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid #f3f3f3;
color: #ccc;
display:none;
}
To find this: Line 267 in your style.css or you can use strg/cmd + f to find it...
But i think, if you add something like this:
form label { width: 100px; display: block; float: left; }
form p { padding: 5px 0px 0px 0px; }
your form would look nicer :)
I hope this is the answer of your question...
There is an error earlier in the css file that causes this. There is no closing bracket on the style div.pagination span.disabled style, that makes the browser skip the rest of the css file.
Note: as an id is unique in a page, you only need #comments to target the element. The only reason to use #maincontent #left_side #comments would be if you need to make it more specific to override some other style, or if you use the style sheet for several pages and there can be other elements with the id comments that you don't want to target.

Resources