IE offset nav issue - html

Across all browsers my navigation displays fine such as chrome, firefox, opera, safari.
But for some reason ie refuses to display correctly, and what makes it more frustrating is the fact it is literally 1px.
Which usually wouldn't bother me but it's in a place where it's obvious:
ie:
every other browser:
The code I'm using seems fine but here it is:
nav {
font-family: "Myriad Pro", Arial, sans-serif;
width: 280px;
height: 40px;
float: right;
font-size: 14px;
list-style: none;
clear: both;
position: relative;
top: 11px;
}
nav ul {
float: right;
margin: 0;
height: 40px;
width:240px
}
nav li {
display: inline;
}
nav li a {
color: #3BB9FF;
border-bottom: none;
padding: 12px 10px 11px 10px;
margin-left: -3px;
}
nav li a:hover{
color: #3BB9FF;
background-color: rgba(0, 0, 0, 0.3);
}
/********
Shows which page is selected
*/
nav li.selected {
display: inline;
}
nav li a.selected {
color: #3BB9FF;
background-color: rgba(200, 200, 200, 0.3);
border-top: 3px solid #fff;
}
I'm using the ie html5 shim from google trunk also.
Any simple fixes for this issue? I know it's not a big deal, it's just frustrating.

The CSS code on the menu is a bit weird. I think that's why IE is acting up.
Try the following adjustments:
nav li {
//display: inline;
float:left;
}
nav li a {
color: #3BB9FF;
border-bottom: none;
//padding: 12px 10px 11px 10px;
//margin-left: -3px;
display:block;
padding:10px;
}
Also check that the menu's width in IE is not enough.

Related

Navigation bar destroyed when adding a code for divs into CSS

Well, I had a perfect menu with this code, just about right with this code in my css file
ul.Menu {
list-style-type: none;
margin: 10px;
overflow: hidden;
background-color: #ffffff;
border-style: solid;
border-color: #e9055c;
border-width: 2px;
font-weight: bold;
font-family: arial, sans-serif;
text-align: center;
margin: 0 auto;
}
ul.Menu li{
border-right: 1px solid #e9055c;
display: inline-block;
}
ul.Menu li a {
display:block;
color: #e9055c;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
ul.Menu li a:hover {
background-color: #f6b0ce;
}
ul.Menu li:last-child {
border-right: none;
}
but then I added this to my CSS-code to create a responsive banner via divs at the top of my website:
.wrapper {
width: 100%;
overflow: hidden;
}
.container {
width: 100%;
margin: 0 auto;
}
.banner-img {
width: 100%;
}
and now my menu looks like this- totally crappy with too much space above the menu items...
I already found out, that it changes, when I'm changing the padding settings on the ul.Menu li a, but I can't get it right with just those...
Can you please help me? :)
You've written the margin property twice. Delete the margin : 0px style from ul.Menu, it is causing the problem.

Navigation incompatible for IE 8

I don't know why this not working properly on ie8.
<div id="bluemenu" class="bluetabs">
<ul>
<li class="">
<a rel="dropmenu3_c" href="company/">Company
<span><img width="11"height="7" src="images/arrow_btn.png"></span>
</a>
</li>
</ul>
</div>
This is the css for the navigation ul
.bluetabs ul {
color: #FFFFFF;
float: right;
font: 13px 'Open Sans','Lucida Grande',Arial,"Verdana sans-serif";
list-style-type: none;
margin: 0;
padding: 0;
text-align: left;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.75);
text-transform: uppercase;
}
This is the css for the navigation li
.bluetabs li {
display: inline;
float: left;
height: 36px;
margin: 0;
padding: 0;
}
This is the css for the navigation li a
.bluetabs li a {
background: url("../images/menu_nav_hover_bg.png") repeat-x scroll 0 0 rgba(0, 0, 0, 0);
color: #FFFFFF;
margin: 0;
padding: 5px 15px;
text-decoration: none;
}
Any CSS hacks that I can make this work on IE 8?
I can kind of reproduce this locally, but not entirely.
Gonna take a shot in the dark...
Try:
.bluetabs li a {
background: #ccc;
color: #FFFFFF;
margin: 0;
padding: 5px 15px;
text-decoration: none;
display: inline-block; /* Add this */
}
/* Add this */
.bluetabs li a > span {
display: inline-block;
}

