Bootstrap dropdown nav menu item wrap (wordpress) - css

Having trouble getting the submenu items under "LEARN" to wrap (Articles / Videos).
influentagency.com/clients/cgc_build_062117
I've pasted some of my SASS code, tried different things, but nothing seems to work. Added the wp_bootstrap_navwalker function, tried adding classes, does not wrap no matter what I try.
Any ideas what I'm missing here? Thanks in advance!
.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus {
color: #fff;
text-decoration: none;
outline: 0;
background-color: #777;
}
.dropdown-menu {
flex-wrap: wrap;
}
.navbar{
border-radius: 0;
webkit-border-radius: 0;
min-height: 1px;
margin-bottom: 0;
&.navbar-default {
border: none;
background: #fff;
padding: 0 15px;
#navbar-menu{
float: right;
&.navbar-collapse{
padding: 0;
margin: 0;
.navbar-nav{
float: none;
margin: 0;
padding: 0;
li{
display: inline-block;
float: none;
margin: 23px 0 0 0px;
a {
color: #333;
font-size: 14px;
display: block;
text-decoration: none;
#include OpenSansSemiBold;
padding: 4px 8px;
&:hover{
color: #9dcb94;
}
}
&.item-right{
margin-left: 25px;
a{
background: $green;
color: #fff;
border-radius: 2px;
padding: 10px 14px;
&:hover{
background: $green_hover;
}
}
&.current-menu-item,
&.current_page_item,
&.current-menu-ancestor,
&.current-page-ancestor {
a{
color: #fff;
}
}
}
&.current-menu-item,
&.current_page_item,
&.current-menu-ancestor,
&.current-page-ancestor {
a{
color: $green;
}
}
.sub-menu{
display: none;
}
}
}
}
}
}

The issue is that your css is making all menu items display-inline, even ones in the dropdown menus:
.navbar.navbar-default #navbar-menu.navbar-collapse .navbar-nav li{
display: inline-block;
/* other styles here also */
}
You need to include the following in your css to override that:
.navbar.navbar-default #navbar-menu.navbar-collapse .navbar-nav .dropdown-menu li{
display:block;
}
To do this, you need to add the following to your SASS:
.navbar-nav{
[...]
li{
display: inline-block;
[...]
}
.dropdown-menu li { display:block;}
}

Related

react-pagination styling in global css not working

i'm just learning react and wanted to used react-paginate for pagination purpose but the styling is not working atm even though i've already put the necessary css on my global css file(index.css)
<div id="react-paginate">
<ReactPaginate
previousLabel={'<'}
nextLabel={'>'}
breakLabel={...}
breakClassName={'break-me'}
pageCount={pageCount}
marginPagesDisplayed={2}
pageRangeDisplayed={10}
onPageChange={this.handlePageClick}
containerClassName={'pagination'}
subContainerClassName={'pages pagination'}
activeClassName={'active'}
/>
</div>
my css file
#react-paginate ul {
display: inline-block;
margin-left: 20px;
padding-left: 0;
}
#react-paginate li {
display: inline-block;
border: 1px solid rgb(224, 224, 224);
color: #000;
cursor: pointer;
margin-right: 3px;
border-radius: 5px;
margin-bottom: 5px;
}
#react-paginate li a {
padding: 2px 5px;
display: inline-block;
color: #000;
outline: none;
}
#react-paginate li.active {
background: rgb(224, 224, 224);
outline: none;
}
any help would be appreciated, thank you
If you are using bootstrap 4 use below classes
breakClassName={'page-item'}
breakLinkClassName={'page-link'}
containerClassName={'pagination'}
pageClassName={'page-item'}
pageLinkClassName={'page-link'}
previousClassName={'page-item'}
previousLinkClassName={'page-link'}
nextClassName={'page-item'}
nextLinkClassName={'page-link'}
activeClassName={'active'}
You can use bootstrap classes which are for bootstrap pagination as you have
containerClassName={'pagination'} /* as this work same as bootstrap class */
subContainerClassName={'pages pagination'} /* as this work same as bootstrap class */
activeClassName={'active'} /* as this work same as bootstrap class */
below css work for me. I put this css in app.global.css
.pagination > li {
display: inline-block;
padding-left: 0;
}
.pagination > li {
list-style: none;
border: 0.9px solid;
}
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.42857143;
text-decoration: none;
color: #2c689c;
background-color: #fff;
border: 1px solid #ddd;
margin-left: -1px;
}
.pagination>li.active>a {
color: #fff;
background-color: #218838;
border-color: #1e7e34;
}
/* Style the active class (and buttons on mouse-over) */
.pagination > li > a:hover {
background-color: #218838;
color: white;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
padding: 0px;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
display: none!important;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-bottom-right-radius: 4px;
margin-right: 0;
padding: 0px!important;
border-top-right-radius: 4px;
display: none!important;
}
id's dont work in react, we need to use refs instead if id.
I would recommend to use classes (className) in this case

