i can't change the menu items color when on hover
As you can see, when on hover the color is shown only in the corners, but not on the actual item.
This is my css code:
/*Menubar*/
.p-menubar {
background-color: var(--primary) !important;
}
.p-menu-list {
background-color: var(--primary) !important;
}
.p-menuitem {
background-color: var(--primary) !important;
}
.p-menu-list:hover {
background-color: #000 !important;
}
.p-menuitem:hover {
background-color: #000 !important;
}
.p-menuitem-text, .p-menuitem-icon, .p-submenu-icon {
color: var(--text-primary) !important;
}
If i understood correctly, you need this
.p-menuitem-active a {
background: #000 !important;
}
or this depending on whether you want it for hover or on expand
.p-menuitem-link:hover {
background-color: #000 !important;
}
I am using Bootstrap 3. I have a button, but I am unable to preserve background color of that button when I hover it. No matter what I do, its background color is always grey.
.my-btn {
background-color: white;
color: #2b526d;
border-color: #2b526d;
margin-right: 0px;
margin-left: 0px;
}
.my-btn:hover {
background-color: white!important;
color: #dd3049;
border-color: #dd3049;
opacity: 1 !important;
}
I want the background of my button to remain completely white.
I'm not sure. But you can try the following css code. Hope it will work for you.
.btn.my-btn:hover {
background-color: white!important;
color: #dd3049;
border-color: #dd3049;
opacity: 1 !important;
}
I've just started to work with SAPUI5, and I'm having some trouble regarding combo boxes.
When I open the new window I created, it starts focusing the combo box, but with an annoying dotted outline. It only disappears if I click outside the combo box, but I really need it to not show at all, not even when I click inside.
I have tried several libs and classes, but none of these gave me the desired output.
Below are the classes I tried:
.comboCreateDoc {
border-left: none;
border-right: none;
border-top: none;
outline: 0px transparent !important;
outline-style: none !important;
}
html.sap-desktop .comboCreateDoc .sapMInputBaseContentWrapper {
border: none !important;
background: transparent !important;
outline-style: none !important;
outline: 0px dotted transparent !important;
outline-offset: -3px;
}
html.sap-desktop .sapMBtn:focus > .sapMFocusable {
outline: 0px dotted transparent !important;
outline-offset: -3px;
}
html.sap-desktop .sapMCbBgs:active > .sapMFocusable {
outline: 0px dotted transparent !important;
outline-offset: -3px;
}
.sapMInputBaseIconContainer{
outline: none !important;
}
.sapMComboBoxInner .sapMInputBaseInner{
outline: none !important;
}
html.sap-desktop .sapUiBody:focus {
outline: non !important;
}
How can I make the dotted outline disappear?
I dig into their samples to find the combo box and I saw that they don't use the native browser focus.
They put a class .sapMFocus that gives that dotted border to the element.
You need to override that class styles like that:
.sapMFocus .sapMInputBaseContentWrapper::before {
border:none;
}
I am trying to change the color of the menu item to black on mouse hover but after several tries, I am unable to do so. Please guide me. Thanks.
.primary-nav .suppa_menu .suppa_top_level_link.current-menu-item, .primary-nav .suppa_menu .suppa_top_level_link.current-menu-ancestor{
background-color: #FFFFFF !important;
}
.primary-nav .suppa_menu:hover .suppa_top_level_link {
background-color:#FFFFFF !important;
color: #000000 !important;
}
.suppa_item_title:hover .suppa_menu a:hover .suppa_item_title:hover{
color: #000000 !important;
}
In primary-nav.css, the color of the text on hover is currently set as:
.primary-nav .suppa_menu:hover .suppa_top_level_link .suppa_item_title {
color: #ffffff;
}
If you change this to:
.primary-nav .suppa_menu:hover .suppa_top_level_link .suppa_item_title {
color: #000000 !important;
}
it should work.
I am trying to style the button colour with below code, the colours work until I click the button, the button shows the default colours, how do I specify the colours of the button onclick?
.btn-success {
color: #ffffff;
background-color: #161617;
border-color: #494F57;
}
.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
color: #ffffff;
background-color: #1F2838;
border-color: #494F57;
}
.btn-success:active,
.btn-success.active,
.open .dropdown-toggle.btn-success {
background-image: none;
}
.btn-success.disabled,
.btn-success[disabled],
fieldset[disabled] .btn-success,
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active,
.btn-success.disabled.active,
.btn-success[disabled].active,
fieldset[disabled] .btn-success.active {
background-color: #161617;
border-color: #494F57;
}
.btn-success .badge {
color: #161617;
background-color: #ffffff;
}
The :active selector is what you need for the click.
.btn-sample:active {
// click styles here
}
It looks like you have that above so if you are still seeing a slightly different color it is most likely because of the box-shadow that is also applied to the active button state. Disable that like so:
.btn-sample:active {
box-shadow: none;
}
Edit:
The selector that is overriding your css is actually btn-success:active:focus. So you will need to add the following to your css:
.btn-success:active:focus {
color: #ffffff;
background-color: #161617;
border-color: #494F57;
}
Further to my comment below, you would be better off creating your own class such as btn-custom to which you can apply your desired styles. Combining this with the existing btn class, you can achieve your desired result with much less code as you won't need to override existing selectors.
You have to use the !important declaration to do that correcly.
.btn-success:hover, .btn-success:active, .btn-success:focus {
color: #ffffff !important;
background-color: #1F2838 !important;
border-color: #494F57 !important;
}
I fixed this behaviour with this css code:
.btn-primary {
background-color: #8ed3cc;
border: 0 !important;
padding: 1rem 5rem;
border-radius: 0;
font-family: 'Lato', sans-serif;
font-size: 1.2rem;
box-shadow: none !important;
}
.btn-primary:hover {
background-color: #69aca5 !important;
border: 0 !important;
box-shadow: none !important;
}
.btn-primary:focus {
background-color: #69aca5 !important;
border: 0 !important;
box-shadow: none !important;
}
Some inspiration from the bootstrap source for overriding these various button states where $off-white and $brand-black are defined by us:
.btn-success {
&:hover,
&:focus,
&.focus {
color: $off-white;
background-color: $brand-black;
}
&:active,
&.active,
&.disabled,
&:disabled {
color: $off-white;
background-color: $brand-black;
&:focus,
&.focus {
color: $off-white;
background-color: $brand-black;
}
}
}
That button press animation of the default color is due to the background image. Use this for each named style (btn-default, btn-success, etc):
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
background-image: none;
}
Just add the following code in your CSS
.btn-success.active.focus, .btn-success.active:focus, .btn-success.active:hover, .btn-success:active.focus, .btn-success:active:focus, .btn-success:active:hover, .open>.dropdown-toggle.btn-success.focus, .open>.dropdown-toggle.btn-success:focus, .open>.dropdown-toggle.btn-success:hover
{
color: #fff;
background-color: #161617;
border-color: #494F57;
}
If you are working on a personal project, and not with a team, it is worth noting that you can override pseudo class styles simply by applying "!important" to the same style declarations on the class:
.btn-success {
color: #ffffff !important;
background-color: #161617 !important;
border-color: #494F57 !important;
}
Generally, it's a good idea to stay away from !important because this will override any and all color, background-color and border-color style declarations on the btn-success class (unless you override the style declarations again with !important later in your style sheet although that's ridiculous).
If the goal is the smallest file size possible though and you are using this class everywhere in the same way - meaning no inline styles - then this may be your best option.
Alternatively, but using the same thinking, you may try naming a new custom class something like .btn-success-important, and only apply it after btn-success where you need to use the override.
There is one catch though: If you are combining .btn-success or your .btn-success-important with any other Bootstrap .btn-group, !important will override any pseudo class style declared within. In this case you may be better off with Guy's answer (the custom class without !important style declarations).
if you want remove the box-shadow just add box-shadown:none and make it important or if you want add box-shadows just add color values.
.btn-primary:not(:disabled):not(.disabled):active{
color: #fff;
background-color: #5b5fc6;
border-color: #5b5fc6;
box-shadow: none !important;
}
or
.btn-primary:not(:disabled):not(.disabled):active{
color: #fff;
background-color: #5b5fc6;
border-color: #5b5fc6;
box-shadow: 0 0 0 0.2rem #c9cbfa !important
}
to trigger any class whenever a button is clicked, you need :active selector and to fix the default behavior of the bootstrap button on click, you need to set the background-color to any color you want to along with !important. It will then override the default styling of the bootstrap class.
.btn-outline-primary:active{ background-color: [your color] !important}