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 6 years ago.
Improve this question
I have below issues for my select2 box.
1) I want to change the background-color to white of previously selected item. For eg when you open the select box and then hover on the next item the previous selected item has a background-color grey, which i want to change to white.
2) After an item is selected from the dropdown there are two borders displayed, want to get rid of one border in grey color.
Fiddle - https://jsfiddle.net/w50c4uqf/
Here is the CSS code which changes the color of previous selected item:
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #ddd; //Change this color
}
You can go inside select2.css file and change this directly like:
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #fff;
}
Here is the jsfiddle link: https://jsfiddle.net/w50c4uqf/5/
For removing the border you should add this line:
.select2-container--default .select2-selection--single:focus {
border: 0;
}
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
help, I created a card with a button in it, in the card section I used the css property pointer-events: none; so that the button cannot be clicked because of that property, can I click the button without deleting the property pointer-events: none;
thank you
you can do that with the help of bootstrap, you need to give a mentor column class col-sm-12 and rest of the icons class col-sm-6
You can use #media queries to set the width and height of each icon.
#media (max-width: 786px) {
.icon1{
width: 30px;
height: 30px;
}
}
Media queries are useful when you want to modify your site or app depending on a device's screen size. Now the above css will work if the maximum size of the screen is 786px
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I am trying to create button effect in which will change its color on click and returns to its original colour after the click.
A conditional was added within the button effect to returns to its original code.
In this case I have four variables storing each color and instantiates for each button id in HTML.
// VARIABLES - ids from DOM instantiated as querySelector().
const btnBlue = document.querySelectorAll("#btnBlue");
const btnGreen = document.querySelectorAll("#btnGreen");
const btnRed = document.querySelectorAll("#btnRed");
const btnYellow = document.querySelectorAll("#btnYellow");
Giving an example of a button here is where I am stuck with the logic.
// Exemple with blue button:
$(btnBlue).click(function() {
$(this).css('background-color', '#00FFFF');
// the play() func does other logic such as join other functions
// together and flash all the buttons in different order.
blueBtnAudio.play();
if(btnBlue == '#00FFFF' ){
$(btnBlue).stop();
}
});
There's no need for any JS here. You can do this with CSS alone by using the :active pseudo-selector:
button {
background-color: #CCC;
border: 0;
border-radius: 5px;
padding: 10px 20px;
outline: 0;
}
button:active {
background-color: #C00;
color: #EEE;
}
<button>Click me</button>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
So , I have gotten a ticket from a client saying that he has some extra space after the footer end,i looked into it and it's true,basically,after the HTML ends there are a good few scrolls of plain black space. I tried giving the html doc a height of 100% and body a min-height:100% ,but it doesn't work.
It seems that the overflow of the div class="page-width" in the footer class="site-footer" is causing this issue. Set the css property overflow: hidden; to resolve the issue.
The implemented change:
.page-width {
overflow: hidden;
max-width: 1180px;
margin: 0 auto;
padding: 0 10px;
}
There is something that is shown from the dev tools that you have included in the HTML tag and has classes as follows html.js.svg.supports.csstransforms.csstransforms3d.csstransitions.shopify-features.__smart-payment-buttons--enabled.gr__virtualbabylon_com that has a dimension of 1349*2357.11. One of those classes or a combination of them generate that height of 2357.11. That is where you should start looking at.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have several pictures of the same button, each one representing it in a different sate: normal, pressed, focused, disabled.
How can I make it into an html button that automatically shows the correct picture (and also has an onClick event) ?
Feel free to use html / css / javascript.
The tag also doesn't need to be a button, it could be an image, , or whatever you want, but hopefully written in a generic enough way for others to use your solution too
Thanks!
Just add a class to a link:
<a href="#" class='styledbutton'>Buttontext</a>
... and some CSS:
.styledbutton {background: url(defaultstate.png); display: inline-block;}
.styledbutton:hover {background: url(hoverstate.png);}
.styledbutton:focus {background: url(focusstate.png);}
You can make use of the CSS pseudo-selectors :hover and :focus to change the state of a button at various different interaction points, and simply tie a function into the onclick event in order to run additional JavaScript if required:
function buttonClick() {
console.log('Button clicked');
}
button { /* Default state */
background: white;
}
button:hover { /* On hover */
background: red;
}
button:focus { /* After a click */
background: blue;
}
<button onclick="buttonClick()">Button</button>
Keep in mind that this can also be done with an image by simply passing the image's path into background-image as a url() value.
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 7 years ago.
Improve this question
Is it possible to make the trimmed borders by "border-radius" unclickable, and also not detecting you are hovering over it?
One way is to make the wrapping div and a tags also have a border radius...
.blackground > div, .blackground > div a {
border-radius: 100%;
}
.blackground > div a {
display:block;
}
The trick is to make the <a> tag the one whose size changes, because that's the element that determines the click area.
So you can do
.backgroud > div > a {
display: inline-block;
border-radius: 100%;
overflow: hidden;
}
Then remove the border radius (if you want) on the actual image.