This works:
.rightone ul {
list-style: none;
padding: 0px;
margin: 0px;
}
.rightone ul li {
display: block;
position: relative;
float:right;
}
.rightone li ul {
display: none;
}
.rightone ul li a {
display: block;
padding: 5px 30px 5px 30px;
text-decoration: none;
white-space: nowrap;
}
.rightone ul li li {
background-color: black;
border-radius:5px;
padding: 2%;
}
.rightone ul li a:hover {
color:#0ef2c4;
}
.rightone li:active ul {
display: block;
text-align: left;
position: absolute;
}
.rightone li:hover li {
float: none;
}
.rightone li:hover a {
color:#0ef2c4;
}
.rightone li:hover li a:hover {
color:white;
}
.arrow-down {
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-top: 8px solid #0ef2c4;
cursor: pointer;
}
But it work only when i hold... but i need, if i single click show that pop-up again click that arrow it will hide..
My output
I want to move that pop up left side also..
I want like this
https://jsfiddle.net/z4fej7gm/
But i dont know how apply to my project
Please anyone help me.. Thanks in advance
Css doesn't support click events
Related
I have an anchor button that links to a contact page on a website. It is inside a listed item tag and it is stretching the header top and the listed item tag. The anchor button currently looks like this:
<li><div id="contact_us">
FREE Boiler Evaluation
</div></li>
The CSS for the anchor button currently looks like this:
a.red-bg{
display: inline-block;
overflow:hidden;
padding: 0 10px;
}
But the CSS for the header looks like this:
.header-top {
background: #252525;
}
.header-top a {
line-height: 40px;
}
.header-top .header-search a.red-bg {
padding: 0 10px;
display: block;
}
.header-top .container {
position: relative;
}
.header-top ul li {
list-style: none;
}
.header-top ul {
margin: 0;
}
.header-top ul li, .header-search {
float: left;
margin-left: 25px;
}
.header-top ul li a {
color: #f5f5f5;
display: inline-block;
}
.header-top .red-bg {
padding: 0 10px;
}
#header_wrapper ul.social-icons {
float: right;
}
#header_wrapper ul.social-icons li {
float: left;
list-style: none;
margin: 5px;
}
#header_wrapper ul.social-icons li a {
background: url(img/social-icons.png) no-repeat;
width: 27px;
height: 30px;
display: block;
text-decoration: none;
}
#header_wrapper ul.social-icons li.facebook a {
background-position: 0 -40px;
}
#header_wrapper ul.social-icons li.twitter a {
background-position: -27px -40px;
}
#header_wrapper ul.social-icons li.linkedin a {
background-position: -55px -40px;
}
#header_wrapper ul.social-icons li.blog a {
background-position: -84px -40px;
}
#header_wrapper .pull-right ul {
padding: 0 10px;
}
#header_wrapper ul.social-icons {
display: none;
}
How do I get it to fit inside the listed item tag so that it doesn't keep stretching the header or the listed item tag?
You have a div inside the li so I made that a span, but your code doesn't include styling for that id so I'm pretty sure this will fix it. It's not semantically correct to have a block element inside an inline element.
See fix:
.header-top {
background: #252525;
}
.header-top a {
line-height: 40px;
}
.header-top .header-search a.red-bg {
padding: 0 10px;
display: block;
}
.header-top .container {
position: relative;
}
.header-top ul li {
list-style: none;
}
.header-top ul {
margin: 0;
}
.header-top ul li, .header-search {
float: left;
margin-left: 25px;
}
.header-top ul li a {
color: #f5f5f5;
display: inline-block;
}
.header-top .red-bg {
padding: 0 10px;
}
#header_wrapper ul.social-icons {
float: right;
}
#header_wrapper ul.social-icons li {
float: left;
list-style: none;
margin: 5px;
}
#header_wrapper ul.social-icons li a {
background: url(img/social-icons.png) no-repeat;
width: 27px;
height: 30px;
display: block;
text-decoration: none;
}
#header_wrapper ul.social-icons li.facebook a {
background-position: 0 -40px;
}
#header_wrapper ul.social-icons li.twitter a {
background-position: -27px -40px;
}
#header_wrapper ul.social-icons li.linkedin a {
background-position: -55px -40px;
}
#header_wrapper ul.social-icons li.blog a {
background-position: -84px -40px;
}
#header_wrapper .pull-right ul {
padding: 0 10px;
}
#header_wrapper ul.social-icons {
display: none;
}
a.red-bg{
display: inline-block;
background: red;
padding: 0 10px;
}
<ul>
<li><span id="contact_us">
FREE Boiler Evaluation
</span></li>
</ul>
To say that you want a to fit inside li means you want a fixed width of li.
a.red-bg {
display: inline-block;
overflow: hidden;
padding: 0 10px;
border: 1px solid white
}
li {
width: 100px;
background: red;
}
<li>
<div id="contact_us">
FREE Boiler Evaluation
FREE Boiler Evaluation
FREE Boiler Evaluation
FREE Boiler Evaluation
FREE Boiler Evaluation
FREE Boiler Evaluation
</div>
</li>
Can't find what is wrong with my menu. I want that when you hover a sub menu item background color would be only for submenu not for menu items. I tried everything here is menu css.
I tried #menu ul li a:hover but still affect menu items and sub items..... And I need only subitems.
#menu
{
list-style: none;
padding-right: 8%;
float: right;
padding-top: 3.5%;
clear: right;
text-indent: 10px;
}
#menu ul
{
list-style:none;
position:relative;
float:left;
margin:0;
padding:0
}
#menu ul a
{
display: block;
color: #FFF;
text-decoration: none;
font-weight: 700;
font-size: 12px;
line-height: 32px;
padding: 0 15px;
font-family: "HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif
}
#menu ul li
{
position: relative;
float: left;
margin: 0;
padding: 0;
}
#menu ul li.current-menu-item
{
}
#menu ul li:hover
{
}
#menu ul ul
{
display: none;
position: absolute;
top: 92%;
left: -64%;
padding: 0;
background-color: #4d4d4d;
}
#menu ul ul li
{
float: none;
width: 190px;
}
#menu ul ul a
{
line-height: 120%;
padding: 10px 15px;
}
#menu ul ul ul
{
top: 0;
left: 100%;
}
#menu ul li:hover > ul
{
display: block;
}
<?php
$args = array(
'theme_location' => 'pre_primary'
);
?>
<?php wp_nav_menu( $args); ?>
Use immediate child selector!
#menu > ul > li > a:hover
To style anchors in nested list use the following css selector:
#menu li ul li a:hover
It will affect only second level items.
I just started using the Avada Theme in my wordpress site. I need to customize the menu on the left hand side. The items in the submenu should be shown below the parent item, not on next to it. I started by using the side-navigation css styles, but I can't get the child items to work.
.side-nav {
list-style: none;
margin: 0;
padding: 0;
border-top: 1px solid #ededed;
margin-bottom: 20px;
}
.side-nav ul {
list-style: none;
margin: 0;
padding: 0;
}
.side-nav li {
margin: 0;
padding: 0;
}
.side-nav li a {
border-bottom: 1px solid #ededed;
display: block;
height: auto;
font-weight: normal;
font: 14px/39px 'MuseoSlab500Regular', arial, helvetica, sans-serif;
color: #333333;
}
.side-nav li a {
line-height: 1.69em;
padding: 8px 0;
}
.side-nav li a:hover {
background: none;
}
.side-nav li.current_page_item > a {
background: none;
color: #a0ce4e;
}
.side-nav li.current_page_item li a {
color: #333333;
border-bottom: 1px solid #ededed;
}
.side-nav .children {
display: none;
margin-left: 15px;
}
.side-nav .arrow {
display: inline;
margin-left: 0;
}
.side-nav .arrow:after {
position: absolute;
font-size: 14px;
font-family: IcoMoon;
}
.side-nav-left .side-nav {
border-right: 1px solid #ededed;
}
.side-nav-left .side-nav li.current_page_item > a {
border-right: 3px solid #a0ce4e;
}
.side-nav-left .side-nav .arrow {
margin-left: 10px;
}
.side-nav-left .side-nav .arrow:after {
content: '\f105';
}
.side-nav-right .side-nav {
border-left: 1px solid #ededed;
}
.side-nav-right .side-nav li.current_page_item > a {
padding-left: 23px;
border-left: 3px solid #a0ce4e;
}
.side-nav-right .side-nav li a {
padding-left: 25px;
}
.side-nav-right .side-nav .arrow {
margin-right: 10px;
}
.side-nav-right .side-nav .arrow:after {
content: '\f104';
}
.side-nav-right .side-nav .children {
margin-left: 40px;
}
.side-nav-right .side-nav .children a {
padding-left: 0;
}
For better understanding here is a screenshot of what I try to build.
The Image on the left shows the current style of the menu / submenu. The image on the right is showing the side-navigation template which comes with Avada. Out of the Box it's not possible to use the side-navigation style in the main menu. I already posted a question in the Theme-Fursion forum, but they were not able to help me. Maybe you can give me a hint.
Thank you
To achieve this effect you would have to change the positioning of the submenu list from absolute to relative, and adjust it a bit e.g. in this way:
body.side-header-left #side-header #nav > ul > li > ul.sub-menu {
position: relative;
right: auto;
left: auto;
top: auto;
visibility: visible;
opacity: 1;
width: 100%;
height: 0;
overflow:hidden;
}
body.side-header-left #side-header #nav > ul > li:hover > ul.sub-menu,
body.side-header-left #side-header #nav > ul > li.current_page_item > ul.sub-menu {
height: auto;
}
I want to add a second column for the items in the dropdown menu here http://www.kingadlerhomedecor.com/store/ I have a big list of items which are to be added to the category 'MEBLE' but I cannot have a really long list when there is just one column, if the list could split into two columns, i will be sorted. Please help.
/* MENU */
.primary-define #menu {
text-align: left;
font-family: helvetica, Arial;
/*background-color: #999;*/
}
.primary-define #menu-inner {
position: relative;
font-family: helvetica, Arial;
background-color: #999; /*No color was added origninally - added to make it grey*/
}
.primary-define .mainmenu {
margin: 0;
padding: 0;
position: relative;
list-style-type: none;
}
.primary-define .mainmenu li {
margin: 0;
padding: 0;
position: relative;
}
.primary-define .mainmenu > li {
float: left;
/*background-color: #999;*/
}
.primary-define .mainmenu li a {
color: #666; /*originial #666*/
display: block;
font-size: 10px; /*original 15px */
padding: 0.5px 1px; /*20px 25px */ /*Padding for the dropdown elements*/
text-decoration: none;
/*background-color: #999;*/
}
.primary-define .mainmenu > li > a {
color: #fff;
padding: 15px 25px; /*35px*/
font-size: 14px; /*original 18px */
font-weight: 600;
line-height: 100%;
font-family: helvetica, Arial;
}
.primary-define .mainmenu > li:hover > a,
.primary-define .mainmenu > li.active > a {
background-color: rgba(0, 0, 0, 1); /*rgba(0, 0, 0, 0.2)*/
/*font-size: 15px;*/
}
.primary-define .mainmenu li .dropdown-container {
top: 99%;
overflow: hidden;
position: absolute; /*absolute*/
padding-left: 1px; /*added by yuvi*/
font-size: 30px; /*added by yuvi*/
}
.primary-define .mainmenu li .dropdown {
margin-top: -300px; /*-999px*/
background-color: #fff;
border-left: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 30px; /*added by yuvi*/
padding: 10px;
}
.primary-define .mainmenu li:hover .dropdown {
margin-top: 0;
/*font-size: 30px; added by yuvi*/
}
}
.primary-define .mainmenu ul {
margin: 0;
float: left;
width: auto; /*249px*/
list-style-type: none;
border-right: 1px solid #eee;
}
.primary-define .mainmenu ul li:hover a,
.primary-define .mainmenu ul li.active a {
background-color: #eee; /*orginiarl #eee*/
First, it looks like you would need to widen the .dropdown element. Currently there is an inline style of width:300px. I would either increase that (500px looked good to me) to make room for 2 columns or remove the inline style and add it to the stylesheet (<- recommended).
From there you can set the width of the ul elements to half the width of the dropdown and float them.
.primary-define .mainmenu li .dropdown ul {
width: 50%;
float: left;
list-style: none; #This is to remove the circle next to the list items
}
I have a link like this
<li><a class='myclass' href="<?php echo base_url();?>index.php/controller">Search</a></li>
and my jquery is
$("a.myclass").click(function(){
var link = $(this);
var url = link.attr("href");
$(".content").load(url);
return false;
});
actually it links correctly the problem is my list in my menu looks ugly not it looks it should be though other li looks ok. when i change to
<li><a class='.myclass.' href="<?php echo base_url();?>index.php/controller">Search</a></li>
it looks correctly but its not linking to anything.
What is the problem here?
Here is my css
.webwidget_vertical_menu {
float: left;
width: 20%;
background-color: #fff;
padding-bottom: 10px;
}
.webwidget_vertical_menu ul{
padding: 0.5px;
margin: 0px;
font-family: Arial, Helvetica, sans-serif;
}
.webwidget_vertical_menu li{
}
.webwidget_vertical_menu ul li{
list-style: none;
position: relative;
}
.webwidget_vertical_menu ul li a{
padding-left: 15px;
text-decoration: none;
}
.webwidget_vertical_menu ul li ul{
display: none;
position: absolute;
background-color: #fff;
z-index: 999999;
}
.webwidget_vertical_menu ul li ul li{
position: relative;
margin: 0px;
border:none;
}
.webwidget_vertical_menu ul li ul li ul{
}
.webwidget_vertical_menu_down_drop{
background-position: right center;
background-repeat:no-repeat !important;
}
.webwidget_vertical_menu ul li li{
font-weight: normal;
}
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background-color: #42413C;
margin: 0;
padding: 0;
color: #000;
}
ul, ol, dl {
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
margin-top: 0;
padding-right: 15px;
padding-left: 15px;
}
a img {
border: none;
}
a:link {
color:#414958;
text-decoration: underline;
}
a:visited {
color: #4E5869;
text-decoration: underline;
}
a:hover, a:active, a:focus {
text-decoration: none;
}
.container {
width: 80%;
max-width: 1260px;
background: #FFF;
margin: 0 auto;
}
.header {
background-color: #ADB96E;
}
.sidebar1 {
float: left;
width: 20%;
background-color: #EADCAE;
padding-bottom: 10px;
}
.content {
padding: 10px 0;
width: 60%;
float: left;
}
.sidebar2 {
float: right;
width: 20%;
background-color: #EADCAE;
padding: 10px 0;
}
.content ul, .content ol {
padding: 0 15px 15px 40px; }
ul.nav {
list-style: none;
border-top: 1px solid #666;
margin-bottom: 15px;
}
ul.nav li {
border-bottom: 1px solid #666;
list-style: none;
position:relative;
}
ul.nav a, ul.nav a:visited {
padding: 5px 5px 5px 15px;
display: block;
text-decoration: none;
background-color: #C6D580;
color: #000;
}
ul.nav a:hover, ul.nav a:active, ul.nav a:focus {
background: #ADB96E;
color: #FFF;
}
/* ~~The footer ~~ */
.footer {
padding: 10px 0;
background: #CCC49F;
position: relative;
clear: both;
}
/* ~~miscellaneous float/clear classes~~ */
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
.menu {
color: #414141;
font-size:16px;
font-weight:650;
text-align: center;
}
You don't need the dot (.) in class name.
Try this:
<li><a class='myclass' href="<?php echo base_url();?>index.php/controller">Search</a></li>
And jquery...
// This means select the `<a>` element with class `myclass`.
// Dot (.) means class selector.
$("a.myclass").click(function(){
var link = $(this);
var url = link.attr("href");
$(".content").load(url);
return false;
});
Well, I need more conditions to answer exactly, but I guess there are some css styles for myclass. Try to rename myclass to something like f-ajax-link-selector (don't forget to change it in JS) and try to refresh the page.