overflow: scroll affecting drop down menu on iOS

I'm currently building a website using only HTML/CSS3. It displays perfectly on all desktop browsers but not in mobile Safari (which is crucial). The site is currently under construction here: test.scccjapan.com and the problem is with the drop down navigation menu ("blackboard - grammar - verbs" list).
The list is particularly long, but when scrolling down the page to get to the bottom of the list, the menu closes making it impossible to click on any of the links.
After a lot of trial and error, I seem to have narrowed the problem down to the overflow:scroll attribute. If I delete this attribute from the CSS, the menu works perfectly fine, HOWEVER, I also have a fixed background image and deleting the overflow turns the background image from a fixed state into something more like a scroll which is also not what I'm looking for. It seems I can either have:
(a) a fully-functioning menu and a scrolling (static) background or
(b) a fixed background and a "broken" menu.
Short of redesigning this section of my site to cater for this issue, can anyone help!? I don't know Java and a relative noob when it comes to coding so specific information would be useful. I've also scoured the internet for answers and tried anything I could find but to no avail.
Thanks in advance! :)
Here's my CSS (let me know if you need something more):
html {
background: url(Backgrounds/Totoro.png);
background-position: bottom right;
background-repeat: no-repeat;
background-size: 40%;
background-attachment: fixed;
background-color: #666;
height: 100%;
overflow: hidden;
}
body {
height: 100%;
-webkit-overflow-scrolling: touch;
min-width: 900px;
max-width: 100%;
position: relative;
overflow-x: hidden;
overflow-y: scroll;
}
#Menu {
text-align: center;
white-space: normal;
font-size: 15px;
font-weight: bold;
}
/* Main Menu */
#Menu nav ul {
padding: 0 10px;
border-radius: 10px;
list-style: none;
position: relative;
display: inline-table;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, sans-serif;
text-align: left;
text-shadow: 0px 1px 1px #fff;
z-index: 99;
-webkit-transform: translateZ(0);
}
#Menu nav img {
height: 65px;
width: 65px;
}
#Menu nav ul li a:hover {
color: #4ed1fe;
background: #bfbebe;
}
#Menu nav ul:after {
content: "";
clear: both;
display: block;
}
#Menu nav ul li {
float: left;
}
#Menu nav ul li:hover {
background-color: #383838;
box-shadow: inset 0px 0px 2px 2px #535353;
}
#Menu nav ul li a {
display: block;
padding: 10px 6px;
color: #262626;
text-decoration: none;
}
#Menu nav ul li:hover a {
cursor: pointer;
color: #fff;
text-outline: #000;
text-shadow: 2px 0px 5px #000;
}
/* Year Levels */
#Menu nav ul ul {
background: #5d5d5d;
border-radius: 1px;
position: absolute;
top: 100%;
-moz-border-radius-bottomleft: 5px;
-moz-border-radius-bottomright: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
border-bottom: #9ca7b5 1px solid;
display: none;
box-shadow: 2px 0px 5px #000;
}
#Menu nav ul ul li {
float: none;
position: relative;
}
#Menu nav ul ul li a {
padding: 10px 80px 10px 10px;
color: #fff;
border-top: #fff 0px inset;
}
#Menu nav ul ul li a:hover {
color: #0CF;
background: #bfbebe;
}
#Menu nav ul li:hover > ul {
display: block;
}
/* Terms */
#Menu nav ul ul ul {
position: absolute;
left: 90%;
box-shadow: 0px -3px 100px #000;
top: 10px;
white-space: nowrap;
}

CSS dropdown menu not working on IE and Chrome

