I'm trying to find a workaround (without using JS) for the firefox bug which doesn't allow to style Firefox dropdown arrow in select elements. Some people say it could be done by putting a select element in a container and setting the container's width to be smaller than the select's. Somehow it just doesn't work for me, even when I set the select element's width to 100000px (the arrow is still there on the max. right position).
http://jsfiddle.net/qQ829/ here is the jsFiddle
CSS:
#nav {
background: url("http://cdn.bavotasan.com/wp-content/uploads/2011/05/down_arrow_select.jpg") no-repeat scroll right center #DDDDDD;
border: 1px solid #CCCCCC;
height: 34px;
overflow: hidden;
max-width: 800px;
border-radius: 12px;
-moz-border-radius: 12px;
-webkit-border-radius: 12px;
border: 1px solid #1C2149;
background: #a7cfdf; /* Old browsers */
background: -moz-linear-gradient(top, #a7cfdf 0%, #1a80b6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#a7cfdf), color-stop(100%,#1a80b6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #a7cfdf 0%,#1a80b6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #a7cfdf 0%,#1a80b6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #a7cfdf 0%,#1a80b6 100%); /* IE10+ */
background: linear-gradient(to bottom, #a7cfdf 0%,#1a80b6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a7cfdf', endColorstr='#1a80b6',GradientType=0 ); /* IE6-9 */
}
#nav select {
background: transparent;
width: 830px!important;
padding: 5px;
font-size: 16px;
line-height: 1;
border: 0;
border-radius: 0;
height: 34px;
-webkit-appearance: none;
-moz-appearance: none;
color: white;
font-family: "Open Sans",Arial,Helvetica,sans-serif !important;
}
// EDIT
Additional HTML code:
<nav class="nav-holder" id="nav">
<select>
<option selected="selected" value="">Go to...</option>
</select>
</nav>
add overflow to you css.
#nav select {
background: transparent;
/*width: 830px!important;*/
width:110%;
overflow:hidden;
padding: 5px;
font-size: 16px;
line-height: 1;
border: 0;
border-radius: 0;
height: 34px;
-webkit-appearance: none;
-moz-appearance: none;
color: white;
font-family: "Open Sans",Arial,Helvetica,sans-serif !important;
}
and set the width to 110% as well otherwise you have that long bar
Try with -moz-appearance: window; . It removes all the style of the select (borders and arrow).
You can see it in action here.
Edit: Only for Mac, not for WinXP.
Forget the container, this is how to hide the select arrow on Firefox:
select {
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
}
Live example: http://jsfiddle.net/joaocunha/RUEbp/1/
Whole explanation (worth checking): https://gist.github.com/joaocunha/6273016
Related
In internet explorer we get a strraight line.in chrome we get distorted lines and rest of all the browsers have the desired case.which is shown by first image. Kindly tell some code to achieve this as i need it very badly. here is the code:
ul#tabs li a {
color: #a09b95;
padding: 6px 15px 7px 15px;
padding: 6px 15px 5px 15px\9; /* IE-only fix */
text-decoration: none;
display: block;
border-bottom: 1px solid #c9c3ba;
border-right: 1px solid #c9c3ba;
/* background-color: #ffffff; */
background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#f3efeb)); /* Saf4+, Chrome */
background: -webkit-linear-gradient(top, #ffffff, #f3efeb); /* Chrome 10+, Saf5.1+, iOS 5+ */
background: -moz-linear-gradient(top, #ffffff, #f3efeb); /* FF3.6+ */
background: -ms-linear-gradient(#FFFFFF, #F3EFEB); /* IE 8 */
background: -o-linear-gradient(top, #ffffff, #f3efeb); /* Opera 11.10+ */
background: linear-gradient(to bottom, #ffffff, #f3efeb); /* IE9+ */
-pie-background: linear-gradient(#FFFFFF, #F3EFEB); /* IE 6-7 via CSS3Pie */
behavior: url("http://ocw5.mit.edu/styles/pie/PIE.php");
}
ul#tabs li a.selected {
color: #b30838;
border-bottom: 1px solid #fff;
background-color: #fff;
background: none;
-pie-background: none;
behavior: url("http://ocw5.mit.edu/styles/pie/PIE.php");
}
/* Chrome/Safari-only CHP tab border fix */
#media screen and (-webkit-min-device-pixel-ratio:0) {
ul#tabs {
margin: 19px 0 -1px 0;
outline: 0;
}
}
Try this:
ul#tabs li {margin-bottom: -1px;}
http://www.pcdconsultancy.co.uk/
Im having trouble with my menu. It appears to have at least a couple of pixels bigger on Firefox than IE or chrome, can someone advise me what the appears to be? ive tried to tweak it but it seems to still be out.
My menu css is :
#headermenu { margin-top: 9px; margin-left: 80px;}
#headermenu ul {background: #efefef;
padding: 0px;
margin: 0;
list-style: none;
display: inline-table;
}
#headermenu ul li {
float: left;
background: -moz-linear-gradient(top, #999999 0%, #3a3a3a 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#999999), color-stop(100%,#3a3a3a)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #999999 0%,#3a3a3a 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #999999 0%,#3a3a3a 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #999999 0%,#3a3a3a 100%); /* IE10+ */
background: linear-gradient(to bottom, #999999 0%,#3a3a3a 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#999999', endColorstr='#3a3a3a',GradientType=0 ); /* IE6-9 */
border-left: 1px solid #666666;
border-right: 1px solid #000;
border-top: 1px solid #999999;
border-bottom: 1px solid #999999;
}
#headermenu ul li:hover {}
#headermenu ul li a {display: block; color: #fff; text-decoration: none;font: 15px Arial; padding: 7px 20px; /* Old browsers */}
If you add a line-height declaration to the #headermenu ul li a element, that should fix the issue. See code below:
#headermenu ul li a {line-height: 15px;}
I guarantee that will fix your issue.
Thank you!
I am currently adding a navigation bar to a web page. But I am running into some css styling issues. The navigation menu bar is pushing the content below, leaving a huge gap in between and making it uneven. I took the precaution in leaving out anything that will mess with the bottom like margin bottom-padding but I am still getting the same result. How can I get the menu bar to not affect the content below? EXAMPLE
With the Navigation bar added:
Without navigation bar the contents below are even:
I have added the specific css rules that are causing the issue to devgrow.css:
<style>
#navigation {
position:relative;
top:-45px;
left:450px;
}
#au_title {
color: #FC821D;
font-size: 120%;
font-weight: bold;
left: 515px;
letter-spacing: 2px;
position: relative;
text-transform: uppercase;
top: -105px;
}
#searchInput {
left: 700px;
position: relative;
top: -180px;
}
#contentNav { color: #cfdae3; }
/* Dark Button CSS */
.buttonNav {
outline: 0;
padding: 5px 12px;
display: block;
color: #EBEBEB;
font-weight: bold;
text-shadow: 1px 1px #1f272b;
border: 1px solid #1c252b;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background: #232B30; /* old browsers */
background: -moz-linear-gradient(top, #3D4850 3%, #313d45 4%, #232B30 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#3D4850), color-stop(4%,#313d45), color-stop(100%,#232B30)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3D4850', endColorstr='#232B30',GradientType=0 ); /* ie */
box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* CSS3 */
-moz-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Firefox */
-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,0.2); /* Safari, Chrome */
}
.buttonNav:hover {
color: #fff;
background: #4C5A64; /* old browsers */
background: -moz-linear-gradient(top, #4C5A64 3%, #404F5A 4%, #2E3940 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#4C5A64), color-stop(4%,#404F5A), color-stop(100%,#2E3940)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4C5A64', endColorstr='#2E3940',GradientType=0 ); /* ie */
}
.buttonNav:active {
background-position: 0 top;
position: relative;
top: 1px;
color: #fff;
padding: 6px 12px 4px;
background: #20282D; /* old browsers */
background: -moz-linear-gradient(top, #20282D 3%, #252E34 51%, #222A30 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(3%,#20282D), color-stop(51%,#252E34), color-stop(100%,#222A30)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#20282D', endColorstr='#222A30',GradientType=0 ); /* ie */
-moz-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Firefox */
-webkit-box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* Safari, Chrome */
box-shadow: 1px 1px 1px rgba(255,255,255,0.1); /* CSS3 */
}
/* Other stuff: */
.button-list { list-style: none; width: 100%; float: left; display: block; }
.button-list li { float: left; margin: 0 5px 0 0; }
.button-list li.search { padding-left: 18px; margin-left: 10px; position: relative; }
/* Search CSS: */
.search-input {
padding: 0 5px 0 22px;
border: 2px solid #DADADA;
height: 30px;
font-size: 12px;
line-height: 30px;
border-radius: 25px;
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
background: #FFF; /* old browsers */
}
.search-input:focus {outline: none;}
.search-submit {
width: 13px;
height: 13px;
border: none;
background: url(images/mag-glass.png) no-repeat;
display: block;
position: absolute;
left: 26px;
top: 10px;
text-indent: -9999em;
}
</style>
First i have say that the coding is really bad. For fixed that issue remove float from you button-list. Write like this :
.button-list {
list-style: none outside none;
overflow: hidden;
}
Hey now define overflow hidden in your css #contentArea id
as like this
#contentArea {
overflow: hidden;
}
Add style clear both in css of first content area
<div id="contentArea" style="clear:both">
I would like to know if there is any way to change the shape of a bootstrap button, to get something like this:
Any tips?
You won't get that rounded edge on the tip of the nipple of the button unless you use an image and the :after pseudo-element but you can come close to it by using css triangles. Here is short demo i made that uses some color trickery to come close to that effect:
CSS
button.btn {
position:relative;
}
button.btn:after {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 14px solid transparent;
border-bottom: 14px solid transparent;
border-right: 14px solid #e2e2e2;
position: absolute;
top: 50%;
margin-top: -14px;
right: 98%;
z-index: 2;
}
button.btn:before {
content: " ";
display: block;
width: 0;
height: 0;
border-top: 14px solid transparent;
border-bottom: 14px solid transparent;
border-right: 14px solid #A0A0A0;
position: absolute;
top: 50%;
margin-top: -14px;
right: 97%;
z-index: 1;
}
.btn-primary {
background: #e2e2e2; /* Old browsers */
background: -moz-linear-gradient(left, #e2e2e2 0%, #d1d1d1 47%, #fefefe 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,#e2e2e2), color-stop(47%,#d1d1d1), color-stop(100%,#fefefe)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, #e2e2e2 0%,#d1d1d1 47%,#fefefe 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, #e2e2e2 0%,#d1d1d1 47%,#fefefe 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, #e2e2e2 0%,#d1d1d1 47%,#fefefe 100%); /* IE10+ */
background: linear-gradient(left, #e2e2e2 0%,#d1d1d1 47%,#fefefe 100%); /* W3C */
text-shadow: 0 -1px 0 #fff;
color:#777;
border: 1px solid #A0A0A0;
}
I did not include the :hover and :active state styles so you can play around mixing some colors by using the Colorzilla gradient generator.
Here is a demo of what the button looks like:
http://jsfiddle.net/WUn26/
I have a drop down menu that's working just fine in Chrome and Safari, but when testing it in Firefox and IE, the dropdown box is longer down and therefore unreachable.
<!--produkter dropdown -->
<div id="dropmenu1" class="dropmenudiv">
RAW Frames
PROJECT 321
CAMSPORTS
FOSS
</div>
<!--medie dropdown -->
<div id="dropmenu2" class="dropmenudiv" style="width: 113px;">
TEST RIDE
HOW TO
RIDERS VIEW
</div>
.dropmenudiv{
position: absolute;
margin-top: 36px;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-left: 1px solid #333;
border-right: 1px solid #333;
border-bottom: 1px solid #333;
font-size: 12px;
font-weight: bold;
line-height: 26px;
z-index: 100;
background: -moz-linear-gradient(top, #424141, #262626); /* Mozilla */
background: -webkit-gradient(linear, left top, left bottom, from(#424141), to(#262626)); /* Chrome-Safari */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#424141', endColorstr='#262626'); /* IE */
width: 137px;
visibility: hidden;
}
.dropmenudiv a{
width: auto;
display: block;
text-indent: 5px;
padding: 2px 0;
text-decoration: none;
color: black;
padding-left: 5px;
}
* html .dropmenudiv a{ /*IE only hack*/
width: 100%;
}
.dropmenudiv a:hover{
background: -moz-linear-gradient(top, #545454, #2c2c2c); /* Mozilla */
background: -webkit-gradient(linear, left top, left bottom, from(#545454), to(#2c2c2c)); /* Chrome-Safari */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#545454', endColorstr='#2c2c2c'); /* IE */
}
I have read a lot around the net and can see that a lot of other people have similar problems with Firefox not showing the div the same place as in Chrome and other browsers.
The attribute position:absolute causes this issue. Try this code instead what you have used.
http://jsfiddle.net/AAgfF/2/