This question already has answers here:
Remove Select arrow on IE
(3 answers)
Closed 6 years ago.
I saw this answer to render an arrow on select element:
select {
width: 268px;
padding: 5px;
font-size: 16px;
line-height: 1;
border: 0;
border-radius: 5px;
height: 34px;
background: url(http://cdn1.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_down.png) no-repeat right #ddd;
-webkit-appearance: none;
background-position-x: 244px;
}
http://jsfiddle.net/qhCsJ/4120/
It works great for Chrome.
For Firefox the -moz-appearance: none; will do the trick.
But for IE I have no idea.
Add this (IE 10 + I guess):
select::-ms-expand {
display: none;
}
credits here: Remove Select arrow on IE
For IE9, wrap your select with a div and use something like this (a image that will be over the original one):
select {
width: 268px;
padding: 5px;
font-size: 16px;
line-height: 1;
border: 0;
border-radius: 5px;
height: 34px;
-webkit-appearance: none;
background-position-x: 244px;
}
select::-ms-expand {
display: none;
}
div {
position:relative;
display:inline-block;
border:solid black 1px;
z-index:0
}
div select {
z-index:1;
}
div:before {
background: url(http://cdn1.iconfinder.com/data/icons/cc_mono_icon_set/blacks/16x16/br_up.png) no-repeat right #ddd;
display:block;
position:absolute;
content:'';
right:6px;
top:5px;
height:1em;
width:1em;
margin:2px;
z-index:5;
}
IE 8 or before you can't.
Related
This question already has answers here:
How to hide drop down arrow in IE8 & IE9?
(5 answers)
Closed 8 years ago.
This css code doesn't work.
select::-ms-expand {
display: none;
}
Code of my dropdown:
select::-ms-expand {
display: none;
}
select {
width: 100px;
height: 30px;
-webkit-appearance: none; /* gets rid of default appearance in Webkit browsers*/
-moz-appearance: none; /* Get rid of default appearance for older Firefox browsers */
-ms-appearance: none; /* get rid of default appearance for IE8, 9 and 10*/
appearance: none;
background-color: none;
border: none;
border-top-right-radius: 0px;
border-bottom-right-radius:0px;
-webkit-border-top-right-radius:0px;
-moz-border-bottom-right-radius:0px;
background-image: url('../img/arrow_question.png');
background-position: center;
background-size: 30%;
background-repeat: no-repeat;
}
I've been looking for a long time and can't find a solution.
Use appearance: none; to achieve what you are looking for.
For instance,
select{
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
background: url("yourBackroundImagePath.extension") no-repeat scroll 0 0 transparent;
}
select::-ms-expand{
display: none;
}
Hope this helps.
This helped:
div {
width: 80px;
overflow: hidden;
border: 1px solid black;
}
select {
width: 100px;
border: 0px;
}
I have a dropdown menu styled with css that can have an infinite number of items and levels. The issue I have after getting it to work is that large lists and multiple levels can cause the list to run off the page either at the bottom or too the right. Is there a way with css to determine that it has run off the page and then move the list so it remains visible? I looked at a few examples such as this one:
How to avoid a vertical dropdown menu to add the vertical scrollbar when at bottom?
But I couldn't get it to work correctly with the css I had. That code is available here:
(Note there is a reference to jsfiddle dot net that this editor won't let me post so append the following to the jsfiddle dot net URL /petehelgren/SLyPL/22/
nav.medianav ul {
width:300px;
}
nav.medianav ul {
margin:0px;
padding:0px;
}
nav.medianav li {
list-style: none;
}
nav.medianav ul.top-level {
background:#efefef;
white-space:nowrap;
}
nav.medianav ul.top-level li {
border-bottom: #fff solid;
border-top: #fff solid;
border-width: 1px;
}
nav.medianav a {
color: #000;
cursor: pointer;
display:block;
font-size: 16px;
height:25px;
line-height: 25px;
text-indent: 10px;
text-decoration: none;
width:100%;
}
nav.medianav a:hover {
text-decoration: none;
color:#fff;
}
nav.medianav li:hover {
background: #fcaf17;
color:#fff;
position: relative;
}
nav.medianav ul.sub-level {
display: none;
}
nav.medianav li:hover > .sub-level {
background: #efefef;
color:#000;
border: #fff solid;
border-width: 1px;
display: block;
position: absolute;
left: 300px;
top: 5px;
}
nav.medianav ul.sub-level li {
border: none;
float:left;
width:300px;
}
Any suggestion for tweaks to get the menu to display even when it is too long or too nested?
You could use css3 columns, see fiddle: http://jsfiddle.net/SLyPL/23, older browsers may vary, see: http://caniuse.com/#search=columns
ul.sub-level{
-webkit-column-count: 2;
-webkit-column-gap: 15px;
-moz-column-count: 2;
-moz-column-gap: 15px;
column-count: 2;
column-gap: 15px;
}
I have a custom img for my dropdown option menu and i tried other browser like Internet Explorer and FireFox...
My Code:
textarea {
background: #9d9d9d;
color: #000000;
width: 90%;
padding: 5px;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
}
.styled-select {
width: 88%;
height: 30px;
overflow: hidden;
background: url('../img/down.png') no-repeat right #9d9d9d;
border: 1px solid #ccc;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
}
First Img is for Firefox the Second img is for Internet Explorer
For I.E:
select::-ms-expand
{
display: none;
}
For Firefox:
.select
{
-moz-appearance: none;
appearance: none;
text-overflow: '';
}
I am just cleaning up some CSS for a client.
I am not a front-end person, but have been saved by bootstrap (thank you, twitter).
However, I am having a really hard time cleaning up a custom navigation panel
(no twitter). I have provided the CSS below. I need it to be able to:
1) close gracefully at the end (the beginning starts with a vertical border, not an arrow.
I would like the end to have symmetry and close the way it began).
2) Get the container to not expand to the end of the page.
3) I can't seem to get it to work in chrome. It falls apart in chrome but works in IE and Ff.
Here is the link. Any advice? Thanks so much.
http://annualdinnerdev.elasticbeanstalk.com/
/* ------- Wizard Interface ---------- */
#wizHeader
{
border: solid 3px #fff;
margin-bottom:25px;
-moz-box-shadow: 3px 3px 4px #C2CBCE;
-webkit-box-shadow: 3px 3px 4px #C2CBCE;
box-shadow: 3px 3px 4px #C2CBCE; /* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#C2CBCE')"; /* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color= '#C2CBCE' );
}
#wizHeader li label
{
font-size:x-large;
}
#wizHeader li a
{
font-size:large;
}
#wizHeader li .prevStep
{
background-color: #D6E6FA;
color:#000;
}
#wizHeader li .prevStep:after
{
border-left-color: #D6E6FA !important;
}
#wizHeader li .currentStep
{
background-color: #6699CC;
color:#fff;
}
#wizHeader li .currentStep:after
{
border-left-color: #6699CC !important;
}
#wizHeader li .nextStep
{
background-color: #F0E9EA;
color:gray;
}
#wizHeader li .nextStep:after
{
border-left-color: #F0E9EA !important;
}
#wizHeader
{
list-style: none;
overflow: hidden;
font: 14px Helvetica, Arial, Sans-Serif;
margin: 0px;
padding: 0px;
}
#wizHeader li
{
float: left;
}
#wizHeader li a
{
color: white;
text-decoration: none;
padding: 10px 0 10px 55px;
background: brown; /* fallback color */
background: hsla(34,85%,35%,1);
position: relative;
display: block;
float: left;
}
#wizHeader li a:after
{
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid hsla(34,85%,35%,1);
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
#wizHeader li a:before
{
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 35px solid white;
position: absolute;
top: 50%;
margin-top: -50px;
margin-left: 1px;
left: 100%;
z-index: 1;
}
#wizHeader li:first-child a
{
padding-left: 10px;
}
#wizHeader li:last-child
{
padding-right: 18px;
}
Add a background color to #wizHeader to create the visual of a right-side border.
Specify a width value in #wizHeader to prevent it from expanding to the right of the page.
It seems to be working fine on Chrome for me (latest version)
Here are some examples of declarations to add to #wizHeader (add these to the ones currently in the CSS declaration)
#wizHeader {
background: #6699CC;
width: 960px;
}
Adding more based on comment...
The reason the arrows are being bumped down is because the 's are block elements, floated left, so they'll flow to fit whatever width they have available and drop down onto the next line when they run out.
If you want to cut off the last arrow, you'll have better luck by targeting the that wraps the last . This worked for me, editing in Chrome's Inspector:
#wizHeader li:last-child {
width: 172px; /* you might have to tweak this a bit*/
overflow: hidden;
padding-right: 0;
}
Then, change the width of the #wizHeader accordingly. 930px wide seemed to do the trick with the above snippet.
I am using the nice style of the wizard mentioned in this blog
but unfortunately it does not work well in the IE, because as mentioned in the blog:
For browsers that don’t support :after/:before/ nth-child, the code will not work.
So is there any way to fix this problem to make work well in the IE browser.
FYI, the CSS is:
#wizHeader li .prevStep
{
background-color: #669966;
}
#wizHeader li .prevStep:after
{
border-left-color:#669966 !important;
}
#wizHeader li .currentStep
{
background-color: #C36615;
}
#wizHeader li .currentStep:after
{
border-left-color: #C36615 !important;
}
#wizHeader li .nextStep
{
background-color:#C2C2C2;
}
#wizHeader li .nextStep:after
{
border-left-color:#C2C2C2 !important;
}
#wizHeader
{
list-style: none;
overflow: hidden;
font: 18px Helvetica, Arial, Sans-Serif;
margin: 0px;
padding: 0px;
}
#wizHeader li
{
float: left;
}
#wizHeader li a
{
color: white;
text-decoration: none;
padding: 10px 0 10px 55px;
background: brown; /* fallback color */
background: hsla(34,85%,35%,1);
position: relative;
display: block;
float: left;
}
#wizHeader li a:after
{
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
border-bottom: 50px solid transparent;
border-left: 30px solid hsla(34,85%,35%,1);
position: absolute;
top: 50%;
margin-top: -50px;
left: 100%;
z-index: 2;
}
#wizHeader li a:before
{
content: " ";
display: block;
width: 0;
height: 0;
border-top: 50px solid transparent;
border-bottom: 50px solid transparent;
border-left: 30px solid white;
position: absolute;
top: 50%;
margin-top: -50px;
margin-left: 1px;
left: 100%;
z-index: 1;
}
#wizHeader li:first-child a
{
padding-left: 10px;
}
#wizHeader li:last-child
{
padding-right: 50px;
}
#wizHeader li a:hover
{
background: #FE9400;
}
#wizHeader li a:hover:after
{
border-left-color: #FE9400 !important;
}
.content
{
height:150px;
padding-top:75px;
text-align:center;
background-color:#F9F9F9;
font-size:48px;
}
The before and after css elements should work in ie8 and up.
For IE7 you can use something like Use the IE7.js hack to add after & before pseudo element support.
I would recommend using a conditional statement to include the file such as;
<!--[if IE 7]>
insert script here
<![endif]-->
For IE6, I personally would not bother and just degrade gracefully.
Another option is to use ie-css3.js.