Twitter Bootstrap - nav bar issues in internet explorer - css

I am using Twitter Bootstrap in my rails app. My navbar looks perfect in Firefox / Chrome / Safari (tested chrome on both a Mac & PC). In Internet Explorer, it looks ugly! Wrong colours & everything.
Any help you can provide would be appreciated. I can post whatever code would help.
Update
Here is all of the CSS where I override anything from bootstrap (brought into my app via sass-rails gem). Hopefully it pushes us in the right direction.
Note: Where I have color:#F8F8F8; below, I used to have #333. This is just one iteration of me trying to fix it. I've even tried changing the background color to #333334 as I think that my precompiler was changing #333333 to #333 (don't know for sure though)
/* Styling */
.navbar, .navbar-inner, .navbar-fixed-top, .container, #tabs .nav {
border:none;
background-image:none;
}
.navbar {
font-size:14px;
text-shadow:none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
.nav {
float:right;
}
.brand {
margin-left:30px;
color:#333334;
font-family: Georgia, serif
}
.navbar-inner {
background-color: #F8F8F8;
border-bottom-color: #E0E0E0;
border-bottom-style: solid;
border-bottom-width: 1px;
color: #333334;
}
}
.navbar .nav > li > a {
text-shadow:none;
color:#555555;
background-color: transparent;
cursor:pointer;
&:hover {
color:#E6E6E6;
}
}
.navbar .nav .active > a, .navbar .nav .active > a:hover {
background-color: transparent;
color: #555555;
}
.navbar .nav .inactive > a:hover {
color:#999999;
}
.navbar .nav > li > a.sign-in {
color:#555555;
padding-top:4px;
padding-bottom:4px;
margin-top:5px;
margin-left:30px;
}
.navbar .nav > li > a.sign-in:hover {
background-position: 0 0px;
}
.navbar .nav > li > a.active-button {
background-color: #E6E6E6;
background-image: none;
border:1px solid #cccccc;
border-radius:4px;
box-shadow: none;
cursor: pointer;
opacity: 0.6499999761581421;
outline-color: #555555;
outline-style: none;
outline-width: 0px;
text-decoration: none;
text-shadow: none;
padding-top:4px;
padding-bottom:4px;
margin-top:5px;
}
I have also tried the following (in an attempt to explicitly override anything to do with gradients from Bootstrap):
body {
color:#333334;
}
.navbar-inner {
background-image: -moz-linear-gradient(top, #F8F8F8, #F8F8F8);
background-image: -ms-linear-gradient(top, #F8F8F8, #F8F8F8);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#F8F8F8), to(#F8F8F8));
background-image: -webkit-linear-gradient(top, #F8F8F8, #F8F8F8);
background-image: -o-linear-gradient(top, #F8F8F8, #F8F8F8);
background-image: linear-gradient(top, #F8F8F8, #F8F8F8);
}
.btn-navbar {
background-image: -moz-linear-gradient(top, #F8F8F8, #F8F8F8);
background-image: -ms-linear-gradient(top, #F8F8F8, #F8F8F8);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#F8F8F8), to(#F8F8F8));
background-image: -webkit-linear-gradient(top, #F8F8F8, #F8F8F8);
background-image: -o-linear-gradient(top, #F8F8F8, #F8F8F8);
background-image: linear-gradient(top, #F8F8F8, #F8F8F8);
}
Yet another update
Fiddling around with the internet explorer developer tools leads me to believe the issue is this:
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF333333',endColorstr='#F2222222', GradientType=0)
What is this? Do I need it? (Why does it not use the same gradients as firefox/chrome?) It comes from Bootstrap... I can try to override the colours in there because for whatever reason IE is interpreting FF333333 as that dark blue.

Turns out I was able to fix this by over-riding the default filter code generated by Bootstrap. Big thanks for Nathan and Andres! To override the code I had posted above, I added the following :
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#F8F8F8', endColorstr='#F8F8F8', GradientType=0)
Hope this saves some pain for somebody....

Andres Ilich commented on the OP:
"Try filter:none on your navbar (totally forgot about that), IE uses a
separate syntax to generate gradients. background-image is still not
supported by IE9 to create gradients."
After developing very painful forehead from smacking it numerous times on the desk, this is exactly what fixed the issue for me. Thanks Andres.

This happened to me too. But I found out that in CSS gradients, IE (even 9) doesn't seem to except just 3-character HEX codes. So you need to change the hex codes to 3-character instead if they aren't already (such as #CCC to #CCCCCC) so it'll work correctly in IE (only for the IE gradient CSS, not all of them).
If you could post your CSS I could see if there are any other problems. But, my problem was that #CCC was being interpreted as dark blue in IE.

From what i can tell you're using a solid color for your background in the top navbar, so you're only adding a background-color but not removing the background-image as well, so try to reset that too like so:
.navbar-inner {
background-color: #F8F8F8;
background-image:none;
border-bottom-color: #E0E0E0;
border-bottom-style: solid;
border-bottom-width: 1px;
color: #333334;
}

Internet Explorer is quite good at messing things up what I normally do is use a separate style sheet to fix up explore without messing up the rest of my site. Paste this line of code in your web pages:
<!--[if IE]>
<link rel="stylesheet" href="styles/fix_internet_explore.css">
<![endif]-->
and modify the css to make look better on explorer, and the good part is other browsers will ignore this style sheet.

This is much more simple:
.dropdown-menu>li>a:hover,
.dropdown-menu>li>a:focus,
.dropdown-submenu:hover>a,
.dropdown-submenu:focus>a,
.dropdown-menu>li.active>a
{
filter: none;
}

Related

How to disable this CSS code on Ipad and Mobile Breakpoint?

I have a css code that I am using on my website, its working perfectly on desktop but I want to disable this on mobile and ipad devices. How can I do that?
.sub-menu > li > a {
color: #242424 !important;
background: #ffffff !important;
border: #333333 !important;
}
.sub-menu > li:hover > a {
color: #ffffff !important;
font-weight: bold !important;
background: #004f94 !important;
border: #004f94 !important;
}
Good day,
in order to disable the setting for mobile only, you need to set the #media rule. It creates a container for css attributes that are only applied when fitting the specified criteria. Non specified criteria are inherited. If you want to read more about css rules, you can do this in the link below:
https://www.w3schools.com/css/css_rwd_mediaqueries.asp
.sub-menu > li > a {
color: #242424 !important;
background: #ffffff !important;
border: #333333 !important;
#media screen and (min-width: 420px){
.sub-menu > li > a {
color: #ffffff;
background: #ffffff;
border: #333333;
}
}

Transparent bootstrap dropdown menu

I'm trying to make a Bootstrap menu like this one https://makr.com/
I´m doing ok, but I haven't figured out how I can make it completely transparent one hover.
As you can see in the fiddle below there is always some shade of grey in the dropdown when I hover.
I really don´t know what more I can do... I've been googling and searching for a solution all yesterday and this morning and I'm really stuck now.
can anyone take a look at the fiddle and advise me, it would be very much appreciated
The only colour that should be in the menu is the
.navbar-default {
background-color: transparent; border-color: transparent;
}
.navbar-default :hover {
background-color: rgba(248, 248, 248, .7); border-color: rgba(231, 231, 231, .7)
{
on hover
https://jsfiddle.net/dadihall/5zzcq2t5/22/
thanks in advance
Dadi
Try this:
.navbar:hover {
background: rgba(248, 248, 248, 0.7) none repeat scroll 0 0 !important;
}
.navbar-default *:hover{
background:transparent !important;
}
see fiddle.
Hi there please try the following css
.dropdown.full-width {
width : 120px;
background-image: transparent;
background-color: transparent;
}
.full-width.dropdown > .dropdown-menu > li > a {
white-space: normal;
background-image: transparent;
background-color: rgba(255,255,255,0.5); //or any level of transparency
}
.full-width.dropdown > .dropdown-menu > li > a:hover {
background-color: rgba(255,255,255,0.5); //or any level of transparency
}

CSS not working on Chrome but works on Firefox and IE

http://foodstylingmentor.com
This is a WordPress website. You can see the child menu item under the ABOUT ME menu item. Firefox and IE are following the CSS but Chrome don't follow. I have cleared cache and history on all browsers.
#media screen and (min-width: 600px) {
.main-navigation li ul li a:hover {
background: #efefef !important;
color: #7b0309 !important;
}
}
I also tried removing the #media etc. But still not working.
I already searched and tried to find solutions. But failed. So if anybody can help me, please do so.
This is happening because you have the background set as background: #efefef;
In the .main-navigation li ul li a class add:
background: -webkit-linear-gradient(#f7eabf, #936d28, #f7eabf, #000000);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
and the text should display like the parent text. Adding the above will cause a grey(ish) colour to appear because of this:
.main-navigation li ul li a:hover
{
background: #efefef !important;
color: #7b0309 !important;
}

vertical navigation working not correctly in IE

Really getting some unwanted behaviour from IE7 and IE8 on header and fotter vertical menu. Did this before without problem but while using Wordpress it's just not getting it right.
Here is the test site: http://examples.iamwebsitedeveloper.com/walkinmyshoes/
And here is the code used for #headerNav:
#headerNav {
display:block;
float: left;
margin: 0 auto;
width: 940px;
position: relative;
z-index:99999;
font: Verdana, sans-serif;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: #894ba6;
background: -moz-linear-gradient(top, #894ba6 0%, #743a8f 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#894ba6), color-stop(100%,#743a8f));
background: -webkit-linear-gradient(top, #894ba6 0%,#743a8f 100%);
background: -o-linear-gradient(top, #894ba6 0%,#743a8f 100%);
background: -ms-linear-gradient(top, #894ba6 0%,#743a8f 100%);
background: linear-gradient(top, #894ba6 0%,#743a8f 100%);
margin-bottom:20px;
behaviour:url(PIE.htc);
}
.ie7 #headerNav,.ie8 #headerNav{*display: block;*zoom:1;}
#headerNav ul{
font-size: 1.077em;
list-style:none;
margin:0;
padding:0px;
}
#headerNav li {
float: left;
position: relative;
border-right:1px solid #8B4DA7;
}
Moreover if you look at the footer segment the background color and block is not coming! Moreover the footer navigation is behaving the same way!
Using IE conditional classes as well as css3pie, I can't get it working properly.
Evan Vai,
Strange problem when i opening the debugger and closing it the css comes back. Its may be the execution of jQuery.

Button shine/glow with CSS3

I have a navigation menu that I'm trying to recreate using only CSS3 and HTML. The design calls for a shine/glow on the currently selected menu button as per the "home" button on the attached pic. Is that effect possible using just code or will I need to use the glow image?!
Notice the shine and white line is most visible towards the center of the button and then fades towards the edges.
CSS3's radial gradients let you achieve a similar effect, although using a CSS background image may be easier for pixel-perfect adjustments. Specifically, CSS3's gradients are linear, even the radial ones.
I've constructed a small example using Firefox's radial gradients (support for Webkit will require quite different code): http://jsfiddle.net/rxMf6/
HTML:
<div class="highlighted-button">
<div class="highlight"></div>
Button
</div>
CSS:
.highlighted-button {
background: #000;
color: #fff;
font: bold 0.8em Arial, sans-serif;
padding-bottom: 0.9em;
text-align: center;
text-transform: uppercase;
width: 8em;
}
.highlight {
background: -moz-radial-gradient(center top, ellipse farthest-side,
#fff 0%, #000 100%);
height: 0.5em;
margin-bottom: 0.4em;
}
yes,that's shine is possible in css3.You adjust gradient as per your requirement.you us filter for IE.
i hope this example help's you.
.menu {
float: left;
margin: 10px 10px 10px 0;
background: #000;
width: 700px;
}
.menu ul {
margin: 15px 0 15px 5px;
}
.menu ul li {
display: inline;
list-style: none;
font-size: 12px;
font-family: arial;
color: #fff;
font-weight: normal;
}
.menu ul li:before {
display: inline;
content: "/";
}
.menu ul li:first-child:before {
content: " ";
height:45px;
}
.menu ul li a {
margin: 0 15px 0 15px;
color: #fff;
text-decoration: none;
padding:17px 30px 16px 30px;;
}
.menu ul li a:hover {
border-top:1px solid rgba(255, 255, 255, 0.4);
text-decoration: underline;
color: #fff;
padding:17px 30px 16px 30px;
background: -moz-radial-gradient(center -5px 45deg, ellipse farthest-corner, rgb(255, 255, 255)0%, rgba(0, 0, 0, 0.2)70%) repeat #000;
background: -webkit-gradient(radial, 50% 0, 0, 50% 0,50, from(rgba(255, 255, 255, 0.9)), to(#000));
}
<nav>
<div class="menu">
<ul>
<li>HOME</li>
<li>WHAT IS THIS?</li>
<li>SWEAR DICTIONARY</li>
</ul>
</div>
</nav>
Here is a similar CSS3 gradient. You can change the colors and get your desired look. I don't know if it is exactly like what you wanted though. It doesn't do a rounded look just a straight gradient.
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.32, rgb(14,15,14)),
color-stop(0.7, rgb(0,0,0)),
color-stop(0.85, rgb(201,201,201))
);
background-image: -moz-linear-gradient(
center bottom,
rgb(14,15,14) 32%,
rgb(0,0,0) 70%,
rgb(201,201,201) 85%
);
You will need an image. There is really no way to achieve this effect with just code. Though most browsers can be handled with the use of CSS3 box-shadow or gradients, Internet Explorer 8, and partially IE 9 will have issues. To give proper cross-browsers support, you will have to use images to achieve the desired effect.
The reason I say you will need an image is very well may have to include additional markup and hacky workarounds to achieve the effect. This is not desirable and could cause conflicts in trying to implement the CSS3 version as well.

Resources