I have this problem in bootstrap.
I have made a navbar wich is fixed on top, and the dropdown does work on computer. But when I use mobile view the dropdown does not show.
I have search this and other sites for solution, but none of them have worked for me. The problem seems to be overflow:auto; in mobile view.
Here is my code:http://www.bootply.com/tMdIqM9xSL
HTML:
<div class="row mynav">
<div class="col-md-12 nopadding">
<span class="logo glyphicon glyphicon-home" aria-hidden="true"><label>Hjem</label></span>
<div class="btn-group"><span class="logo glyphicon glyphicon-user" data-toggle="dropdown" aria-hidden="true"><label>Din profil</label><span class="caret"></span></span>
<ul class="dropdown-menu " role="menu">
<li>Login
</li>
<li>My profile
</li>
<li>Add
</li>
<li>Favorites
</li>
<li>Logout
</li>
</ul>
</div>
<span class="logo glyphicon glyphicon-stats align-bottom" aria-hidden="true"><label>Stats</label></span>
<span class="logo glyphicon glyphicon-envelope" aria-hidden="true"><label>Contact us</label></span>
<span class="logo glyphicon glyphicon-search pull-right" data-toggle="collapse" href="#m_showsearch" aria-hidden="true"><label>Search</label></span>
</div>
<div id="m_showsearch" class="panel-collapse collapse container-fluid">
<div class="col-md-4 floatnone">
<div class="panel panel-default search-panel">
<div class="panel-heading">
<h4 class="panel-title"><a data-toggle="collapse" href="#collapseFag">Subject</a></h4>
</div>
<div id="collapseFag" class="panel-collapse collapse in">
<div class="panel-body">
<p> </p><p> </p><p> </p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-1 text-center floatnone">
<button type="button" class="searchbutton btn btn-primary btn-lg pull-center" onclick="findhelp();"><span class="glyphicon glyphicon-search" data-toggle="dropdown" aria-hidden="true"></span>
</button>
<br>
</div>
CSS:
.maincontainer {
padding: 0px;
}
.mynav {
border-bottom: 1px solid rgb(38, 70, 83);
background-color: #FFF;
text-align: left;
box-shadow: 0px 2px 2px #AAAAAA;
z-index: 10;
position: fixed;
width: 100%;
}
#spaceontop {
margin-bottom: 60px;
}
#m_showsearch {} a[title2]:hover:after {
font-size: 10px;
font-weight: thin;
border: 1px solid #000;
background-color: rgb(38, 70, 83);
content: attr(title2);
padding: 10px;
size: 5px;
color: #FFF;
position: absolute;
left: 50%;
top: 50px;
}
.dropdown-menu {
border-radius: 0px;
border: 1px solid rgb(38, 70, 83);
}
.dropdown-menu li a:hover {
background-color: #51b098;
color: #fff;
}
.panel {
box-shadow: 3px 3px 3px 0px;
border: 1px solid #51b098;
border-radius: 0px;
}
.search-panel {
border-radius: 3px;
box-shadow: 0px 0px 0px 0px;
}
.search-panel.panel-heading {
box-shadow: 0px 0px 0px 0px;
}
.panel>.panel-heading {
background-color: #FFF;
/*#51b098;*/
//box-shadow: 0px 2px 2px 0px;
border-radius: 0px;
font-size: 100%;
text-transform: uppercase;
font-family: 'Lato', sans-serif;
}
.panel>.panel-headinga a {
font-size: 20px;
font-weight: bold;
color: #51b098;
}
.panel-body {
// border:1px solid #51b098;
}
.btn-group {
vertical-align: initial;
}
.logo {
font-size: 20px;
height: 60px;
padding: 18px;
padding-left: 20px;
padding-right: 20px;
vertical-align: middle;
border-top: 3px solid transparent;
-webkit-transition: background 0.2s, color 0.2s;
-moz-transition: background 0.2s, color 0.2s;
-ms-transition: background 0.2s, color 0.2s;
-o-transition: background 0.2s, color 0.2s;
transition: background 0.2s, color 0.2s;
text-align: center;
}
.logo:hover {
//background-color:rgb(38, 70, 83);
color: orange;
//text-shadow:-1px -1px #000;
border-top: 3px solid rgb(38, 70, 83);
-webkit-transition: background 0.5s, color 0.2s;
-moz-transition: background 0.5s, color 0.2s;
-ms-transition: background 0.5s, color 0.2s;
-o-transition: background 0.5s, color 0.2s;
transition: background 0.5s, color 0.2s;
}
.logo label {
font-size: 12px;
padding: 14px 0px 14px 0px;
margin: 5px;
font-family: Lato;
text-transform: uppercase;
padding: 0px;
}
.btn,
.btn:hover,
.btn:focus {
//background-color:rgb(38, 70, 83);
padding: 20px;
//color:#FFF;
padding: 10px;
border-radius: 0px;
border: 0px;
}
.panel-default>.panel-heading {
background: transparent;
}
#media(max-width:1000px) {
.logo label:last-child {
display: none;
//visibility:hidden;
}
.logo {
height: 100%;
}
}
#media(max-width:768px) {
.logo label {
display: none;
padding: 20px 15px 15px 0px;
}
.logo {
font-size: 16px;
padding-left: 10px;
padding-right: 10px;
padding: 10px;
}
.div_headline {
padding: 5px;
text-align: center;
width: 100%;
}
.div_headline:after {
display: none;
}
.floatnone {
padding: 0px;
}
#m_showsearch {
padding: 1px;
}
.mynav {
width: 100%;
margin-bottom: 0px;
max-height: 100%;
overflow: auto;
}
.dropdown-menu {
}
}
As I said I have tried every solution I have found, but none those I found worked.
EDIT:
I need the overflow to make the search-button work. When I press the searchbutton a div appears. And the search-div may be large so I need to be able to scroll it.
Just remove overflow: auto. It should work.
.mynav {
width: 100%;
margin-bottom: 0px;
}
Related
I don't understand why the border-bottom is not displayed entirely in the menu?
Here is my result below:
image
In this image, there is a space on the left that I would like to remove because it is not aesthetically pretty.
dashboard.component.html
<div class="sidebar" style="border-right: 1px solid black" [ngClass]="{ active: showSideBar }">
<div class="logo-details" style="border-bottom: 1px solid black;">
<span class="logo_name">
</span>
</div>
<ul id="accordion" class="accordion">
<li *ngFor="let menu of menus; let i = index" [class.active]="menu.active">
<ng-container>
<div class="menu" (click)="selectMenu(menu)">
<i [class]="menu.iconClass"></i> {{ menu.name }}
<i class="fa fa-chevron-down"></i>
</div>
</ng-container>
</li>
</ul>
style.css
#import url(https://fonts.googleapis.com/css?family=Open+Sans);
#import url(https://use.fontawesome.com/releases/v5.3.1/css/all.css);
*,
*:before,
*:after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
h1 {
font-size: 58px;
}
h2 {
font-size: 30px;
}
ul {
list-style-type: none;
}
.sidebar {
position: fixed;
height: 100%;
width: 250px;
background: #239cd3;
/* overflow-y:scroll;*/
transition: all 0.5s ease;
}
/* LOGO */
.sidebar .logo-details {
height: 100px;
display: flex;
align-items: center;
}
/* ACCORDION */
.sidebar .accordion {
width: 100%;
margin: 0px;
border-radius: 4px;
}
/* MENU TITLE */
.sidebar .accordion .menu {
position: relative;
padding: 15px 15px 15px 20px;
color: white;
border-bottom: 1px solid #ccc;
cursor: pointer;
transition: all 0.4s ease;
font-size: 18px;
text-transform: uppercase;
text-decoration: none;
}
/* ICON MENU TITLE */
.sidebar .accordion li i {
position: absolute;
top: 1.2rem;
left: -15px;
/* left: 1rem; */
color: white;
transition: all 0.4s ease;
font-size: 18px;
}
.sidebar .accordion li i.fa-chevron-down {
right: 1rem;
left: auto;
}
.sidebar .accordion li.active i.fa-chevron-down {
transform: rotate(180deg);
}
The code is here for information -> Stackblitz.
Thank you in advance for your reply.
There is a padding-left: 2rem; for ul element. Remove that.
Give that padding-left: 2rem; to the li element in *ngFor.
remove border-bottom from div and add to li.
I have a multi-stages circles navigation bar in pure css. I want to achieve a hover effect but its not working smoothly. Its very jerky and ugly. How to make it smooth?
Can we also have a effect on hover where blue ball increases from 0 to full width gradually and then a white circle around it appears?
#stages_cont {
margin:50px auto;
width:600px;
}
#stages {
background:#d4d7df;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
height:5px;
}
#stages li {
float:left;
text-align:center;
width:33%;
}
#stages li a {
-moz-border-radius:50%;
-webkit-border-radius:50%;
border-radius:50%;
display:block;
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
text-decoration:none;
}
.stage_done .stage_circle {
background:#2585fe;
border:6px solid #ffffff;
box-shadow:0px 0px 5px #d4d7df;
height:20px;
width:20px;
margin:-13px auto 10px;
}
.stage_not .stage_circle {
background:#d4d7df;
height:20px;
width:20px;
margin:-8px auto 17px;
-moz-transition:all 0.5s ease;
-webkit-transition:all 0.5s ease;
transition:all 0.5s ease;
}
.stage_done .stage_link {
color:#2585fe;
}
.stage_not .stage_link {
color:#d4d7df;
}
.clr {
clear:both;
}
.stage_not:hover .stage_circle {
background:#2585fe;
border:6px solid #ffffff;
box-shadow:0px 0px 5px #d4d7df;
margin:-13px auto 10px;
}
<link rel="stylesheet" type="text/css" href="https://meyerweb.com/eric/tools/css/reset/reset.css" />
<div id="stages_cont">
<ul id="stages">
<li class="stage_done">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Details</a>
</li>
<li class="stage_done">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Content</a>
</li>
<li class="stage_not">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Send or Schedule</a>
</li>
<div class="clr"></div>
</ul>
</div>
Update the following styles
.stage_not .stage_circle {
background: #d4d7df;
height: 20px;
width: 20px;
margin: -8px auto 17px;
-moz-transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
box-sizing: border-box;
}
.stage_not:hover .stage_circle {
background: #2585fe;
border: 6px solid #ffffff;
box-shadow: 0px 0px 5px #d4d7df;
margin: -13px auto 10px;
box-sizing: border-box;
height: 32px;
width: 32px;
}
#stages_cont {
margin: 50px auto;
width: 600px;
}
#stages {
background: #d4d7df;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
height: 5px;
}
#stages li {
float: left;
text-align: center;
width: 33%;
}
#stages li a {
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
display: block;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
text-decoration: none;
}
.stage_done .stage_circle {
background: #2585fe;
border: 6px solid #ffffff;
box-shadow: 0px 0px 5px #d4d7df;
height: 20px;
width: 20px;
margin: -13px auto 10px;
}
.stage_not .stage_circle {
background: #d4d7df;
height: 20px;
width: 20px;
margin: -8px auto 17px;
-moz-transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
box-sizing: border-box;
}
.stage_done .stage_link {
color: #2585fe;
}
.stage_not .stage_link {
color: #d4d7df;
}
.clr {
clear: both;
}
.stage_not:hover .stage_circle {
background: #2585fe;
border: 6px solid #ffffff;
box-shadow: 0px 0px 5px #d4d7df;
margin: -13px auto 10px;
box-sizing: border-box;
height: 32px;
width: 32px;
}
<link rel="stylesheet" type="text/css" href="https://meyerweb.com/eric/tools/css/reset/reset.css" />
<div id="stages_cont">
<ul id="stages">
<li class="stage_done">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Details</a>
</li>
<li class="stage_done">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Content</a>
</li>
<li class="stage_not">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Send or Schedule</a>
</li>
<div class="clr"></div>
</ul>
</div>
Please change the css as on the given snippet
#stages_cont {
margin:50px auto;
width:600px;
}
#stages {
background:#d4d7df;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
height:5px;
}
#stages li {
float:left;
text-align:center;
width:33%;
}
#stages li a {
-moz-border-radius:50%;
-webkit-border-radius:50%;
border-radius:50%;
display:block;
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
text-decoration:none;
}
.stage_done .stage_circle {
background:#2585fe;
border:6px solid #ffffff;
box-shadow:0px 0px 5px #d4d7df;
height:20px;
width:20px;
margin:-13px auto 10px;
}
.stage_not .stage_circle {
background: #d4d7df;
height: 20px;
text-align: center;
width: 20px;
margin: auto;
/* margin: -8px auto 17px; */
-moz-transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 40px;
}
li.stage_not {
position: relative;
}
.stage_done .stage_link {
color:#2585fe;
}
.stage_not .stage_link {
color:#d4d7df;
}
.clr {
clear:both;
}
.stage_not:hover .stage_circle {
background:#2585fe;
border:6px solid #ffffff;
box-shadow:0px 0px 5px #d4d7df;
}
.stage_not a.stage_link {
padding-top: 29px;
}
<link rel="stylesheet" type="text/css" href="https://meyerweb.com/eric/tools/css/reset/reset.css" />
<div id="stages_cont">
<ul id="stages">
<li class="stage_done">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Details</a>
</li>
<li class="stage_done">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Content</a>
</li>
<li class="stage_not">
<a class="stage_circle" href="#"></a>
<a class="stage_link" href="#">Send or Schedule</a>
</li>
<div class="clr"></div>
</ul>
</div>
Cool :)
Add a CSS animation to your hover
.stage_not:hover .stage_circle {
animation-name: example;
animation-duration: 0.5s;
}
#keyframes example {
from {width:0px; border:none;}
to {width:20px; border: 2px solid white;}
}
Clearly this needs some finessing, but a start at least.
https://www.w3schools.com/css/css3_animations.asp
You need to do minor changes in css for smooth experience. Here i am sharing what you need to change.
Add animation to "#stages li" css.
#stages li{
transition: 0.3s ease-in-out all;
}
#stages li a{
border: 6px solid #ffffff;
margin: -13px auto 10px;
}
.stage_not:hover .stage_circle{
background: #2585fe;
box-shadow: 0px 0px 5px #d4d7df;
}
#stages li a + a{
margin-top: 10px;
}
Please, advise how to make circle around the bullet using CSS, when the bullet (slide) is active?
Right now my css code is:
.slide-dot {
cursor: pointer;
height: 10px;
width: 10px;
text-decoration: none;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
}
.active {
background-color: #FFE600;
}
Example:
Add padding and transparent border to the dot. Use background-clip: content-box to prevent the background from effect the padding and border area. Change the color of the border to currentColor when active.
Note: I've used currentColor to control the background and border via one property.
.slide-dot {
cursor: pointer;
height: 10px;
width: 10px;
text-decoration: none;
color: #bbb;
background-color: currentColor;
border-radius: 50%;
display: inline-block;
padding: 5px;
background-clip: content-box;
border: 1px solid transparent;
}
.active {
color: #FFE600;
border-color: currentColor;
}
<div class="slide-dot"></div>
<div class="slide-dot active"></div>
<div class="slide-dot"></div>
<div class="slide-dot"></div>
<div class="slide-dot"></div>
div {
margin-top: 50px;
}
.dot {
cursor: pointer;
height: 12px;
width: 12px;
margin: 0 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.active,
.dot:hover {
background-color: black;
border: 1px solid yellow;
border-radius: 50%;
position: relative;
box-shadow: 0 0 0 1px #cfd1d1;
}
<!-- The bullets -->
<div style="text-align:center">
<span class="dots"><span class="dot" onclick="currentSlide(1)"></span></span>
<span class="dots"><span class="dot" onclick="currentSlide(2)"></span></span>
<span class="dots"><span class="dot" onclick="currentSlide(3)"></span></span>
</div>
Hope you can get some idea through this :)
I have a some basic button styles where on :hover I add the letter-spacing property:
.btn {
display: inline-block;
text-align: center;
background-color: transparent;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
font-size: 1rem;
border-radius: 0.25rem;
cursor: pointer;
transition: all 0.2s ease;
}
.btn-primary {
background-color: #8065F1;
color: #FFFFFF;
}
.btn-large {
border-radius: 32px;
box-shadow: 0 2px 80px 0 rgba(74, 74, 74, 0.23);
padding: 0.25rem 3rem;
font-size: 1.5rem;
text-transform: uppercase;
}
.btn:hover {
letter-spacing: 4px;
}
<button type="button" class="btn btn-primary btn-large">Lorem</button>
Is there a way that width doesn't expand? Like adding min/max-width? However the problem is that button elements can contain different string length:
.btn {
display: inline-block;
text-align: center;
background-color: transparent;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
box-shadow: 0 2px 80px 0 rgba($grey, 0.23);
font-size: 1rem;
border-radius: 0.25rem;
cursor: pointer;
transition: all 0.2s ease;
}
.btn-primary {
background-color: #8065F1;
color: #FFFFFF;
}
.btn-large {
border-radius: 32px;
-webkit-box-shadow: 0 2px 80px 0 rgba(74, 74, 74, 0.23);
box-shadow: 0 2px 80px 0 rgba(74, 74, 74, 0.23);
padding: 0.25rem 3rem;
font-size: 1.5rem;
text-transform: uppercase;
min-width: 240px;
}
.btn:hover {
letter-spacing: 4px;
}
<p>I need this "effect" (I added some min-width):</p>
<button type="button" class="btn btn-primary btn-large">Lorem</button>
<p>However it won't work for larger strings</p>
<button type="button" class="btn btn-primary btn-large">Lorem Ipsum</button><br><br>
<button type="button" class="btn btn-primary btn-large">Lorem Ipsum Dolor</button>
I know I can use JS and append the elements fixed width to it, however I'm looking for a CSS solution - if there is one?
On idea to approximate this is to duplicate the text considering a hidden one that has already the letter-spacing and another one on the top that you animate to fill the space already defined by the hidden text:
Here is an idea by making the text color the same as background:
.btn {
display: inline-block;
text-align: center;
background-color: transparent;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
font-size: 1rem;
border-radius: 0.25rem;
cursor: pointer;
transition: all 0.2s ease;
margin-bottom:10px;
}
.btn-primary {
background-color: #8065F1;
color: #FFFFFF;
}
.btn-large {
border-radius: 32px;
box-shadow: 0 2px 80px 0 rgba(74, 74, 74, 0.23);
padding: 0.25rem 3rem;
font-size: 1.5rem;
text-transform: uppercase;
}
.btn::before {
content:attr(data-text);
position:absolute;
left:0;
right:0;
text-align:center;
letter-spacing: initial;
color:#fff;
transition: all 0.2s ease;
}
.btn {
letter-spacing: 4px;
color:#8065F1;
position:relative;
}
.btn:hover::before {
letter-spacing: 4px;
}
<div><button type="button" class="btn btn-primary btn-large" data-text="Lorem">Lorem</button></div>
<div><button type="button" class="btn btn-primary btn-large" data-text="Lorem Ipsum">Lorem Ipsum</button></div>
<div><button type="button" class="btn btn-primary btn-large" data-text="Lorem Ipsum Dolor">Lorem Ipsum Dolor</button></div>
Another one using opacity and both pseudo element in case the background is not a solid color:
.btn {
display: inline-block;
text-align: center;
background-color: transparent;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
font-size: 1rem;
border-radius: 0.25rem;
cursor: pointer;
transition: all 0.2s ease;
margin-bottom:10px;
}
.btn-primary {
background: linear-gradient(#8065F1,purple);
color: #FFFFFF;
}
.btn-large {
border-radius: 32px;
box-shadow: 0 2px 80px 0 rgba(74, 74, 74, 0.23);
padding: 0.25rem 3rem;
font-size: 1.5rem;
text-transform: uppercase;
}
.btn {
position:relative;
font-size:0;
}
.btn::before {
content:attr(data-text);
position:absolute;
left:0;
right:0;
text-align:center;
letter-spacing: initial;
font-size: 1.5rem;
transition: all 0.2s ease;
}
.btn::after {
content:attr(data-text);
letter-spacing: 4px;
opacity:0;
font-size: 1.5rem;
}
.btn:hover::before {
letter-spacing: 4px;
}
<div><button type="button" class="btn btn-primary btn-large" data-text="Lorem">Lorem</button></div>
<div><button type="button" class="btn btn-primary btn-large" data-text="Lorem Ipsum">Lorem Ipsum</button></div>
<div><button type="button" class="btn btn-primary btn-large" data-text="Lorem Ipsum Dolor">Lorem Ipsum Dolor</button></div>
How about turning off box-sizing, then using a percentage for your padding? It should work well no matter what the size of your contents is, but my numbers are probably wrong so you'll need to adjust the numbers to make it accurate.
.wrapper{
display:inline-block;
}
button{
box-sizing: content-box;
padding: 0 10.4%;
border: none;
width: 100%;
font-size:13px;
}
button:hover{
letter-spacing:0.1em;
padding:0;
}
.outer-wrapper{
}
<div class="outer-wrapper">
<div class="wrapper">
<button class='button'>Small Text</button>
</div>
</div>
<div class="outer-wrapper">
<div class="wrapper">
<button class='button'>Much much bigger text</button>
</div>
</div>
<div class="outer-wrapper">
<div class="wrapper">
<button class='button'>Small TextSmall TextSmall TextSmall TextSmall Text</button>
</div>
</div>
Edit: Well, it's...more or less working, except that it turns out to be impossible. No matter how finely I tune it, I'm getting problems because of differences in browser rendering of sub-pixels. (The browser apparently rounds rem differently than it does %, which means this is going to be impossible to do with pure CSS.)
I am making top navigation with CSS. Some of the buttons are floated to the left, and some of them to the right. There is empty gap-button in-between. How to make that gap auto-expandable so the whole top navigation takes 100% of the page?
Here is a link for an example image:
HTML:
<div class="row clearfix">
<div class="top_nav">
<ul>
<li>
<div class="ui-nav-button first">
<a class="button first" href="#"><i class="icon-home"></i></a>
</div>
</li>
<li>
<div class="ui-nav-button">
<a class="button" href="#">About</a>
</div>
</li>
<li>
<div class="ui-nav-button">
<a class="button" href="#">Contact</a>
</div>
</li>
<li>
<div class="ui-nav-button">
<a class="button empty">.</a>
</div>
</li>
<li>
<div class="ui-nav-button">
<a class="button dropdown" href="#">Hi, Michael<i class="icon-sort-down"></i></a>
</div>
</li>
<li>
<div class="ui-nav-button last">
<a class="button logout last" href="#"><i class="icon-off"></i></a>
</div>
</li>
</ul>
</div>
</div>
CSS:
/* Clear fix */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
.top_nav ul {
list-style: none;
padding: 0;
margin: 0;
}
.top_nav ul li {
display: inline;
}
div[class*="ui"] {
vertical-align: top;
display: -moz-inline-stack;
float: left;
position: relative;
height: 44px;
margin-bottom: 3px;
background-color: #444444;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
zoom: 1;
*display: inline;
}
.top_nav a.button, .top_nav div[class*="ui"] {
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
.button {
float: left;
position: relative;
bottom: 3px;
height: 28px;
line-height: 32px;
padding: 8px 30px;
background-color: #f7f7f7;
text-decoration: none;
letter-spacing: 0.1em;
color: #777777;
font-weight: bold;
border-left: 1px solid #cecece;
font-family: sans-serif;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.input:focus {
outline: none;
border-color: #9d9d9d;
}
.button i {
position: relative;
line-height: 23px;
top: 1px;
}
.dropdown_nav {
display: none;
}
/* Set your empty space with */
.button.empty {
width: auto;
text-indent: -9999px;
}
.button.dropdown i {
margin-left: 15px;
margin-right: -15px;
}
.button.first, div[class*="ui"].first {
border: 0px;
-webkit-border-top-left-radius: 3px !important;
-webkit-border-bottom-left-radius: 3px !important;
-moz-border-radius-topleft: 3px !important;
-moz-border-radius-bottomleft: 3px !important;
border-top-left-radius: 3px !important;
border-bottom-left-radius: 3px !important;
}
.button.last, div[class*="ui"].last {
-webkit-border-top-right-radius: 3px !important;
-webkit-border-bottom-right-radius: 3px !important;
-moz-border-radius-topright: 3px !important;
-moz-border-radius-bottomright: 3px !important;
border-top-right-radius: 3px !important;
border-bottom-right-radius: 3px !important;
}
.button.first, .button.last {
padding: 8px 15px;
}
.button[href]:hover {
bottom: 4px;
-webkit-transition-property: top, bottom;
-moz-transition-property: top, bottom;
-o-transition-property: top, bottom;
-ms-transition-property: top, bottom;
transition-property: top, bottom;
-webkit-transition-duration: 0.05s;
-moz-transition-duration: 0.05s;
-o-transition-duration: 0.05s;
-ms-transition-duration: 0.05s;
transition-duration: 0.05s;
}
.button[href]:active {
bottom: 0px;
}
.button i {
font-size: 19px;
}
CSS/HTML link: http://jsfiddle.net/xRCqx/.
Here's the clean code.
HTML:
<div class="row clearfix">
<div class="top_nav">
<ul>
<li>
<div class="ui-nav-button">
<a class="button" href="#">About</a>
</div>
</li>
<li>
<div class="ui-nav-button">
<a class="button" href="#">Contact</a>
</div>
</li>
<li>
<div class="ui-nav-button">
<a class="button dropdown" href="#">Hi, Michael<i class="icon-sort-down"></i></a>
</div>
</li>
</ul>
</div>
</div>
CSS:
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
.top_nav ul {
list-style: none;
padding: 0;
margin: 0;
}
.top_nav ul li {
display: inline;
}
div[class*="ui"] {
vertical-align: top;
display: -moz-inline-stack;
float: left;
position: relative;
height: 44px;
margin-bottom: 3px;
background-color: #444444;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
zoom: 1;
*display: inline;
}
.top_nav a.button, .top_nav div[class*="ui"] {
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
.button {
float: left;
position: relative;
bottom: 3px;
height: 28px;
line-height: 32px;
padding: 8px 30px;
background-color: #f7f7f7;
text-decoration: none;
letter-spacing: 0.1em;
color: #777777;
font-weight: bold;
border-left: 1px solid #cecece;
font-family: sans-serif;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.input:focus {
outline: none;
border-color: #9d9d9d;
}
.button i {
position: relative;
line-height: 23px;
top: 1px;
}
.dropdown_nav {
display: none;
}
/* Set your empty space with */
.button.empty {
width: auto;
text-indent: -9999px;
}
.button.dropdown i {
margin-left: 15px;
margin-right: -15px;
}
.button.first, div[class*="ui"].first {
border: 0px;
-webkit-border-top-left-radius: 3px !important;
-webkit-border-bottom-left-radius: 3px !important;
-moz-border-radius-topleft: 3px !important;
-moz-border-radius-bottomleft: 3px !important;
border-top-left-radius: 3px !important;
border-bottom-left-radius: 3px !important;
}
.button.last, div[class*="ui"].last {
-webkit-border-top-right-radius: 3px !important;
-webkit-border-bottom-right-radius: 3px !important;
-moz-border-radius-topright: 3px !important;
-moz-border-radius-bottomright: 3px !important;
border-top-right-radius: 3px !important;
border-bottom-right-radius: 3px !important;
}
.button.first, .button.last {
padding: 8px 15px;
}
.button[href]:hover {
bottom: 4px;
-webkit-transition-property: top, bottom;
-moz-transition-property: top, bottom;
-o-transition-property: top, bottom;
-ms-transition-property: top, bottom;
transition-property: top, bottom;
-webkit-transition-duration: 0.05s;
-moz-transition-duration: 0.05s;
-o-transition-duration: 0.05s;
-ms-transition-duration: 0.05s;
transition-duration: 0.05s;
}
.button[href]:active {
bottom: 0px;
}
.button i {
font-size: 19px;
}