customizing drop down menu - html

Here is the drop down menu I am working on.
<select id="frames" onchange="updateDisplay()" class="styled-select">
<OPTION value="ravi">ravi</OPTION>
<OPTION value="steve">steve</OPTION>
<OPTION value="robert">robert</OPTION>
</select>​
and the css
select {
background-color:#232323;
border-color:#232323;
border-width:1px;
color:white;
};​
http://jsfiddle.net/ravi007/ZWwgW/3/
I am trying to add a grey back ground to drop down menu. I am partly successful.
I failed to add grey color to small button with arrow. I also want to make that arrow to white.
I am seeing a default yellow border around drop down when I click. Is there a way to make it blue
When googled I noticed that button part is related to browser.
Thanks

You can't change the arrow but you can make it look like its changed with an Image.
Here is a simple trick, Have a look at this Example
Not Exactly what you want, but helpful.

You have to add the background to the LI elements as well. This is only an issue in certain browsers IIRC.
select, select > option {
background-color:#232323;
border-color:#232323;
border-width:1px;
color:white;
}
Demo
As for the 'border' colour - are you sure this is not the 'outline'?? have you tried changing outline-color: blue; ? Demo with outline.
Here is the difference with the LI's getting the background color in Chrome on Linux (Ubuntu) http://jsfiddle.net/rlemon/ZWwgW/7/

Sadly,
you won't be able to change that arrow with CSS, because it is rendered by the browser you are using.
The only thing I can think of is to use this JQuery Library (example)
And for the border I think you will be able to access it like this (this border is only rendered by some browsers like safari):
select::-moz-focus-inner {
border-color: blue;
}
and if you are talking about the outline, you can simply do:
select{
outline-color: blue;
}

Related

Blue highlight when hovering in drop down menu

Is there a way to change the blue highlight color when hovering in a drop down menu? I'm using the drop-down list on my page. I have a drop down menu that allows you to choose the topic.
I would greatly appreciate any help or feedback on this topic.
That blue colour is called an outline, and is used for accessibility reasons.
For example, when you press the tab key to move between form elements, an outline is commonly used so the user knows what element is currently selected.
You can remove this outline with the following CSS:
select:focus {
outline: none;
}
However, It is not recommended to remove this. If you must, you should provide an alternative style by using a background colour, changing the text colour, or provide a custom outline instead of the browser default.
ex:
select:focus {
outline: 2px solid red;
}
.dropdown-item.active, .dropdown-item:active {
background-color: red;
}
These are the Bootstrap classes that need to be overwritten if you wish to change the highlighted background colour when you hover over the dropdown item (i.e. when it is "active").
The classes can be discovered by opening up the Elements section within Google Dev Tools (F12) and then highlighting the element that you wish to restyle. Finding the active states of classes can be a little more tricky and may require a little more digging into the HTML.

HTML button (part of button is dark)

I have a button in my application and currently its very basic:
<button style="height:150px;width:150px;border-radius:10px;">Hello,World</button>
Which means it has the default HTML CSS effects used w/it. I was attempting to change it w/CSS but everytime I make the button bigger, there's always this dark side on the right and bottom side..I'm not sure why. If I change it back to its default, its not there.
Here is the JSFiddle:
http://jsfiddle.net/htzgak6g/1/
I'm referring to the right side and bottom side. They seem darker to me than the other sides. All I want to do is have some type of button with rounded corners and a nice shade of color.
This is because buttons come with some basic default browser styles that are still taking effect because you haven't over-ridden them.
In this case, adding border: none will remove the border and the dark colour. (http://jsfiddle.net/htzgak6g/2/)
Look at a reset css to solve these problems and give a consistent blank slate across browsers.
The problem is that the browser appends default style to the elements which are marked by <system> in Firebug. You can use the Selectors style panel to view all the styles added.
As Toni said, you will need to use reset.css to ignore such styling. But for this specific problem, set the border-color to be transparent.
button {
border-color: transparent;
}
<button style="height:150px;width:150px;border-radius:10px;">Hello,World</button>
Just add border-style:none; like so:
<button style="height:150px;width:150px;border-radius:10px;border-style:none;">Hello,World</button>
Here is your updated JSfiddle

Remove the border inside color input

Demonstration: http://jsfiddle.net/WpJRk/
I have a color picker in my page using the new "color" type input:
<input type="color">
However, there is a black "border" inside the element which seems not able to be removed.
There is a 1px black box inside the field.
I don't really want the box inside. Doing this:
-webkit-appearance: none;
doesn't help.
Any solution?
Try the following CSS ruleset:
input::-webkit-color-swatch {
border: none;
}
Your jsFiddle doesn't show a box. (At least for me)
How about the following plugin instead?
http://jscolor.com/
I don't think you can do what you're attempting to do.
<input type="color"> is intended to show a color picker so for the element to denote that's what it does it defaults to black for the color. You can change the color value like you've done to match the background color (input type="color"> can't have an empty value), but you'll still have to contend with the border piece.

onclick button border color change

Should be fairly simple but I'm lost and all searches result in non-specific answers that don't directly relate to my issue.
Button, border is black but apparently, the "depressed" feel is achieved by changing the border color to black so when I do click the button, it feels "dead". Nothing happens, so it's hard to tell if you miss-clicked or what.
How do you change the "onclick" border color? That way, it can get that "depressed" look again.
.addButton {
border-color:black;
border-width:1px;
background-color:#00B0F0;
text-decoration:underline;
}
The best solution is to use css, try the following code:
.addButton:active,
.addButton:focus
{
border:0.5em solid #00c; /* here configure as your needs */
color:#00c;
}
Hope that helps!

Change border color on <select> HTML form

Is it possible to change the border color on a <select/> element in an HTML form?
The border-color style works in Firefox but not IE.
I could find no real answers on Google.
I would consinder enclosing that select block within a div block and setting the border property like this:
<div style="border: 2px solid blue;">
<select style="width: 100%;">
<option value="Sal">Sal</option>
<option value="Awesome">Awesome!</option>
</select>
</div>
You should be able to play with that to accomplish what you need.
As Diodeus stated, IE doesn't allow anything but the default border for <select> elements. However, I know of two hacks to achieve a similar effect :
Use a DIV that is placed absolutely at the same position as the dropdown and set it's borders. It will appear that the dropdown has a border.
Use a Javascript solution, for instance, the one provided here.
It may however prove to be too much effort, so you should evaluate if you really require the border.
No, the <select> control is a system-level control, not a client-level control in IE. A few versions back it didn't even play nicely-with z-index, putting itself on top of virtually everything.
To do anything fancy you'll have to emulate the functionality using CSS and your own elements.
select{
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=-1, OffY=-1,color=#FF0000) progid:DXImageTransform.Microsoft.dropshadow(OffX=1, OffY=1,color=#FF0000);
}
Works for me.
You can set the border color in IE however there are some issues.
Argh... I could have sworn you could do this... just tested and realized I wasn't correct. The notes below still apply though.
in IE8 (Beta1 -> RC1) changing the border color or the background color/image causes a de-theming of the control in WindowsXP (the drop arrow and box look like Windows 95)
you still can't style the options within the select control very well because IE doesn't support it. (see bug #291)
Replacing the border-color with outline-color should work.
<style>
.form-error {
border: 2px solid #e74c3c;
}
</style>
<div class="form-error">
{!! Form::select('color', $colors->prepend('Please Select Color', ''), ,['class' => 'form-control dropselect form-error'
,'tabindex' => $count++, 'id' => 'color']) !!}
</div>