Bootstrap : prevent "nav-tabs nav-justified" from stacking on small screen - css

I'm using Twitter Bootstrap 3 and I have a sidebar and tabs in it.
<div class="col-md-4">
<div class="side-posts">
<ul class="nav nav-tabs nav-justified">
<li class=""><span data-icon=""></span> Recent</li>
<li class="active"><span data-icon=""></span> Popular</li>
</ul>
<div class="tab-content">
.....
</div>
</div>
</div>
When screen's width gets smaller the tabs stack on each other like this
Is it possible to keep the original look and prevent this change?

I had to write my own tabs style to get it work.
Here is a live bootply
in case link got broken here is the css:
/* CSS used here will be applied after bootstrap.css */
body{
background-color: #f2f2f2;
}
.container{
width: 325px;
}
.side-posts{
margin-top:15px;
}
.post-tabs{
padding:0;
margin-bottom:0;
list-style-type: none;
overflow: hidden;
}
.post-tabs li{
display: inline;
}
.post-tabs a{
display: block;
z-index: 1;
text-decoration: none;
padding: 10px 15px;
float: left;
width: 50%;
text-align:center;
border-bottom: 1px solid #dddddd;
text-shadow: 1px 1px 0 white;
transition:color 0.3s ease;
background: rgba(255,255,255,1);
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(246,246,246,1) 47%, rgba(237,237,237,1) 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(255,255,255,1)), color-stop(47%, rgba(246,246,246,1)), color-stop(100%, rgba(237,237,237,1)));
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(246,246,246,1) 47%, rgba(237,237,237,1) 100%);
background: -o-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(246,246,246,1) 47%, rgba(237,237,237,1) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(246,246,246,1) 47%, rgba(237,237,237,1) 100%);
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(246,246,246,1) 47%, rgba(237,237,237,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed', GradientType=0 );
color:#3b5998;
}
.post-tabs a:hover{
color:#e95c40;
}
.post-tabs li.active a{
border-bottom: 0;
color: #444444;
z-index: 2;
}
.post-tabs li.active:first-child a {
border-right: 1px solid #dddddd;
box-shadow: inset -3px 0px 3px 0px rgba(0,0,0,0.4);
}
.post-tabs li.active:last-child a{
border-left: 1px solid #dddddd;
box-shadow: inset 3px 0px 3px 0px rgba(0,0,0,0.4);
}
.tab-content{
height:400px;
background-color: #dddddd;
}

You can add float:left; and remove float:none; editing the mobile media query inside bootstrap like:
#media (min-width: 768px){
.nav-tabs.nav-justified > li {
float: none;
}
}
#media (max-width: 768px){
.nav-tabs.nav-justified > li {
float: left;
}
}
DEMO http://jsfiddle.net/a_incarnati/52VtD/7771/

This worked perfectly for me, even keeps the default styling for bootstrap justified nav-bar.**
#media (max-width: 768px){
.nav-justified > li {
display: table-cell;
width: 1%;
}
.nav-justified > li > a {
border-bottom: 1px solid #ddd !important;
border-radius: 4px 4px 0 0 !important;
margin-bottom: 0 !important;
}
.nav-justified > li.active > a {
border-bottom: 1px solid transparent !important;
}
}

Related

How can I create a button border and text with a linear gradient color?