How to selectively style certain li and ul elements?

I have designed a navigation bar for my website using the following CSS:
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #ff9933;
font-size:90%;
}
li {
float: left;
border-right: 1px solid #ffb366;
}
li a {
display: block;
color: white;
text-align: center;
padding-left: 10px;
padding-right: 10px;
padding-top: 3px;
padding-bottom: 3px;
text-decoration: none;
}
li a:hover {
background-color: #e67300;
}
</style>
This is a version of the horizontal navigation bar example documented at w3schools.com: http://www.w3schools.com/css/tryit.asp?filename=trycss_navbar_horizontal_black
My problem is that it affects other <li> and <ul> elements used in my website as well, not just the navbar. How do I ensure the navbar ones stay separate from other <li> and <ul> elements, using solely CSS? I've started learning CSS quite recently, so I'm certain I'm missing something pretty fundamental here.
Use may want to use css classes
http://www.w3schools.com/cssref/sel_class.asp
ul.mylist {
.....
}
ul.mylist li {
.....
}
ul.mylist li a {
.....
}
ul.mylist li a:hover {
.....
}
Also make sure to add the class to the html
<ul class='mylist'>
<li>......
Similar to man's answer, enclose the ul elements in a div and set the class of the div to navbar, for example. Then change your CSS code to this:
ul.navbar {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #ff9933;
font-size:90%;
}
ul.navbar li {
float: left;
border-right: 1px solid #ffb366;
}
ul.navbar li a {
display: block;
color: white;
text-align: center;
padding-left: 10px;
padding-right: 10px;
padding-top: 3px;
padding-bottom: 3px;
text-decoration: none;
}
ul.navbar li a:hover {
background-color: #e67300;
}
I'll modify your code to demonstrate how you can use classes to specify which ul tag you wish to style
<style>
ul.myNav {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #ff9933;
font-size:90%;
}
ul.myNav > li {
float: left;
border-right: 1px solid #ffb366;
}
ul.myNav > li a {
display: block;
color: white;
text-align: center;
padding-left: 10px;
padding-right: 10px;
padding-top: 3px;
padding-bottom: 3px;
text-decoration: none;
}
ul.myNav > li a:hover {
background-color: #e67300;
}
</style>
And all you have to do is add the class to your preferred ul element in your html.
<ul class="myNav"> .... </ul>
li:not(:first-child){
code...
}
li:not(:last-child){
code...

Style WordPress Vertical Navigation Drop Down

How can I remove the white border under the tag from this drop down menu? I only want it to appear when the drop down item is hovered.
Please see for the website. www.velnikolic.com/music Need to type more for limit to go down.
Current CSS
/* Navigation --------------------------------------- */
.main-menu li {
display: block;
font-weight: 10000;
text-transform: uppercase;
letter-spacing: 2px;
position: relative;
text-align:center;
padding:15px 70px;
margin-bottom:1px;
}
.main-menu li:hover {
display: block;
background:black;
color:white;
}
.main-menu li:hover a{
color:white;
border-bottom: 2px solid white;
}
ul.main-menu a {
margin-left: 0px;
text-align: center;
}
.main-menu > li:first-child { margin-top: 0; }
.main-menu ul { margin-left: 20px; }
.main-menu a { color: #999;
text-align:center;
}
.main-menu li a:hover,.main-menu li a:focus {
color:white;
}
.main-menu .current-menu-item > a,
.main-menu .current_page_item > a { color: white; }
li.current-menu-item{
background:black;
color:white;
}
.main-menu .current-menu-item:before,
.main-menu .current_page_item:before {
/*content: '\f405';
display: block;
font: 16px/1 "Genericons";
color: #019EBD;
position: absolute;
top: -1px;
left: -20px;*/
}
/* -------------------------------------------------------------------------------- */
/* User-Added-1. Drop Down Menu
/* -------------------------------------------------------------------------------- */
ul.sub-menu{
display: none;
}
li:hover .sub-menu {
background: #34495e;
border: #fff solid;
border-width: 1px;
display: block;
position: absolute;
left: 180px;
top: -1px;
}
you must be talking about text decoration property
try this :
text-decoration:none;
possible values are:
none
underline
overline
line-through
This should work:
ul.main-menu a
{
border-bottom: 0;
}
ul.main-menu a
{
border-bottom: 2px solid white;
}
EDIT: Try
Changing .main-menu li:hover a to .main-menu li:hover > a
and add the following:
.main-menu li:hover a
{
color: white;
}

Nav Pills Background Leak

I am looking to use navigation pills on my website, but they are resulting in a background leak. See the effect on this website: http://oleb.net/blog/2011/12/tutorial-how-to-sort-and-group-uitableview-by-date/. Hover over the pills multiple times to see the issue. You can see the outline of the pills appear.
Here is the code that I tried:
.navigation-main {
border-top: 1px solid rgba(0,0,0,0.1);
padding-top: 5px;
clear: both;
display: block;
font: 700 13px/1.3076923076 Lato, sans-serif;
letter-spacing: .05em;
text-transform: uppercase;
width: 100%;
}
.navigation-main .menu {
max-width: 1272px;
margin: 0 auto;
}
.navigation-main ul {
list-style: none;
margin: 0;
padding-left: 0;
text-align: center;
}
.navigation-main li {
display: inline-block;
position: relative;
width: 100px;
}
.navigation-main li:after {
content: none;
display: block;
font-size: 11px;
margin-top: -4px;
vertical-align: middle;
}
.navigation-main li:last-child:after {
content: none;
}
.navigation-main a {
display: block;
line-height: 2.6153846153;
padding: 0 10px;
text-decoration: none;
white-space: nowrap;
}
.navigation-main ul ul {
background-color: #000;
display: none;
float: left;
position: absolute;
top: 2.6153846153em;
left: 0;
text-align: left;
z-index: 99999;
}
.navigation-main li li {
display: block;
}
.navigation-main li li:after {
content: "";
display: block;
margin: 0;
}
.navigation-main ul ul ul {
left: 100%;
top: 0;
}
.navigation-main ul ul a {
color: #fff;
line-height: 1.3076923076;
padding: .6153846153em 10px .6923076923em;
white-space: normal;
width: 170px;
}
.navigation-main ul ul a:hover {
background-color: #333;
color: #fff;
}
.navigation-main ul li:hover > ul {
display: block;
}
/* This is where the pill happens */
.navigation-main a:hover,
.navigation-main li.current_page_item > a,
.navigation-main li.current-menu-item > a {
border-radius: 4px;
color: #FFFFFF;
background-color: #000;
}
How do I stop the outline from appearing? Thanks!
Edit:
Code tried:
.navigation-main li {
display: inline-block;
position: relative;
border-radius: 6px;
width: 100px;
.navigation-main a:hover,
.navigation-main li.current_page_item > a,
.navigation-main li.current-menu-item > a {
border-radius: 4px;
color: #FFFFFF;
background-color: #000;
background-clip: padding-box;
}
Try adding this to your css:
background-clip: padding-box;
Add it to any item using border-radius.
Here is exactly what you need to write change for your example. Tried and verified.
body > header nav li a:hover {
color: white;
background-color: #0a6abf;
background-clip: padding-box;
}
with background-clip
without background-clip

My menu is aligning with browser window, rather than content

I am in the process of creating a site using wordpress. (It can be seen here: http://www.adp-design-demos.com/brolim2/) However, the menu aligns with the side of the browser, rather than the content of my wordpress site. I have been through the CSS, and know where the menu CSS is, but at the moment all I've managed to do is move it by percentage.
Can anyone help me with the coding so that the menu appears in a fixed position regardless of window/browser size and location.
Cheers
The area I have been editing:
#header .nav {
background: #E0DCD9 url('images/bg_nav.png') repeat-x;
overflow: hidden;
}
#header .nav ul {
list-style-type: none;
margin: 0;
padding: 0;
}
#header .nav li {
float: left;
}
#header .nav li a {
display: block;
padding: 12px 18px 13px 18px;
font-size: 14px;
font-weight: bold;
text-transform: uppercase;
}
#header .nav li ul {
margin: 0;
padding: 0;
position: absolute;
margin-top: 26px;
}
#header .nav li li a {
font-size: 11px;
padding: 0;
margin: 0 0 0 20px;
}
#header .nav li li {
width: auto;
display: inline;
float: none;
}
#header .nav li li a:hover {
background: none;
}
#header .nav li a:hover, #header .nav .current_page_item a {
background: #4B3F33;
color: #fff;
}
#header .nav li ul {
display: none;
}
#header .nav .current_page_item ul {
display: block;
position: absolute;
left: 652px;
}
#header .nav .current_page_item ul li a {
background: none;
color: #666;
}
.nav_categories {
background: #f58220;
background-position: top center;
overflow: hidden;
}
.nav_categories ul {
width: 1000px;
margin: 0 auto 0 auto;
}
.nav_categories a {
display: block;
padding: 15px;
align: center;
font-size: 15px;
font-weight: bold;
text-transform: uppercase;
color: #fff;
}
.nav_categories li {
float:right;
position:relative;
left:-42%;
text-align:left;
}
.nav_categories .current-cat a, .nav_categories a:hover {
color: #4b3f33;
}
At first glance the alignment of your navigation looks correct (even after resizing). I looked at the demo site and inspected the html as well. I couldn't find .nav within #header. Can you provide me with the html you're working with?

Resources