I have a dropdown menu and it's not working with Internet Explorer 10 (and compatibility mode) and Chrome. It does however work with Firefox (latest).
CSS:
#menu_items
{ float: left;
width: 600px;
}
#menu
{ margin:0;
float: left;
}
#menu li
{
padding: 0 0 0 0px;
list-style: none;
margin: 2px 0 0 0;
display: inline;
background: transparent;
}
#menu li a{
float: left;
font: bold 120% Arial, Helvetica, sans-serif;
text-align: center;
color: #FFF;
text-decoration: none;
height: 24px;
text-shadow: 0px 1px 0px #000;
padding: 16px 0px 10px 40px;
background: transparent;
}
#menu li ul li a {
float: left;
font: bold 90% Arial, Helvetica, sans-serif;
text-align: center;
color: #FFF;
text-decoration: none;
height: 24px;
text-shadow: 0px 1px 0px #000;
padding: 16px 0px 10px 40px;
background: transparent;
}
#menu li:hover ul {
display: flex;
float:inherit;
text-shadow: 0px 1px 0px #000;
padding: 1px 40px 0px 0px;
background: #669CD8;
background: -moz-linear-gradient(#90B9E2, #4B75AF);
background: -o-linear-gradient(#90B9E2, #4B75AF);
background: -webkit-linear-gradient(#90B9E2, #4B75AF);
margin: 50px 0px 0px 0px;
border-style:solid;
border-width:1px;
z-index: 2;
}
#menu li ul {
display: none;
position: absolute;
}
#menu li.current a, ul#menu li:hover a
{
color: #FFF;
text-decoration: underline;
}
HTML:
<div id="menu_items">
<ul id="menu">
<li class="current">Home</li>
<li>Werkwijze</li>
<li>Producten
<ul>
<li>Klimaat</li>
<li>Voerbakken</li>
<li>Voerinstallatie</li>
<li>Kraamhokken</li>
<li>Boxen</li>
<li>Biggen hokken</li>
<li>Roosters</li>
<li>Silo's</li>
</ul>
</li>
<li>Contact</li>
</ul>
</div>
In the rules for #menu li:hover ul, use display: block; instead of display: flex;. (See demo at http://jsfiddle.net/8LaLa/1/.)
display: flex isn't supported by all browsers - see https://developer.mozilla.org/en-US/docs/Web/CSS/display#Browser_compatibility.
Your menu may not be clearing properly. You have a lot of floated elements and that can cause errors with your rendering. When you float an element you are taking that element "out of flow". Basically the element will disregard its position in the DOM and try to slide to the side you set in your float. If all child elements inside of a wrapper are floated the parent no longer knows how tall it should be (since all the elements are out of flow) and it sets itself to 0px height or to the height of the tallest in-flow element. To fix this you need a clearfix. This will tell the browser to make the container clear its children. Hopefully this fixes your issue!

How do I fix ie 6 hover?

This is my code for my menu:
/*Menu*/
#menu {
text-align: right;
margin-left: auto;
margin-right: auto;
height: 50px;
position: relative;
z-index: 5;
font-size: 0.75em;
}
#menu ul {
margin: 0;
padding: 10px 5px 5px 5px;
list-style: none;
line-height: normal;
border: 0px solid #03426A;
-moz-border-radius: 6px;
background: #F3F4FF;
position:relative;
width: auto;
float:right;
}
#menu ul li {
float: left;
}
#menu li ul {
display: none;
}
#menu ul li a {
display: block;
text-decoration: none;
color: #000;
display: block;
padding: 0px 15px 5px 15px;
text-decoration: none;
text-align: center;
font-size: 1em;
font-weight: normal;
border: none;
}
#menu ul li a:hover {
color: #0A67A3;
}
#menu li:hover ul {
display: block;
position: absolute;
}
#menu li:hover li {
float: none;
font-size: 0.9em;
}
#menu li:hover a { color: #0A67A3; }
#menu li:hover li a:hover { color: #000; }
/*End Menu*/
I have tried 2 tutorials however have not found a way of making the menu work in ie 5.5 or 6. How can I fix this?
IE6 doesn't support :hover pseudoclass on elements other than anchor tags. Son of Suckerfish has a solution that may work for you: http://www.htmldog.com/articles/suckerfish/dropdowns/
IE 5.5? Really... Wow I feel sorry for you if you need to still be compatible that far...Legacy corporate app I suppose? Damn!!
IE6 only understands :hover for <a> elements that's for sure. But you can try the solution given here that uses a htc file to create a new css behavior: http://www.xs4all.nl/~peterned/csshover.html