I have a semi-round button. But I don't know how to bend it for my semi-round button in it's border.
.semi-circle {
display: inline-block;
padding: 9px 16px;
border-radius: 999px !important;
text-align: center;
/*border: 10px solid transparent;*/
/* -moz-border-image: -moz-linear-gradient(right, #FC913A 0%, #FF4E50 100%);
-webkit-border-image: -webkit-linear-gradient(right, #FC913A 0%, #FF4E50 100%);
border-image: linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
/*border-image-slice: 1;*/
border: linear-gradient(to right, green 0%, blue 100%);
/*background-image: linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
background-image: -o-linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
background-image: -moz-linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
background-image: -webkit-linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
background-image: -ms-linear-gradient(to left, #FC913A 0%, #FF4E50 100%);*/
*/
}
Forgive me for not being able to embed the image because of lack of reputation. Thx for the stack overflow community for its great service.
Here is solution. It works fine in webkit. In other browsers text color is solid.
HTML
<button data-text="Round button"></button>
<button class="active" data-text="Active round button"></button>
CSS
body {
background: #384041;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
button {
display: inline-block;
border: none;
outline: none;
appearance: none;
background: red;
position: relative;
z-index: 3;
height: 60px;
border-radius: 30px;
padding: 0 21px;
font-size: 21px;
box-shadow: -1px -1px 1px 0 black;
background: #4f4f4f;
}
button:before {
content: attr(data-text);
min-width: 144px;
z-index: -1;
border-radius: 27px;
color: #4f4f4f;
}
#media screen and (-webkit-min-device-pixel-ratio:0) { button:before {
background: #4f4f4f;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}}
button:after {
content: '';
position: absolute;
left: 3px;
right: 3px;
top: 3px;
bottom: 3px;
z-index: -2;
border-radius: 30px;
background: #151515;
}
button:hover {
cursor: pointer;
background: linear-gradient(to right, #2084c3 0%, #00caa0 100%);
}
.active {
background: linear-gradient(to right, #2084c3 0%, #00caa0 100%);
}
.active:before{
color: #2084c3;
}
#media screen and (-webkit-min-device-pixel-ratio:0) { .active:before {
background: linear-gradient(to right, #2084c3 0%, #00caa0 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}}
Demo
There are probably better ways to do this, but without further thinking I'd try something like this:
<style type="text/css">
.semi_outer {
padding: 2px;
text-align: center;
border-radius: 11px;
background: linear-gradient(to right, #0f0, #00f);
}
.semi_inner {
margin: 2px;
border-radius: 7px;
background-color: #000;
color: #0f0;
}
.semi_outer:hover {
background: linear-gradient(to right, #c00, #0c0);
}
.semi_outer:active {
background: linear-gradient(to right, #f00, #0f0);
}
</style>
<div class="semi_outer">
<div class="semi_inner">
semi_inner
</div>
</div>
This is your semi-round button . may be it will be helpfull for you.
.outer {
padding: 2px;
text-align: center;
border-radius: 11px;
background: linear-gradient(to right, #0f0, #00f);
width: 200px;
height:30px;
}
.inner {
margin: 3px;
border-radius: 7px;
background-color: #000;
color: #0f0;
height:25px;
}
.outer:hover {
background: linear-gradient(to right, #c00, #0c0);
}
.outer:active {
background: linear-gradient(to right, #f00, #0f0);
}
<div class="outer">
<div class="inner">
BUTTON
</div>
</div>

Advanced CSS not working in any version of IE

JSFiddle, as requested: http://jsfiddle.net/Es8PK/
So I'm making a website with a single universal stylesheet. This sheet has around 40 different commands (if that's the right word) that work exactly as intended in every version of browser, include IE 8 and up. However, I have two special features on my site, being custom buttons at the top of every page, and a special navigation bar on one page. Both of these feature just refuse to work in any version of IE, even though I've checked with caniuse.com and every command in there is supported by IE 11 (which isn't working). Here is the part of the stylesheet that isn't working, and then the html that uses those parts:
CSS:
/* BUTTONS IN HEADER */
.button {
/* text */
text-decoration: none;
font: 16px/1em 'Droid Sans', sans-serif;
font-weight: bold;
text-shadow: rgba(255,255,255,.5) 0 1px 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
/* layout */
padding: .5em .6em .4em .6em;
margin: .5em;
display: inline-block;
position: relative;
-webkit-border-radius: 8px;
border-radius: 8px;
/* effects */
border-top: 1px solid rgba(255,255,255,0.8);
border-bottom: 1px solid rgba(0,0,0,0.1);
background-image: -webkit-radial-gradient(top, ellipse cover, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 100%), url(http://iwantaneff.in/t/http://iwantaneff.in/t/noise.png);
background-image: -moz-radial-gradient(top, ellipse cover, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 100%), url(http://iwantaneff.in/t/http://iwantaneff.in/t/noise.png);
background-image: -ms-radial-gradient(farthest-corner ellipse at top, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 100%), url(http://iwantaneff.in/t/http://iwantaneff.in/t/noise.png);
background-image: radial-gradient(farthest-corner ellipse at top, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 100%), url(http://iwantaneff.in/t/http://iwantaneff.in/t/noise.png);
-webkit-transition: background .2s ease-in-out;
transition: background .2s ease-in-out;
/* color */
color: hsl(0, 0%, 40%) !important;
background-color: hsl(0, 0%, 75%);
-webkit-box-shadow: inset rgba(255,254,255,0.6) 0 0.3em .3em, inset rgba(0,0,0,0.15) 0 -0.1em .3em, /* inner shadow */ hsl(0, 0%, 60%) 0 .1em 3px, hsl(0, 0%, 45%) 0 .3em 1px, /* color border */ rgba(0,0,0,0.2) 0 .5em 5px; /* drop shadow */
box-shadow: inset rgba(255,254,255,0.6) 0 0.3em .3em, inset rgba(0,0,0,0.15) 0 -0.1em .3em, /* inner shadow */ hsl(0, 0%, 60%) 0 .1em 3px, hsl(0, 0%, 45%) 0 .3em 1px, /* color border */ rgba(0,0,0,0.2) 0 .5em 5px; /* drop shadow */
}
.round, .round:after {
border-top: none;
-webkit-border-radius: 1em;
border-radius: 1em;
}
.button.blue {
color: hsl(208, 50%, 40%) !important;
background-color: hsl(208, 100%, 75%);
-webkit-box-shadow: inset rgba(255,254,255,0.6) 0 0.3em .3em, inset rgba(0,0,0,0.15) 0 -0.1em .3em, /* inner shadow */ hsl(208, 50%, 55%) 0 .1em 3px, hsl(208, 50%, 40%) 0 .3em 1px, /* color border */ rgba(0,0,0,0.2) 0 .5em 5px; /* drop shadow */
box-shadow: inset rgba(255,254,255,0.6) 0 0.3em .3em, inset rgba(0,0,0,0.15) 0 -0.1em .3em, /* inner shadow */ hsl(208, 50%, 55%) 0 .1em 3px, hsl(208, 50%, 40%) 0 .3em 1px, /* color border */ rgba(0,0,0,0.2) 0 .5em 5px; /* drop shadow */
}
.button.blue:hover { background-color: hsl(208, 100%, 83%); }
.button:focus {
outline: none;
color: rgba(254,255,255,0.9) !important;
text-shadow: rgba(0,0,0,0.2) 0 1px 2px;
}
.button.disabled, .button.disabled:hover {
opacity: .5;
cursor: default;
color: rgba(0,0,0,0.2) !important;
text-shadow: none !important;
background-color: rgba(0,0,0,0.05);
background-image: none;
border-top: none;
-webkit-box-shadow: inset rgba(255,254,255,0.4) 0 0.3em .3em, inset rgba(0,0,0,0.1) 0 -0.1em .3em, /* inner shadow */ rgba(0,0,0,0.3) 0 .1em 1px, /* border */ rgba(0,0,0,0.2) 0 .2em 6px; /* drop shadow */
box-shadow: inset rgba(255,254,255,0.4) 0 0.3em .3em, inset rgba(0,0,0,0.1) 0 -0.1em .3em, /* inner shadow */ rgba(0,0,0,0.3) 0 .1em 1px, /* border */ rgba(0,0,0,0.2) 0 .2em 6px; /* drop shadow */
-webkit-transform: translateY(3px);
-ms-transform: translateY(3px);
transform: translateY(3px);
}
.button:active {
background-image: -webkit-gradient(radial, 50% 0, 100, 50% 0, 0, from( rgba(255,255,255,0) ), to( rgba(255,255,255,0) )), url(http://iwantaneff.in/t/noise.png);
background-image: -moz-gradient(radial, 50% 0, 100, 50% 0, 0, from( rgba(255,255,255,0) ), to( rgba(255,255,255,0) )), url(http://iwantaneff.in/t/noise.png);
background-image: gradient(radial, 50% 0, 100, 50% 0, 0, from( rgba(255,255,255,0) ), to( rgba(255,255,255,0) )), url(http://iwantaneff.in/t/noise.png);
-webkit-box-shadow: inset rgba(255,255,255,0.6) 0 0.3em .3em, inset rgba(0,0,0,0.2) 0 -0.1em .3em, /* inner shadow */ rgba(0,0,0,0.4) 0 .1em 1px, /* border */ rgba(0,0,0,0.2) 0 .2em 6px; /* drop shadow */
box-shadow: inset rgba(255,255,255,0.6) 0 0.3em .3em, inset rgba(0,0,0,0.2) 0 -0.1em .3em, /* inner shadow */ rgba(0,0,0,0.4) 0 .1em 1px, /* border */ rgba(0,0,0,0.2) 0 .2em 6px; /* drop shadow */
-webkit-transform: translateY(.2em);
-ms-transform: translateY(.2em);
transform: translateY(.2em);
}
/* NAVIGATION BAR */
nav {
text-align: center;
margin: 20px 0;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
nav ul {
background: #efefef;
background-image: linear-gradient(to top, #FFFFFF 0%, #3366FF 100%);
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #3366FF 100%);
background-image: -webkit-linear-gradient(top, #FFFFFF 0%, #3366FF 100%);
box-shadow: 0px 0px 9px rgba(0,0,0,0.15);
padding: 0 20px;
border-radius: 7px;
list-style: none;
position: relative;
display: inline-table;
}
nav ul:after {
content: "";
clear: both;
display: block;
}
nav ul li {
float: left;
}
nav ul li#LastOne {
position: relative;
}
nav ul li:hover {
background: #4b545f;
background: linear-gradient(to top, #4f5964 0%, #5f6975 40%);
background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%);
background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%);
}
nav ul li:hover a {
color: #fff;
}
nav ul li a {
display: block;
padding: 15px 30px;
color: #0000FF;
text-decoration: none;
font-weight: bold;
text-shadow: 2px 2px 12px #000;
}
nav ul ul {
background: #5f6975;
border-radius: 0px;
padding: 0;
position: absolute;
top: 100%;
text-align: left;
}
nav ul ul#BestOne {
position: absolute;
right: 0;
}
nav ul ul li {
float: none;
border-top: 1px solid #6b727c;
border-bottom: 1px solid #575f6a;
position: relative;
white-space: nowrap;
}
nav ul ul li a {
padding: 15px 15.5px;
color: #fff;
}
nav ul ul li a:hover {
background: #4b545f;
}
HTML (buttons):
<div id="contain2">
<br /><hr>
<a role="button" class="button round disabled">Home</a>
Software
Support
Consulting Services
What's New
Our Clients
About Us
Contact Us
</div>
HTML (navigation bar):
<nav>
<ul>
<li>Seminars and Training
<ul>
<li>New User Training</li>
<li>Making the Most of TCE</li>
<li>Cash Management Workshop</li>
<li>System Manager Training</li>
<li>Service Management Workshop</li>
<li>Advanced System Manager Training</li>
</ul></li>
<li>Peer Work Groups
<ul>
<li>Operational Audit Groups</li>
<li>Sales Manager Work Group</li>
<li>Management Work Study Group</li>
<li>System Manager Work Group</li>
</ul></li>
<li>On-Line User Groups
<ul>
<li>Prospector Pro User Groups</li>
<li>System Manager User Groups</li>
<li>Service & Parts User Group</li>
<li>Owner/CEO User Group</li>
</ul></li>
<li>Coaching Services
<ul>
<li>Financial Analysis and Review</li>
<li>Adjusting Your Inventory</li>
<li>Finding Retail Lending Sources</li>
<li>Obtaining Wholesale Inventory Financing</li>
<li>Building a Buy-Here / Pay-Here Portfolio</li>
</ul></li>
<li id="LastOne">Webinars
<ul id="BestOne">
<li>Obtaining Whole Sale Inventory Financing</li>
<li>Managing Service to Generate Cash</li>
<li>Generating Sales in a Down Market</li>
<li>Stealing Market Share through better CRM</li>
</ul></li>
</ul>
</nav>
I realize this is a lot of code, but I want to make sure anyone willing to try and help me has everything they could possibly need to deduce an answer. In addition, I use Komodo Edit to write my code, and in there it is showing me possible errors in the CSS for background-image in all cases of webkit and ms, and about half the cases of moz and just regular, so that would be a good place to start. Note, all of this works in all other browsers, but not any version of IE that I have (8, 9, 11).
What it looks like in Chrome:
What it looks like in IE:
What about using different css for the older versions of IE?
You can do this by putting this kind of tags in your html document in the head section:
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->
This code uses another css file for the browsers that are IE version 9 of lower.

Bootstrap justified nav not working

I need to make a responsive navbar and I wanted to use something like this
http://getbootstrap.com/examples/justified-nav/
It is supposed to load like this
And when min-width reaches 768px it changes to this
But in my project it loads like this and it doesn't change at all
I used the styles from the example page (http://getbootstrap.com/examples/justified-nav/justified-nav.css)
This is what's inside the body of my html
<header>
<img id="logoss" src="images/logo.png">
<ul class="nav nav-justified">
<li class="active">Empresa</li>
<li class="divider-vertical"></li>
<li>Medios</li>
<li class="divider-vertical"></li>
<li>Acci&oacuten</li>
<li class="divider-vertical"></li>
<li>Herramientas</li>
<li class="divider-vertical"></li>
<li>Staff-Sumate</li>
<li class="divider-vertical"></li>
<li>Contacto</li>
</ul></header>
and all of my style.css
* {
margin:0;
padding:0;
}
body {
background-color:#3b8476;
}
header {
height:200px;
margin: 0 auto;
max-width: 80%;
background-color:#fff;
background: #dddddd; /* Old browsers */
background: -moz-linear-gradient(top, #dddddd 0%, #ffffff 16%, #ffffff 82%, #dddddd 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dddddd), color-stop(16%,#ffffff), color-stop(82%,#ffffff), color-stop(100%,#dddddd)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #dddddd 0%,#ffffff 16%,#ffffff 82%,#dddddd 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #dddddd 0%,#ffffff 16%,#ffffff 82%,#dddddd 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #dddddd 0%,#ffffff 16%,#ffffff 82%,#dddddd 100%); /* IE10+ */
background: linear-gradient(to bottom, #dddddd 0%,#ffffff 16%,#ffffff 82%,#dddddd 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dddddd', endColorstr='#dddddd',GradientType=0 ); /* IE6-9 */
}
#logoss {
height:8em;
width:8em;
display:inline-block;
margin:2em;
}
/* from justified navbar example */
.nav-justified {
background-color: #eee;
border-radius: 5px;
border: 1px solid #ccc;
}
.nav-justified > li > a {
margin-bottom: 0;
padding-top: 15px;
padding-bottom: 15px;
color: #777;
font-weight: bold;
text-align: center;
border-bottom: 1px solid #d5d5d5;
background-color: #e5e5e5; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
background-image: -moz-linear-gradient(top, #f5f5f5 0%, #e5e5e5 100%); /* FF3.6+ */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#e5e5e5)); /* Chrome,Safari4+ */
background-image: -webkit-linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* Chrome 10+,Safari 5.1+ */
background-image: -o-linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* Opera 11.10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */
background-image: linear-gradient(top, #f5f5f5 0%,#e5e5e5 100%); /* W3C */
}
.nav-justified > .active > a,
.nav-justified > .active > a:hover,
.nav-justified > .active > a:focus {
background-color: #ddd;
background-image: none;
box-shadow: inset 0 3px 7px rgba(0,0,0,.15);
}
.nav-justified > li:first-child > a {
border-radius: 5px 5px 0 0;
}
.nav-justified > li:last-child > a {
border-bottom: 0;
border-radius: 0 0 5px 5px;
}
#media (min-width: 768px) {
.nav-justified {
max-height: 52px;
}
.nav-justified > li > a {
border-left: 1px solid #fff;
border-right: 1px solid #d5d5d5;
}
.nav-justified > li:first-child > a {
border-left: 0;
border-radius: 5px 0 0 5px;
}
.nav-justified > li:last-child > a {
border-radius: 0 5px 5px 0;
border-right: 0;
}
}
There was something wrong with the version of bootstrap I'm using, I updated the file and worked just fine, thanks to everyone who tried to help

CSS3 submenu's submenu dont work correctly

i have created a css3 style sheet for creating menu, in submenu of main menu is correct but after creating submenu. The child element of the submenu does not work correctly.
i want to move submenu's submenu to bottom of parent and i can move mouse cursor on child
JSFIDDLE
HTML:
<ul id="nav" class="nav" style='margin-right:0px;padding-right:0px;padding-top:0px;height:30px;'>
<li><a>MAIN MENU</a>
<ul>
<li>MENU 1
<ul>
<li><a>SUBMENU</a></li>
</ul>
</li>
<li>MENU 2</li>
<li>MENU 3</li>
</ul>
</li>
</ul>
CSS3:
#nav {
color: #fff;
margin: 0;
line-height: 100%;
padding-top: 4px;
padding-bottom: 4px;
height: 33px;
background: -moz-linear-gradient(center top , #5E9AE2, #3570B8) repeat scroll 0 0 transparent;
z-index: 10000;
}
#nav li {
margin: 0pt 5px;
padding: 2pt 0pt 5px;
float: right;
position: relative;
list-style: none outside none;
z-index: 10000;
cursor: pointer;
}
#nav a {
color: #fff !important;
text-decoration: none;
display: block;
padding: 9px 10px;
margin-right: 0pt;
border-radius: 5px 5px 5px 5px;
font-weight: normal;
z-index: 100000;
cursor: pointer;
}
#nav .current a, #nav li:hover > a {
z-index: 100000;
background: #fff ! important;
color: #000 ! important;
box-shadow: 0pt 1px 1px rgba(0, 0, 0, 0.2);
}
#nav ul li:hover a, #nav li:hover li a {
z-index: 100000;
background: none repeat scroll 0% 0% transparent;
color: #000 ! important;
box-shadow: none;
}
#nav ul a:hover {
background: -moz-linear-gradient(center top , rgb(198, 71, 53), rgb(147, 35, 19)) repeat scroll 0% 0% transparent ! important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#c44634), color-stop(100%,#952414)) repeat scroll 0% 0% transparent ! important; /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #c44634 0%,#952414 100%) repeat scroll 0% 0% transparent ! important; /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #c44634 0%,#952414 100%) repeat scroll 0% 0% transparent ! important; /* Opera 11.10+ */
background: -ms-linear-gradient(top, #c44634 0%,#952414 100%) repeat scroll 0% 0% transparent ! important; /* IE10+ */
background: linear-gradient(to bottom, #c44634 0%,#952414 100%) repeat scroll 0% 0% transparent ! important; /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c44634', endColorstr='#952414',GradientType=0 ) ! important; /* IE6-9 */
color: rgb(255, 255, 255) ! important;
border-radius: 0pt 0pt 0pt 0pt;
text-shadow: 0pt 1px 1px rgba(0, 0, 0, 0.1);
cursor: pointer;
}
#nav ul {
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #cfcfcf 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#cfcfcf)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#cfcfcf 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#cfcfcf 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cfcfcf',GradientType=0 ); /* IE6-9 */
display: none;
margin: 0pt;
padding: 0pt;
text-align: right;
width: 180px;/*طول منو*/
position: absolute;
top: 35px;
right: 0pt;
border-radius: 5px 5px 5px 5px;
direction: rtl;
box-shadow: 0pt 1px 3px rgba(0, 0, 0, 0.3);
}
#nav li:hover > ul {
display: block;
}
#nav ul li {
float: none;
margin: 0pt;
padding: 0pt;
}
#nav ul li ul{
float: none;
margin-top:28px;
margin-right: 180px;
top: 0px;
}
#nav ul li ul li:first-child > a {
border-radius: 5px 5px 5px 5px;
behavior: url('./css/PIE.htc');
}
#nav ul li ul li:last-child > a {
border-radius: 5px 5px 5px 5px;
behavior: url('./css/PIE.htc');
}
#nav ul a {
font-weight: normal;
text-shadow: 0pt 1px 1px rgba(255, 255, 255, 0.898);
}
#nav ul li:first-child > a {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-radius: 5px 5px 0px 0px;
behavior: url('./css/PIE.htc');
}
#nav ul li:last-child > a {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-radius: 0px 0px 5px 5px;
behavior: url('./css/PIE.htc');
}
#nav:after {
z-index: 100000;
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0pt;
height: 0pt;
}
this method not problem but i want to have any submenu and cant fix it.please help me,
#nav ul li ul {
float: none;
margin-right: 180px;
margin-top: 28px; /* <-- this is causing issue */
top: 0;
}
i don't know where the problem every thing work just remove margin-top
and add the html
<ul id="nav" class="nav" style='margin-right:0px;padding-right:0px;padding-top:0px;height:30px;'>
<li><a>MAIN MENU</a>
<ul>
<li>MENU 1
<ul>
<li><a>SUBMENU</a>
<ul>
<li><a>asdasd</a></li>
<li><a>asdasd</a></li>
<li><a>asdasd</a></li>
</ul>
</li>
</ul>
</li>
<li>MENU 2</li>
<li>MENU 3</li>
</ul>
</li>
see demo : jsfiddle

padding issue in Firefox

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!

Resources