My links are not Start Class and Center class for my website I am building. I have gone over this several times and can not see what I have done wrong. Can someone please assist me with this?
My html
<DIV class="outline">
<DIV class="navigation">
<ul>
<li class="orange start">Home</li>
<li class="orange center">Forum</li>
</ul>
</DIV>
</DIV>
My Css class
/*Start Links*/
a:link {
color: #FFFFFF;
text-decoration: none;
margin: 0;
}
a:visited {
color: #FFFFFF;
text-decoration: none;
}
a:hover {
color: #FFFFFF;
text-decoration: none;
}
a:active {
color: #FFFFFF;
text-decoration: none;
}
.navigation ul li {
margin: 0px auto;
display: inline-block;
}
/*End Links*/
/*Start Button*/
.start {
display: inline-block;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.3);
-webkit-border-radius: .5em 0 0 .5em;
-moz-border-radius: .5em 0 0 .5em;
border-radius: .5em 0 0 .5em;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2pxrgba(0,0,0,.2);
margin: 0px;
}
.center {
display: inline-block;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.3);
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2pxrgba(0,0,0,.2);
margin: 0;
}
.button {
display: inline-block;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.3);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2pxrgba(0,0,0,.2);
}
.button:hover {
text-decoration: none;
}
.button:active {
position: relative;
top: 1px;
}
.orange {
color: #fef4e9;
border: solid 1px #da7c0c;
background: #f78d1d;
background: -webkit-gradient(linear, left top, left bottom, from(#faa51a), to(#f47a20));
background: -moz-linear-gradient(top, #faa51a, #f47a20);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#faa51a', endColorstr='#f47a20');
}
.orange:hover {
background: #f47c20;
background: -webkit-gradient(linear, left top, left bottom, from(#f88e11), to(#f06015));
background: -moz-linear-gradient(top, #f88e11, #f06015);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f88e11', endColorstr='#f06015');
}
.orange:active {
color: #fcd3a5;
background: -webkit-gradient(linear, left top, left bottom, from(#f47a20), to(#faa51a));
background: -moz-linear-gradient(top, #f47a20, #faa51a);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f47a20', endColorstr='#faa51a');
}
/*End Button*/
/*Start Website*/
body {
background-color: #393939;
color: #FFFFFF;
padding: 0;
margin: 0;
}
.header {
display: inline-block;
width: 100%;
text-align: left;
border:solid 2px red;
}
.circle {
float: left;
width: 100px;
height:100px;
display: inline-block;
background: #FF5A09;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
}
.header h1.first {
margin-top: 30px;
margin-left: -92px;
margin-right: 5px;
display: inline-block;
color: #FFFFFF;
}
.header h1.last {
display: inline;
color: #FF5A09;
}
.header .right {
display: block;
height: auto;
float: right;
padding: 10px 10px 10px 10px;
border-left: solid 2px red;
}
.navigation {
margin: 0 auto;
display: inline-block;
width: 100%;
text-align: center;
}
.outline {
display: block;
margin: 0 auto;
width: 980px;
border: solid 2px red;
}
.content {
display: inline-block;
width: 60%;
border: solid 2px red;
margin: 0 auto;
}
.footer {
display: block;
width: 100%;
border: solid 2px red;
padding: 10px 0 10px 0;
text-align: center;
}
/*End Website*/
/*Start slider*/
/*End slider*/
It is because the whitespace between the <li> elements is significant. If you remove all whitespace, the elements will be right next to each other. Either you just do this:
<li class="orange start">Home</li><li class="orange center">Forum</li>
Or, if you want to keep the line breaks in code, which I usually think is a good thing, you can insert an HTML comment like this:
<li class="orange start">Home</li><!--
--><li class="orange center">Forum</li>
It's a matter of taste, but I tend to favor the latter because I find it more readable.
Related
I am working on Expandable Search but facing one problem. When i click on search bar then search bar is expanding. But right side content is moving down. I wanna hide right side content when search bar is expand similar to stackoverflow search bar.
body {
margin: 0;
padding: 0;
}
.mainheader {
width: 100%;
background-color: #FAFAFB;
border-top: 3px solid #F48024;
float: left;
padding-bottom: 10px;
-moz-box-shadow: 3px 3px 5px 1px #ccc;
-webkit-box-shadow: 3px 3px 5px 1px #ccc;
box-shadow: 3px 3px 5px 1px #ccc;
}
.innerheader {
width: 1000px;
margin: auto;
}
.logo_name {
display: inline-block;
margin-top: 13px;
line-height: 1em;
font-family: helvetica, arial, sans-serif;
font-weight: bold;
background: linear-gradient(to right, #7db9e8 50%,#1e5799 50%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 22px;
}
.ga_a {
float: left;
}
.ga_b {
float: left;
padding: 5px;
padding-bottom: 10px;
margin-top: 5px;
}
.ga_b ul {
margin: 0px;
padding: 0px;
margin-left: 7px;
line-height:1;
}
.ga_b ul>li {
display:inline-block;
margin-left: 5px;
padding: 5px;
}
.ga_b ul>li a {
text-decoration: none;
color: black;
font-size: 15px;
font-family: "Lucida Grande",Arial,Helvetica,Verdana,sans-serif;
}
.ga_b ul>li:hover {
background-color: #ECECEC;
}
.ga_c {
float: left;
}
.ga_c input {
outline: none;
}
.ga_c input[type=search] {
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
font-family: inherit;
font-size: 100%;
margin-left: 10px;
}
.ga_c input::-webkit-search-decoration,
.ga_c input::-webkit-search-cancel-button {
display: none;
}
.ga_c input[type=search] {
background: #ededed url(https://static.tumblr.com/ftv85bp/MIXmud4tx/search-icon.png) no-repeat 9px center;
border: solid 1px #ffffff;
padding: 9px 10px 9px 32px;
width: 175px;
border-radius: 5px;
margin-top: 5px;
-webkit-transition: all .5s;
-moz-transition: all .5s;
transition: all .5s;
}
.ga_c input[type=search]:focus {
width: 400px;
background-color: #fff;
-webkit-box-shadow: 0 0 5px rgba(109,207,246,.5);
-moz-box-shadow: 0 0 5px rgba(109,207,246,.5);
box-shadow: 0 0 5px rgba(109,207,246,.5);
}
.ga_c input:-moz-placeholder {
color: #999;
}
.ga_c input::-webkit-input-placeholder {
color: #999;
}
.ga_d {
float: left;
}
.ga_d ul>li {
display: inline-block;
display: fixed;
}
<div class="mainheader">
<div class="innerheader">
<div class="ga_a">
<a class="navbar-brand logo_name" href="#">WebSiteName</a>
</div>
<div class="ga_b">
<ul>
<li>Text One</li>
<li>Text Two</li>
<li>Text Three</li>
</ul>
</div>
<div class="ga_c">
<form>
<input type="search" placeholder="Search">
</form>
</div>
<div class="ga_d">
<ul>
<li>Login</li>
<li>Register</li>
</ul>
</div>
</div>
</div>
You can do it with the positioning:
* {box-sizing: border-box} /* recommended */
body {
margin: 0;
padding: 0;
}
.mainheader {
width: 100%;
min-width: 1000px; /* added / needs to match the .innerheader width */
margin: 0 auto; /* added */
background-color: #FAFAFB;
border-top: 3px solid #F48024;
float: left;
padding-bottom: 10px;
-moz-box-shadow: 3px 3px 5px 1px #ccc;
-webkit-box-shadow: 3px 3px 5px 1px #ccc;
box-shadow: 3px 3px 5px 1px #ccc;
}
.innerheader {
width: 1000px;
margin: 0 auto; /* modified */
}
.logo_name {
display: inline-block;
margin-top: 13px;
line-height: 1em;
font-family: helvetica, arial, sans-serif;
font-weight: bold;
background: linear-gradient(to right, #7db9e8 50%,#1e5799 50%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 22px;
}
.ga_a {
float: left;
}
.ga_b {
float: left;
padding: 5px;
padding-bottom: 10px;
margin-top: 5px;
}
.ga_b ul {
margin: 0;
padding: 0;
margin-left: 7px;
line-height: 1;
}
.ga_b ul>li {
display:inline-block;
margin-left: 5px;
padding: 5px;
}
.ga_b ul>li>a {
text-decoration: none;
color: #000; /*black*/
font-size: 15px;
font-family: "Lucida Grande",Arial,Helvetica,Verdana,sans-serif;
}
.ga_b ul>li:hover {
background: #ECECEC;
}
.ga_c {
position: relative; /* needs to be set because of the absolute positioned child */
float: left;
}
.ga_c input {
outline: none;
}
.ga_c input[type=search] {
position: absolute; /* needs to be positioned absolutely, i.e. be removed from the normal document flow so that it can "overlay" and other element, of course the z-index needs to be set */
z-index: 9999; /* usually something big just to be sure it stays on top / in front of everything else */
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
font-family: inherit;
font-size: 100%;
margin-left: 10px;
}
.ga_c input::-webkit-search-decoration,
.ga_c input::-webkit-search-cancel-button {
display: none;
}
.ga_c input[type=search] {
background: #ededed url(https://static.tumblr.com/ftv85bp/MIXmud4tx/search-icon.png) no-repeat 9px center;
border: solid 1px #fff;
padding: 9px 10px 9px 32px;
width: 175px;
border-radius: 5px;
margin-top: 5px;
-webkit-transition: all .5s;
-moz-transition: all .5s;
transition: all .5s;
}
.ga_c input[type=search]:focus {
width: 400px;
background-color: #fff;
-webkit-box-shadow: 0 0 5px rgba(109,207,246,.5);
-moz-box-shadow: 0 0 5px rgba(109,207,246,.5);
box-shadow: 0 0 5px rgba(109,207,246,.5);
}
.ga_c input:-moz-placeholder {
color: #999;
}
.ga_c input::-webkit-input-placeholder {
color: #999;
}
.ga_d {
position: relative; /* positioned relative to its normal position so that we can move it with "directional" properties */
left: 229px; /* moved to the right by the width of the .ga_c (inspected the element) */
float: left;
}
.ga_d ul>li {
display: inline-block;
display: fixed;
}
<div class="mainheader">
<div class="innerheader">
<div class="ga_a">
<a class="navbar-brand logo_name" href="#">WebSiteName</a>
</div>
<div class="ga_b">
<ul>
<li>Text One</li>
<li>Text Two</li>
<li>Text Three</li>
</ul>
</div>
<div class="ga_c">
<form>
<input type="search" placeholder="Search">
</form>
</div>
<div class="ga_d">
<ul>
<li>Login</li>
<li>Register</li>
</ul>
</div>
</div>
</div>
With your structure, it is not possible using css only. However if change the structure you could have something like this.
*{
box-sizing: border-box;
font-family: arial;
}
input{
padding: 10px;
background: #eee;
border: 1px solid #ddd;
display: inline-block;
transition: .3s;
margin-right: 10px;
width: 250px;
}
input:focus{
width: 400px;
}
input:focus + div{
opacity: 0;
visibility: hidden;
}
ul{
padding: 0;
margin: 0;
}
ul li{
display: inline;
margin-right: 5px;
}
div {
display: inline-block;
transition: .3s;
}
<input type="search" placeholder="Search">
<div class="ga_d">
<ul>
<li>Login</li>
<li>Register</li>
</ul>
</div>
I have div with the following style.
This issue is occuring only for the swedish characters. Not for the english.
.pricing-box {
text-align: center;
border: 1px solid #dfe8f1
}
.pricing-box .pricing-title,
.pricing-box .pricing-specs {
margin: -1px -1px 0
}
.pricing-box .pricing-title {
font-weight: normal;
padding: 15px
}
.pricing-box ul {
margin: 0;
padding: 0;
list-style: none
}
.pricing-box .pricing-specs {
padding: 10px 15px 20px
}
.pricing-box .pricing-specs span {
font-size: 50px
}
.pricing-box .pricing-specs span sup {
font-size: 30px;
margin-left: -20px;
padding-right: 5px
}
.pricing-box .pricing-specs i {
font-size: 14px;
font-style: normal;
display: block;
color: rgba(255, 255, 255, .6)
}
.pricing-box ul li {
font-size: 14px;
line-height: 48px;
height: 48px;
padding: 0 10px;
border-bottom: #eee solid 1px
}
.pricing-box ul li:nth-child(even) {
background: #fafafa
}
.pricing-table .pricing-box {
padding: 0
}
.pricing-table .pricing-box+.pricing-box {
border-width: 1px 1px 1px 0;
border-radius: 0
}
.pricing-table .pricing-box+.pricing-box:nth-child(2):last-child {
border-width: 1px 1px 1px
}
.pricing-table .pricing-box .pricing-title,
.pricing-table .pricing-box .pricing-specs {
margin: 0;
border-bottom: #eee solid 1px;
border-radius: 0
}
.pricing-table .pricing-box .pricing-specs span {
font-size: 40px
}
.pricing-table .pricing-box .pricing-specs span sup {
font-size: 20px;
margin-left: -10px;
padding-right: 5px
}
.pricing-table .pricing-box .pricing-specs i {
color: rgba(0, 0, 0, .5)
}
.pricing-table .pricing-best {
position: relative;
z-index: 15;
margin-right: -1px;
margin-left: -1px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, .1)
}
.pricing-table .pricing-best .pricing-specs {
background: #fafafa
}
.pricing-table .pricing-best .pricing-title {
font-size: 28px;
line-height: 60px;
height: 90px;
margin: -25px -1px 0
}
.pricing-box-alt {
position: relative
}
.pricing-box-alt .col-md-3 {
padding: 0;
border: #c6c6c6 solid 1px;
border-width: 1px 1px 1px 0;
width: 26%;
text-align: center
}
.pricing-box-alt .plans-features {
width: 22%;
text-align: right;
border-color: transparent #c6c6c6 transparent transparent
}
.pricing-box-alt .plans-features .plan-header {
height: 170px
}
.pricing-box-alt .plans-features ul li {
border-left: #f0f0f0 solid 1px
}
.pricing-box-alt ul {
list-style: none;
margin: 0;
padding: 0
}
.pricing-box-alt .plan-header {
padding: 15px;
border-bottom: #f0f0f0 solid 1px
}
.pricing-box-alt .plan-header h4 {
margin: 0;
color: #f26b33;
text-transform: uppercase;
font-size: 17px;
font-weight: bold;
height: 40px;
line-height: 30px;
border-bottom: #f3f3f3 solid 1px
}
.pricing-box-alt .plan-header .plan-price {
font-size: 45px;
font-weight: 100;
height: 60px;
line-height: 65px;
margin: 0 0 5px
}
.pricing-box-alt .plan-header .plan-price small {
font-size: 30px;
opacity: .4;
padding-right: 3px
}
.pricing-box-alt .studio-plan .plan-header h4 {
color: #32cf4e
}
.pricing-box-alt .unlimited-plan .plan-header h4 {
color: #3792f2
}
.pricing-box-alt ul li {
height: 32px;
line-height: 32px;
padding: 0 10px;
border-bottom: #f0f0f0 solid 1px;
color: #0093d9;
font-size: 14px;
font-weight: bold
}
.pricing-box-alt .plans-features ul li {
color: #6f6f6f;
font-weight: normal
}
.pricing-box-alt ul li .feature-included,
.pricing-box-alt ul li .feature-excluded {
border-radius: 30px;
width: 12px;
height: 12px;
display: inline-block
}
.pricing-box-alt ul li .feature-excluded {
background: #e6e6e6
}
.pricing-box-alt .pricing-btn {
padding: 15px;
background: #fafafa
}
.pricing-box-alt .pricing-btn .btn {
padding: 15px 0;
font-weight: bold;
font-size: 16px;
box-sizing: initial;
display: block;
line-height: 1
}
.pricing-box-alt .pricing-btn .btn b {
opacity: .6;
display: block;
padding: 6px 0 0;
font-size: 13px;
font-weight: normal
}
.individual-plan .pricing-btn {
border-left: #c6c6c6 solid 1px;
margin-left: -1px
}
.pricing-box-alt ul li.header {
background: #f9f9f9;
text-transform: uppercase;
font-weight: bold;
text-align: right;
font-size: 12px;
color: #000
}
<div class="container">
<div class="row pricing-table mrg10A ">
<div class="row clear-both">
<div class="pricing-box col-sm-4">
<ul>
<li>
<p>Basic functions to plan and monitor your business</p>
</li>
<li>
<p>Create up to 40 of your won lists</p>
</li>
<li>
<p>Create up to 1 custom list</p>
</li>
<li>
<p>You can invite 5 to 10 users additionaly</p>
</li>
</ul>
</div>
</div>
</div>
</div>
CSS
Previously I had the same style. But the fonts are not overlapping. Now the fonts are overlapping. Here I have attached a image for reference.
After applied the following style, the fonts are not overlapping. What will be the reason for this issue?
I'm trying to create this price column, and have been modifying the code of a tutorial, and everything was going fine until I added a border to .price section of it. The border added some extra width to the element, but only on the right side. I tried to see if another div was the reason, or some forgotten about margin/padding values with Chrome Dev Tools, but I can't see anything.
I would really appreciate any help with finding out what is causing the extra width to .price div
Here is the html:
<ul class="pricing_table">
<li></li>
<li class="price_block">
<h3>Web Development</h3>
<div class="price">
<div class="price_figure">
<span class="price_number">$9.99</span>
<span class="price_tenure">per month</span>
</div>
</div>
<ul class="features">
<li>2GB Storage</li>
<li>5 Clients</li>
<li>10 Active Projects</li>
<li>Free Goodies</li>
<li>24/7 Email support</li>
</ul>
<div class="buynow">
Buy Now
</div>
</li>
</ul>
Here is the CSS:
* {
margin: 0;
padding: 0;
}
li {
list-style:none;
}
body {
font-family: roboto;
}
h3 {
font-family: lato;
}
.pricing_table {
line-height: 150%;
font-size: 20px;
margin: 0 auto;
width: 75%;
max-width: 400px;
padding-top: 10px;
margin-top: 100px;
}
.price_block, .price_block_blue {
width: 100%;
color: black;
background-color: white;
float: left;
list-style-type: none;
transition: all 0.25s;
position: relative;
box-sizing: border-box;
margin-bottom: 10px;
}
.pricing_table h3 {
text-transform: uppercase;
padding: 5px 0;
background: white;
margin: -10px 0 0 0;
text-align: center;
border: 3px solid black;
border-bottom: 0px solid transparent;
}
.price {
display: table;
background: red;
width: 100%;
margin: 0;
padding: 0;
height: 70px;
text-align: center;
border: 3px solid black;
border-top:0px solid black;
border-bottom:0px solid black;
}
.price_blue {
display: table;
background: blue;
width: 100%;
height: 70px;
text-align: center;
}
.price_figure {
font-size: 24px;
text-transform: uppercase;
vertical-align: middle;
display: table-cell;
}
.price_number {
font-weight: bold;
padding: 10px 0 0 0;
display: block;
}
.price_tenure {
font-size: 11px;
}
.features {
background: #fff;
color: #000;
text-align: center;
border: 3px solid black;
border-bottom: 0px solid transparent;
border-top: 0px solid transparent;
}
.features li {
padding: 8px 15px;
border-bottom: 1px solid #ccc;
font-size: 11px;
list-style-type: none;
}
.buynow {
padding: 15px;
background: white;
text-align: center;
border: 3px solid black;
border-top: 0px solid black;
}
.action_button {
text-decoration: none;
color: white;
font-weight: bold;
border-radius: 5px;
background: red;
padding: 5px 20px;
font-size: 11px;
text-transform: uppercase;
}
.price_block:hover,.price_block_blue:hover {
box-shadow: 0 0 0px 5px rgba(0, 0, 0, 0.5);
transform: scale(1.04) translateY(-5px);
z-index: 1;
border-bottom: 0 none;
}
.price_block:hover .price {
background: yellow;
/*box-shadow: inset 0 0 45px 1px #ADD8E6;*/
}
.price_block_blue:hover .price_blue {
background: yellow;
}
.price_block:hover h3{
background: black;
color: white;
}
.price_block_blue:hover h3 {
background: black;
color: white;
}
.price_block:hover .action_button, .price_block_blue:hover .action_button {
background: linear-gradient(#F9B84A, #DB7224);
}
Since you are adding a border, it gets added to your overall width. So the actual width of .price is 100% + 3px (left border) + 3px (right border). To have the total width include padding and borders, use box-sizing:
.price {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
So I've got this navbar, which you can see here--
http://codepen.io/anon/pen/FJGvg/
I'm trying to evenly space the elements within the navbar, and I cannot get it to work for the life of me. I have tried many things. Here is the code:
<ul id="menu">
<li><a>Test</a></li>
<li><a>Test Different Length </a></li>
<li><a>Test Again</a></li>
<li><a>Test23</a></li>
</ul>
#menu {
width: 50%;
min-width: 700px;
margin: auto;
margin-top: 10px;
padding: 10px 0 0 0;
list-style: none;
text-align: center;
background-color: #111;
background-image: linear-gradient(#444, #111);
border-radius: 18px;
/* box-shadow: 0 2px 1px #9c9c9c;*/
}
#menu li {
display: inline;
margin-left: auto;
width: 25%;
float: left;
padding: 0 0 10px 0;
position: relative;
}
#menu a {
float: left;
height: 25px;
padding: 0 25px;
color: #999;
text-transform: uppercase;
font: bold 12px/25px Arial, Helvetica;
text-decoration: none;
text-shadow: 0 1px 0 #000;
}
#menu li:hover > a {
color: #fafafa;
}
/* Clear floated elements */
#menu:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
#menu {
width: 50%;
min-width: 700px;
margin: 10px auto 0 auto;
padding: 5px 0;
list-style: none;
text-align: center;
background-color: #111;
background-image: linear-gradient(#444, #111);
border-radius: 18px;
/* box-shadow: 0 2px 1px #9c9c9c;*/
}
#menu li {
display: inline-block;
width: 23%;
position: relative;
padding:0;
}
#menu a {
height: 25px;
color: #999;
text-transform: uppercase;
font: bold 12px/25px Arial, Helvetica;
text-decoration: none;
text-shadow: 0 1px 0 #000;
}
#menu li:hover > a {
color: #fafafa;
}
/* Clear floated elements */
#menu:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
i'm displaying menu hover on image .These all image generated dynamically.
while mouse hover on first image menu will display but problem on menu items background items displaying. how to hide behide elemets while displying hover ?
a {
text-decoration: none;
}
.menu {
font-family: Arial;
color: #515151;
height: 40px;
position: relative;
text-align: left;
width: 15px;
margin: 0 auto;
}
.menu li a {
color: #515151;
display: block;
cursor: pointer;
font-size: 14px;
padding: 6px 15px;
}
.menu li a:hover {
background: #f44141;
color: #fff;
}
.sub {
background: #fff;
position: absolute;
z-index: 2;
width: 200px;
border-radius: 3px;
box-shadow: 0 2px 4px #ddd;
border: 1px solid #ddd;
display: none;
padding: 40px 0 3px;
}
a.hover-link {
width: 190px;
background: #fff;
font-size: 14px;
color: #515151;
position: absolute;
z-index: 110;
display: block;
height: 8px;
cursor: pointer;
border-radius: 5px 5px 0 0;
font-weight: 700;
border: 1px solid #ddd;
padding: 10px 0 1px 10px;
}
.sub-options {
list-style: none;
font-size: 11px;
margin: 0;
padding: 0;
}
Working example : This is just z-index's issue CSS:
.sub{
background: #fff;
position: absolute;
z-index: 1000;
width: 200px;
margin: 0px 0 3px;
border-radius: 3px;
box-shadow: 0 2px 4px #ddd;
border: 1px solid #ddd;
display: none; top:38px; left:0;
}