I have a page that uses a Bootstrap modal. When it opens I can see a style added to the modal-open class:
I have can correct this in the page styling itself:
.modal-open {
overflow: inherit;
padding-right: 10px !important;
}
but this I would rather get to the source. Any ideas as to where to find this styling? I can't find it in the Bootstrap css.
Related
I have a form with mat-errors that I'm trying to space out. I know I can simply space out the form fields themselves, but I've been trying to add margin/padding/border to mat-error elements, and they all get applied, but they don't move.
As far as the CSS goes, I've tried most things I can think of to force it to move. The styles are applied but nothing is actually changing.
mat-error{
display: block !important;
position: relative !important;
margin-bottom: 40px !important;
padding-bottom: 40px !important;
z-index: 999;
}
Why is this happening?
Change your css to class: .mat-error instead of mat-error.
In order to change styles in angular materials you should define a global stylesheet declared in the styles array of your angular.json configuration file. and custom all mat styles within.
In Styles.css:
.mat-error {
color: aqua;
}
The result will be:
Please read Customizing Angular Material component styles article for better explanation.
Right now I'm making nicely formatted CSS files for our temporary WordPress site, until the new site is ready. After making a CSS style sheet and pretty HTML files, I found they didn't work in WordPress if they were inline in a post, but instead I had to put them in a separate raw HTML file (using "WP File Manager" plugin to upload them to a separate folder.) After that, the way they display on the site matched what they look like on my HDD or on my personal (LAMP) test site (using Safari 10.1.1 OS X), and if I display source in my browser it looks identical to what I uploaded.
Then I created a tooltip style with CSS following the tutorial on w3schools. In the style sheet I define "edit" as a style for changes I made to the original text
.edit { /* changes made, */
color: navy;
position: relative;
display: inline-block;
}
.edit .tooltip {
font-size: medium;
visibility: hidden;
background-color: navy;
color: white;
text-align: center;
width: 20em;
padding: 0.5em;
border-radius: 6px;
position: absolute;
z-index: 1;
}
.edit:hover .tooltip{
visibility: visible;
}
Then (per the tutorial) I add "tooltip" text inside "edit" text
<h5 class="edit">ΒΆ Then shall be said or sung the following Canticle.
<span class="tooltip">This canticle is most commonly used.</span></h5>
On my HDD and my personal site, the tooltip is invisible until I hover over it and then it pops up a balloon.
But when I load it onto WordPress, the hidden text is always visible inline, as if the "tooltip" style is ignored. To work around this bug for now (so I don't have to re-edit the HTML files), I was able to disable and hide all the tooltips by defining the tooltip style as
.edit .tooltip {
visibility: hidden;
font-size: 0%;
}
This suggests that the "tooltip" is being seen, but some aspect of the hidden part is being parsed differently on WordPress.com.
So is there some CSS style or property that WordPress could be using that causes my text to be shown? Any way to pre-emptively override this with CSS? Should I write a JavaScript that goes through and manually hides the tooltips?
Any experiments I should try to make it go away?
PS: This is different than the question at CSS Tooltip will not work on WordPress page because my text is shown inline.
You are saying:
But when I load it onto WordPress, the hidden text is always visible inline, as if the "tooltip" style is ignored.
This is an indication that the file with the styles for tooltip is loaded before other css styles are loaded. Thus files that load last override what's been loaded before.
For debugging, try adding !important to your tooltip style rules like this:
.edit .tooltip {
visibility: hidden !important;
font-size: 0%;
}
and see if that makes any changes.
Then, modify your WordPress files so that your tooltip styles are loaded last. That will allow you to remove the !important flag. (because using that flag is not a best practice and should be avoided whenever possible)
Ok so I have this scenario that I don't understand in the default bootstrap css style sheet the label css is defined like this
label {
display: block;
margin-bottom: 5px;
}
Now I override this css in my own stylesheet which is rendered after the bootstrap like this
label {
display: inline-block;
max-width: 100%;
margin-bottom: 5px;
color: #333;
}
Can someone explain me why is browser is still rendering as a display:block?? even if the styles are well defined are good rendered? here's the screen shoot the computed styles
Here's the proof of the override of the style
Update, this is how is rendered the stylesheets
You need to import your CSS code after Bootstrap that way it will get overwritten.
As pointed out, you can just use "!important" however, this is usually bad practice.
I am building a mobile site using jquery.mobile-1.0b3.min.css. If I download the css file, I lose some of the effects and icons from the theme I'm using. But I need to override some styling in that file even though it's hosted at jquerymobile.com.
The style I need to override is ui-select. The width attribute of this style is width: 60%, but I need to remove that style altogether while leaving the rest intact.
.ui-select {
width: 60%;
display: inline-block;
}
Is there a way to remove width: 60%; without effecting display: inline-block;?
You can add your own stylesheet that overrides any previous styles. (Just make sure your custom stylesheet loads after the jQuery stylesheet.)
I am trying to use DatePicker in my site. I have a main.css and it has a style as follows:
body {
margin: 0;
padding: 0;
line-height: 1.5;
font-size: 75%;
}
When I put the datepicker into the site the style of datepicker is changing.
Is there any way to prevent from changing it?
To fix it, find the specific style property(properties) in the body that affect your date picker and then specifically reset those properties in the datepicker css.
eg
/main.css/
body{
font-size: 2px;
}
for example ,the font-size will apply to everything you put on the page (including the datepicker) so to fix it go to datepicker css, and change font-size property for the specific element.
ie
/*datepicker css */
#foo{
font-size: 4px;
}
Cheers
If I understand you correctly, you can't prevent it as such, but you can override it and put it back as it was. You'll need to apply CSS to the date picker itself to override what the body styles are doing to it.
Does the date picker element have an ID, so you can apply CSS directly to it?