I'm gonna add my own icons on top of each section in menubar, for example: Home icon on top of home, or Car icon on top of Cars, and etc, now it's showing in left side
I tried all suggested ways but icons don't show on top of menu. how can I solve it?
Here is my code:
.navbar-wrapper2{min-height:0px; background:white; border-bottom:0px solid #cccccc; box-shadow: 0 0 5px rgba(0, 0, 0, 0.13); padding-bottom:0px;}
#media (min-width: 992px) {
.navbar-wrapper2{min-height:110px; background:white; border-bottom:0px solid #cccccc; box-shadow: 0 0 5px rgba(0, 0, 0, 0.13); padding-bottom:0px;}
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet"/>
<div class="navbar navbar-fixed-top navbar-default ">
<div class="container">
<div class="navbar">
<!-- Navigation-->
<div class="navbar-header go-right">
<button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="http://www.sothink.com/page/logo-design/images/company-logo10.jpg" alt="" class="moto">
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right go-left">
<li class="dropdown active go-right">
<a class="dropdown-toggle" href=""> Home </a>
</li>
<li class="go-right ">
<a href="m/hotels" class="" target="_self">
<!--<i class='fa fa-building'></i>--> Hotels </a>
</li>
<li class="go-right ">
<a href="/tours" class="" target="_self">
<!--<i class='fa fa-briefcase'></i>--> Tours </a>
</li>
<li class="go-right ">
<a href="/cars" class="" target="_self">
<!--<i class='fa fa-car'></i>--> Cars </a>
</li>
<li class="go-right ">
<a href="/offers" class="" target="_self">
<!--<i class='fa fa-gift'></i>--> Offers </a>
</li>
<li class="go-right ">
<a href="/blog" class="" target="_self">
<!--<i class='fa fa-building'></i>--> Blog </a>
</li>
<li class="go-right ">
<a href="/flightsd" class="" target="_self">
<!--<i class='fa fa-building'></i>--> Flights </a>
</li>
<li class="go-right ">
<a href="/contact-us" class="" target="">
<!--<i class='glyphicon glyphicon-phone-alt'></i>--> Contact </a>
</li>
<form class="dropdown pull-right">
<div class="styled-select">
<select onchange="change_currency(this.value)" class="selectx" style="margin-top:10px;font-weight: 100;height: 2.3em;" name="currency" id="currency">
<option value="1" selected="">US Dollar</option>
<option value="3">GB Pound</option>
<option value="9">SR Saudi</option>
</select>
</div>
<div class="clearfix"></div>
</form>
<li class="dropdown pull-right">
<a style="border-bottom: 0px;" href="javascript: void();" class="dropdown-toggle" data-toggle="dropdown"><img src="/uploads/images/language/en.png" alt="English" height="14" width="21"> English </a>
<ul style="display: none;" class="dropdown-menu">
<li><img src="http://findicons.com/files/icons/282/flags/48/united_states_of_america_usa.png" alt="" height="14" width="21"> English</li>
<li><img src="http://icons.iconarchive.com/icons/gosquared/flag/64/Russia-icon.png" alt="" height="14" width="21"> Russia</li>
</ul>
</li>
<li class="dropdown pull-right">
My Account <b class="lightcaret mt-2"></b>
<ul style="display: none;" class="dropdown-menu">
<li> Login</li>
<li> Sign Up</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
I highly appreciate it and thank you
you used inline element, so they are showed beside of each.
you should use block elements to take element down.
for example add <p> tag to Hotels
<li class="go-right ">
<a href="m/hotels" class="" target="_self">
<i class='fa fa-building'></i><p>Hotels</p> </a>
</li>
and if you want icons go center of buttons:
add text-align:center; to the parent class of font-awesome <i> tags.
please see this link and notice to editfromStack :
http://jsbin.com/kewahadike/edit?output
or you can add <span> to words like hotel and use span{display:block;} on stylesheet
please see this link:
http://jsbin.com/kumuvenanu/edit?html,output
Related
I want to have a layout that has a header and a fotoer and between header and footer there are some list items with posts. Im using bootstrap, I want the header to look like this:
But its not working, its showing like this: https://jsfiddle.net/83vnj5ru/1/.
The search icon dont have a background white color and the Filter 1 and Filter 2 dropdowns are not aligned at the right like in the image. Do you know why?
HTML:
<div class="container py-5">
<div class="row">
<div class="col">
<ul class="list-group forum">
<li class="list-group-item bg-custom-light2 py-4">
<div class="row">
<form class="col-5">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-search"></i></span>
</div>
<input type="email" class="form-control" id="exampleInputEmail1"
aria-describedby="emailHelp" placeholder="Search">
</div>
</div>
</form>
</div>
<div class="col-7 text-right">
<div class="dropdown">
<a class="dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Filter 1
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">item1</a>
</div>
</div>
<div class="dropdown">
<a class="dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Filter 2
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">item1</a>
</div>
</div>
</div>
</li>
<li class="list-group-item">list item 1</li>
<li class="list-group-item">list item 2</li>
<li class="list-group-item bg-custom-light2 py-4">container footer</li>
</ul>
</div>
</div>
</div>
CSS:
.bg-custom-light2{
background-color: #fafafa;
}
.input-group-text, .input-group-prepend{
background-color:none;
}
.input-group-text{
color:gray;
}
See if it helps you
.bg-custom-light2{
background-color: #fafafa;
}
.input-group-text, .input-group-prepend{
background-color:none;
}
.input-group-text{
color:gray;
}
.filters{
width: auto;
display: inline-block;
}
.search-icon{
background-color: #ffffff !important;
border: 1px solid #ced4da !important;
border-right: 1px solid transparent !important;
}
.search-input{
border-left: 1px solid transparent !important;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<div class="container py-5">
<div class="row">
<div class="col">
<ul class="list-group forum">
<li class="list-group-item bg-custom-light2 py-4">
<div class="row">
<form class="col-5">
<div class="form-group">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text search-icon"><i class="fa fa-search"></i></span>
</div>
<input type="email" class="form-control search-input" id="exampleInputEmail1"
aria-describedby="emailHelp" placeholder="Search">
</div>
</div>
</form>
<div class="col-7 text-right">
<div class="dropdown filters">
<a class="dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Filter 1
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">item1</a>
</div>
</div>
<div class="dropdown filters">
<a class="dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Filter 2
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">item1</a>
</div>
</div>
</div>
</div>
</li>
<li class="list-group-item">list item 1</li>
<li class="list-group-item">list item 2</li>
<li class="list-group-item bg-custom-light2 py-4">container footer</li>
</ul>
</div>
</div>
</div>
What I am trying to achieve is this:
Without using javascript/jquery.
I have a topbar and a sidebar. On smaller screens, I want the sidebar to collapse and have a button on top, and when the button is clicked the sidebar toggles horizontally, adding opacity to the background, putting the button on the topbar, and putting all content from within the topbar inside the sidebar.
Similar to when the screen is small for Youtube page, and the sign in option appears on the sidebar.
This is the code I have so far :JSFIDDLE
<header>
<nav class="navbar navbar-expand-sm fixed-top navbar-light bg-faded">
<button class="navbar-toggler " type="button" data-toggle="collapse" data-target="#sidebar" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<img class="navbar-brand navbar-logo" src="" />
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav ml-auto user-info">
<li class="avatar">
<img src="">
</li>
<li class="nav-item dropdown">
<a class="nav-link ">Hello</a>
</li>
</ul>
</div>
</nav>
</header>
<div class="container-fluid">
<div id="mySidenav">
<nav class="col-sm-3 col-md-3 col-6 col-lg-2 d-sm-block sidebar collapse
width " id="sidebar">
<ul class="nav nav-pills flex-column">
<li class="nav-item collapsed side" data-toggle="collapse" data-target="#home">
<a class="nav-link">
<img src="" />Home </a>
</li>
<ul class="sub-menu collapse" id="home">
<li class="nav-item list-unstyled">
<a class="nav-link">Submenu1</a>
</li>
<li class="nav-item list-unstyled">
<a class="nav-link">Submenu2</a>
</li>
<li class="nav-item list-unstyled">
<a class="nav-link">Submenu3</a>
</li>
<li class="nav-item list-unstyled">
<a class="nav-link">Submenu4</a>
</li>
</ul>
<li class="nav-item side">
<a class="nav-link">
<img src="a" />Menu Item</a>
</li>
<li class="nav-item side">
<a class="nav-link">
<img src="" />Menu Item</a>
</li>
<li class="nav-item side">
<a class="nav-link">
<img src="" />Menu Item</a>
</li>
<li class="nav-item side">
<a class="nav-link">
<img src="" />Menu Item</a>
</li>
</ul>
</nav>
</div>
<main role="main" class="col-sm-9 ml-sm-auto col-md-9 col-lg-10 pt-3 content">
<h1>
Main Content here
</h1>
</main>
</div>
in your JSFiddle change css (top has to be 0px) : JsFiddle
.sidebar {
position: fixed;
top: 0px;
left: 0;
z-index: 1;
padding: 0;
overflow-x: hidden;
/* Scrollable contents if viewport is shorter than content. */
border-right: 1px solid #eee;
background-color: black;
height: 100%;
}
I realize this question has answers that have worked for some but try as I may, I cannot remove this annoying border.
I have tried the following CSS:
.nav-container{
border-width:0;
box-shadow:none;
background-color: aliceblue;
}
.navbar {
background-color: #99ccff;
border: 0;
}
Although the background-color does get set, the border remains.
Here is the site.
index.html:
html,
body {
background-color: aliceblue;
}
.nav-container {
border-width: 0;
box-shadow: none;
background-color: aliceblue;
}
.navbar {
background-color: #99ccff;
border: 0;
}
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap-theme.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<header>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid nav-container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#Writers-Tryst">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div style="display: inline-block">
<a class="navbar-brand" href="#">
<img id="logo" src="img/writers-tryst-logo-min.png" alt="logo" />
</a>
<br/>
<br/>
<div id="shares" class="row">
<!-- Twitter -->
<a href="http://twitter.com/share?url=writers.tryst.ron-tornambe.com&text=<TEXT>&via=<VIA>" target="_blank" title="twitter" class="share-btn twitter">
<i class="fa fa-twitter"></i>
</a>
<!-- Facebook -->
<a href="http://www.facebook.com/sharer/sharer.php?u=http://writers.tryst.com" target="_blank" title="facebook" class="share-btn facebook">
<i class="fa fa-facebook"></i>
</a>
<!-- StumbleUpon (url, title)
<a href="http://www.stumbleupon.com/submit?url=http://writers.tryst.com&title=<TITLE>" target="_blank" class="share-btn stumbleupon" title="stumble-upon">
<i class="fa fa-stumbleupon-circle"></i>
</a> -->
<!-- Reddit (url, title)
<a href="http://reddit.com/submit?url=http://writers.tryst.com&title=<TITLE>" target="_blank" class="share-btn reddit" title="reddit">
<i class="fa fa-reddit-square"></i>
</a> -->
<!-- LinkedIn -->
<a href="http://www.linkedin.com/shareArticle?url=http://writers.tryst.com&title=<TITLE>&summary=<SUMMARY>&source=<SOURCE_URL>" target="_blank" title="linked-in" class="share-btn linkedin">
<i class="fa fa-linkedin"></i>
</a>
<!-- Google Plus -->
<a href="https://plus.google.com/share?url=writers.tryst.ron-tornambe.com" target="_blank" title="google+" class="share-btn google-plus">
<i class="fa fa-google-plus"></i>
</a>
</div>
</div>
</div>
<!--navbar-header-->
<div class="collapse navbar-collapse" id="Writers-Tryst">
<ul class="nav navbar-nav">
<li class="active"><a id="homepage" href="#/"><i class="acctive glyphicon glyphicon-home fa fa-home"></i> Home</a>
</li>
<li> Writers
</li>
<li> Enablers
</li>
<li> About
</li>
<li> Privacy/Rules
</li>
<li> Contact
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a id="login" href="#log-in"><i class="fa fa-sign-in"></i> Log-In</a>
</li>
<li><a id="accounts-link" href="#accounts"><i class="fa fa-user hidden"></i> Create Account</a>
</li>
<li class="dropdown" data-toggle="popover" data-trigger="hover" data-placement="bottom">
<button class="btn btn-custom-primary dropdown-toggle fa fa-user" style="margin-top: 8px; color: white;" data-html="true" type="button" id="user-dropdown-link" data-toggle="dropdown"><span class="caret"></span>
</button>
</a>
<ul class="dropdown-menu" role="menu" data-aria-labelledby="create-account-link">
<li><a id="update-profile" href="#update-profile" class="fa fa-database"> Update profile</a>
</li>
<li><a id="manage-uploads" href="#manage-uploads" class="fa fa-book"> Manage uploads</a>
</li>
<li><a id="review-submissions" href="#review-submissions" class="fa fa-book"> Review Submissions</a>
</li>
<li><a id="update-submissions" href="#update-submissions" class="fa fa-book"> Update Reviews</a>
</li>
</ul>
</li>
<li>
<a id="reset-pwd-link" href="#reset-pwd"></a>
</li>
</ul>
</div>
<!--navbar-collapse-->
</div>
<!--container fluid-->
</nav>
</header>
<div>
<div id="message" class="alert m-t-10 m-b-10"></div>
<div id="main" class="content container">
<!-- angular templating -->
<!-- this is where content will be injected -->
<div data-ng-view></div>
</div>
<footer class="panel panel-default panel-transparent">
<div id="footer" class="text-right small">© 2016 Ronald Tornambe, Inc.</div>
</footer>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
There is a box shadow added by the bootstrap theme. The following rules will remove it as well as on the .navbar-collapse class when the nav is under 768px.
Note: you have a stray tag after the fa fa-user button and are (possibly) using normalize.css twice since Bootstrap3 uses a version of it all ready. See normalize.less.
.navbar.navbar-default {
background-color: #99ccff;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar.navbar-default .navbar-collapse {
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
Before with box-shadow:
After removing the box-shadow:
Working Example:
/*FOR DEMO ONLY*/
html,
body {
background: aliceblue;
}
/*FOR DEMO ONLY*/
.nav-container {
border-width: 0;
box-shadow: none;
background-color: aliceblue;
}
.navbar.navbar-default {
background-color: #99ccff;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.navbar.navbar-default .navbar-collapse {
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap-theme.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<header>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid nav-container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#Writers-Tryst">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div style="display: inline-block">
<a class="navbar-brand" href="#">
<img id="logo" src="https://writers-tryst.com//img/writers-tryst-logo-min.png" alt="logo" />
</a>
<br/>
<br/>
<div id="shares" class="row">
<a href="http://twitter.com/share?url=writers.tryst.ron-tornambe.com&text=<TEXT>&via=<VIA>" target="_blank" title="twitter" class="share-btn twitter">
<i class="fa fa-twitter"></i>
</a>
<a href="http://www.facebook.com/sharer/sharer.php?u=http://writers.tryst.com" target="_blank" title="facebook" class="share-btn facebook">
<i class="fa fa-facebook"></i>
</a>
<a href="http://www.linkedin.com/shareArticle?url=http://writers.tryst.com&title=<TITLE>&summary=<SUMMARY>&source=<SOURCE_URL>" target="_blank" title="linked-in" class="share-btn linkedin">
<i class="fa fa-linkedin"></i>
</a>
<a href="https://plus.google.com/share?url=writers.tryst.ron-tornambe.com" target="_blank" title="google+" class="share-btn google-plus">
<i class="fa fa-google-plus"></i>
</a>
</div>
</div>
</div>
<div class="collapse navbar-collapse" id="Writers-Tryst">
<ul class="nav navbar-nav">
<li class="active"><a id="homepage" href="#/"><i class="acctive glyphicon glyphicon-home fa fa-home"></i> Home</a>
</li>
<li> Writers
</li>
<li> Enablers
</li>
<li> About
</li>
<li> Privacy/Rules
</li>
<li> Contact
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a id="login" href="#log-in"><i class="fa fa-sign-in"></i> Log-In</a>
</li>
<li><a id="accounts-link" href="#accounts"><i class="fa fa-user hidden"></i> Create Account</a>
</li>
<li class="dropdown" data-toggle="popover" data-trigger="hover" data-placement="bottom">
<button class="btn btn-custom-primary dropdown-toggle fa fa-user" style="margin-top: 8px; color: white;" data-html="true" type="button" id="user-dropdown-link" data-toggle="dropdown"><span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" data-aria-labelledby="create-account-link">
<li><a id="update-profile" href="#update-profile" class="fa fa-database"> Update profile</a>
</li>
<li><a id="manage-uploads" href="#manage-uploads" class="fa fa-book"> Manage uploads</a>
</li>
<li><a id="review-submissions" href="#review-submissions" class="fa fa-book"> Review Submissions</a>
</li>
<li><a id="update-submissions" href="#update-submissions" class="fa fa-book"> Update Reviews</a>
</li>
</ul>
</li>
<li>
<a id="reset-pwd-link" href="#reset-pwd"></a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div>
<div id="message" class="alert m-t-10 m-b-10"></div>
<div id="main" class="content container">
<div data-ng-view></div>
</div>
<footer class="panel panel-default panel-transparent">
<div id="footer" class="text-right small">© 2016 Ronald Tornambe, Inc.</div>
</footer>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
simply apply box-shadow: none; in navbar
You have several declarations for the CSS box-shadow property on the .navbar-default element. If you remove all of those the border will be gone.
The only solution that is working for me is inline css with !important property:
border: none !important; outline: none !important;
inside navbar-toggler:
<button class="navbar-toggler" style="border: none !important; outline: none !important;"
type="button" data-toggle="collapse" data-target="#collapsingNavbar">
I'm having difficulty to centering my navbar brand logo.
currently, my logo will align far to the left.
what I want actually to align it center from the first link. Kindly find below for the sample :
Please find below my code at JSFiddle
http://jsfiddle.net/QSa8v/3/
<div id="navbar">
<nav role="navigation" class="navbar-custom">
<div class="navbar-header">
<button data-toggle="collapse" data-target="#ren-nav-collapse" class="navbar-toggle">
<span class="sr-only">
Toggle navigation
</span>
<span class="icon-bar" />
<span class="icon-bar" />
<span class="icon-bar" />
</button>
<a href="#" class="navbar-brand">
<img src="http://i.imgur.com/CMEnIo7.png" />
</a>
</div>
<div class="collapse navbar-collapse" id="ren-nav-collapse">
<ul class="nav navbar-nav">
<li>
LINK 1
</li>
<li>
LINK 2
</li>
<li>
LINK 3
</li>
<li>
LINK 4
</li>
<li>
LINK 5
</li>
<li>
LINK 6
</li>
</ul>
</div>
</nav>
</div>
Really need your kind answer.
Look at here : http://jsfiddle.net/QSa8v/4/
HTML changes :
<div id="navbar">
<nav role="navigation" class="navbar-custom">
<div class="navbar-header col-xs-3 myheader"> // CHANGE HERE
<button data-toggle="collapse" data-target="#ren-nav-collapse" class="navbar-toggle">
<span class="sr-only">
Toggle navigation
</span>
<span class="icon-bar" />
<span class="icon-bar" />
<span class="icon-bar" />
</button>
<a href="#" class="navbar-brand mybrand"> // CHANGE HERE
<img src="http://i.imgur.com/CMEnIo7.png" />
</a>
</div>
<div class="collapse navbar-collapse" id="ren-nav-collapse">
<ul class="nav navbar-nav mybar"> // CHANGE HERE
<li>
LINK 1
</li>
<li>
LINK 2
</li>
<li>
LINK 3
</li>
<li>
LINK 4
</li>
<li>
LINK 5
</li>
<li>
LINK 6
</li>
</ul>
</div>
</nav>
</div>
CSS added :
.mybar {
margin-left:0px !important;
}
.mybrand{
float:none !important;
}
.myheader{
text-align: center;
padding: 1em;
}
Frustratingly not been able to resolve the CSS3 pseudo element 'last-child' that isn't working with this custom drop down navigation menu that we're working on currently.
Each drop down menu can be assigned a number of columns, in this instance, I am wanting to apply a right hand border to each column (.col_1) within the div .dropdown_3column.
CSS Snippet
.dropdown_1column_simple {width: 100px;}
.dropdown_2column_simple {width: 155px;}
.dropdown_1column {width: 550px;}
.dropdown_2column {width: 650px;}
.dropdown_3column {width: 500px;}
.dropdown_4column {width: 800px;}
.dropdown_5column {width: 1000px;}
.dropdown_2column_simple .col_1 {width:155px;}
.dropdown_2column_simple .col_2 {width:155px;}
.col_1 {width:145px; border-right: 1px solid #888;}
.col_2 {width:240px;}
.col_3 {width:490px;}
.col_4 {width:440px;}
.col_5 {width:575px;}
.col_s {width:250px;}
.col_1,.col_2,.col_3,.col_4,.col_5 {
display:inline;
float: left;
position: relative;
margin-left: 5px;
margin-right: 5px;
/*border: 1px solid #000;*/
}
HTML Snippet
<div class="dropdown_3column align_left ">
<div class="col_3">
<div class="content_top"></div>
</div>
<div class="col_1">
<ul>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/addict-clothing.html">
<span class="level1">Addict Clothing </span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/atticus-clothing.html">
<span class="level1">Atticus Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/dephect-clothing.html">
<span class="level1">Dephect Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/dickies-clothing.html">
<span class="level1">Dickies</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/dta-clothing.html">
<span class="level1">DTA Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/famous-stars-and-straps-clothing.html">
<span class="level1">Famous Stars And Straps Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/fuct-clothing.html">
<span class="level1">FUCT Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/hex-accessories.html">
<span class="level1">HEX Accessories</span>
</a>
</li>
</ul>
</div>
<div class="col_1">
<ul>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/the-hundreds.html">
<span class="level1">The Hundreds</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/insight-clothing.html">
<span class="level1">Insight Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/jeepney-clothing.html">
<span class="level1">Jeepney Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/king-apparel.html">
<span class="level1">King Apparel</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/lrg-clothing.html">
<span class="level1">LRG Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/my-yard-clothing.html">
<span class="level1">My Yard</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/new-era-5950.html">
<span class="level1">New Era 5950 Hats and Apparel</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/pxl-clothing.html">
<span class="level1">PXL Clothing</span>
</a>
</li>
</ul>
</div>
<div class="col_1">
<ul>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/rebel8-clothing.html">
<span class="level1">REBEL8 Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/ringspun-clothing.html">
<span class="level1">Ringspun</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/rogue-status-clothing.html">
<span class="level1">Rogue Status </span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/the-wild-ones-clothing.html">
<span class="level1">The Wild Ones</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/volcom-clothing.html">
<span class="level1">Volcom Clothing</span>
</a>
</li>
<li class="level1">
<a href="http://009rep.clubnetdev.com/brands/zoo-york-clothing.html">
<span class="level1">Zoo York Clothing</span>
</a>
</li>
</ul>
</div>
<div class="col_3">
<div class="content_bottom"></div>
</div>
<div class="col_s">
<div class="content_side"></div>
</div>
</div>
A live version of the problem can be seen here. It is the 'Brands' dropdown in question that I am trying to remove the right hand border from the 3rd (last) column.
I'm aware of browser incompatibilities and other alternatives using JS / jQuery that exist perhaps but I'm only interested in trying to resolve this with the CSS.
I'm thinking perhaps this needs a fresh pair of eyes because I've tried tons of variations and not managed to select the last column within that drop down I believe.
Thanks in advance.
EDIT: I have attempted tons of variations but I think the issue is my inability to work out the last child of the parent item which doesn't count other divs too. I've been trying with the likes of:
div:last-child .col_1 {border-right: none !important;}
Thanks.
EDIT 2: Please find instance of my issue on JS Fiddle too if it helps anyone.
Thanks.
You are not using selectors right.
Here is a fix using nth-child:
http://jsfiddle.net/BUhgZ/3/