On mobile here, I have a dropdown menu that comes down with some options in it. I would like these links to change color to grey when one "hovers" on it with the thumb on the phone. I haven't managed though I have tried several options as you can see in the code. This is it:
<div class="total">
<ul class="nav navbar-nav" >
<li>
<div class="id"><a style="width:100px" data-toggle="dropdown" href="#"><img src="grey.png" alt="Friends in class" class="barimage"> <span ></span></a>
<ul class="dropdown-menu">
<div class="dropdown">
<li><p><b>Search your friends</b> </p>
</li>
<li><p class="menupar"><b>My Friends </b></p>
</li>
<li><p class="menupar"><b>My account</b></p>
</li>
<li><p class="menupar"><b>Logout</b></p>
</li>
</div>
</ul>
</div>
</li>
and this is the CSS:
.dropdown {
margin-top:-3px;
width: 200px;
height:220px;
background-color: rgba(36, 96, 70, 1);
font-size:20px;
line-height:50px;
border-radius: 3px;
}
.menunav {
width: 200px;
height:80px;
color:green;
font-size:20px;
line-height:50px;
border:solid black;
border-radius:1px;
}
a:link {color:white;}
a:visited {color:white}
a:hover.menunav {background-color:grey;}
a:active.menunav {background-color:grey;}
a:focus.menunav {background-color:grey;}
a.menunav {
display: block;
height: 100%;
width: 100%;
text-decoration: none;
}
Not really sure why you'd want a hover effect on a mobile device, but using :focus whenever you use :hover should do the trick.
Related
It seemed to me a job for a minute, when a friend asked me to fix this. After the update of the mesmerize theme, the footer was set to default and she wanted it to be changed again. Everything went fine except: the a:hover of the footer didn't work. I couldn't fix it eighter.
I changed the CSS to:
/* Footer Link-Farbe*/
.footer a {
color: var(--color-primary);
}
/* Footer Hover-Farbe*/
.footer a:hover {
color: var(--color-primary-light);
}
and also tried:
/* Footer Link-Farbe*/
.footer a:link, .footer a:active, .footer a:visited {
color: var(--color-primary);
}
/* Footer Hover-Farbe*/
.footer a:hover {
color: var(--color-primary-light);
}
In the firefox developer tool i can see the link-color is working:
screenshot of developer-tool
But the :hover is not there.
But if I add the hover-rule to the developer-tool it works:
screenshot of developer-tool with css edited
I'm really lost. I hope somebody can help.
The domain ist: www.ubuntu-ubuntu.at
Have you tried using a more specific selector for the hover style?
Sorry the domain you provided, didn't work so i don't know how the markup looks, but something like this:
.footer .horizontal_footer_menu ul li a:hover {
color: var(--color-primary-light);
}
Or try to use !important just to get things done.(It's not really recommended)
.footer a:hover {
color: var(--color-primary-light) !important;
}
You have do declare variable in ":root" after you can use or chnage in your css classs.
in word press the backend option allow you to change footer link color using "var".
you have to change option in wordpress backend settings.
OR
You can use ":root" for overrite default settings.
:root {
--color-primary: #3f51b5;
--color-primary-light: #1e90ff;
}
.footer .horizontal_footer_menu ul li {
display: inline-block;
}
.footer .horizontal_footer_menu ul li a {
text-decoration: none;
padding: 10px;
}
/* Footer Link-Farbe*/
.footer a {
color: var(--color-primary);
}
/* Footer Hover-Farbe*/
.footer a:hover {
color: var(--color-primary-light);
}
<div class="footer">
<div class="horizontal_footer_menu">
<ul>
<li>Home</li>
<li>About us</li>
<li>Contact us</li>
</ul>
</div>
</div>
Try Using this HTML code for wordpress footer hover. I have tried this in my E-commerce wordpress store and it worked fine.
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
#footer{background:#fff;position:relative}
.footerLogo { font-size: 1.8em; font-weight: 600; color: #333; margin-bottom: 22px; display: block; }
#footer::before{content:"";background:linear-gradient(to right,#fff 0,#535df1 50%,#fff 100%);height:5px;width:100%;position:absolute}
.footer-wrapper{padding:50px 0;float:left;width:100%}
img.footer-logo{margin-bottom:20px}
ul.social-icons{margin:0; padding: 0;}
ul.social-icons li{background:#fff;width:30px;height:30px;border:1px solid #f1f2f2;border-radius:4px;margin:3px;text-align:center; display: inline-block;}
ul.social-icons li a{color:#6d6e71;font-size:15px;line-height:30px}
ul.social-icons li a:hover{color:#27aae1;transition:all 1s}
ul.footer-links { padding: 0; list-style-type: none; position: relative;}
ul.footer-links li{line-height:25px; padding-left: 15px; }
ul.footer-links li:before { position: absolute; content: 'f105'; font-family: FontAwesome; left: 0;}
ul.footer-links li a{color:#6d6e71}
ul.footer-links li a:hover{color:#27aae1; text-decoration: none;}
ul.contact{margin:0;padding:0}
ul.contact li{list-style:none;padding:15px 0;border-bottom:1px solid #f1f2f2;font-size:13px;font-weight:600;line-height:15px;}
ul.contact li i{font-size:18px;margin-right:20px;color:#27aae1}
.copyright{background:#231f20;text-align:center;color:#fff;padding:12px 0 4px}
</style>
<footer id="footer" class="bg-light mt-5">
<div class="container">
<div class="footer-wrapper">
<div class="row">
<div class="col-md-3 col-sm-3">
Company
<ul class="social-icons">
<li><i class="fa fa-facebook"></i></li>
<li><i class="fa fa-twitter"></i></li>
<li><i class="fa fa-xing"></i></li>
<li><i class="fa fa-pinterest"></i></li>
<li><i class="fa fa-linkedin"></i></li>
</ul>
</div>
<div class="col-md-2 col-sm-2">
<h5>For individuals</h5>
<ul class="footer-links">
<li>Signup</li>
<li>login</li>
<li>Explore</li>
<li>Finder app</li>
<li>Features</li>
<li>Language settings</li>
</ul>
</div>
<div class="col-md-2 col-sm-2">
<h5>For businesses</h5>
<ul class="footer-links">
<li>Business signup</li>
<li>Business login</li>
<li>Benefits</li>
<li>Resources</li>
<li>Advertise</li>
<li>Setup</li>
</ul>
</div>
<div class="col-md-2 col-sm-2">
<h5>About</h5>
<ul class="footer-links">
<li>About us</li>
<li>Contact us</li>
<li>Privacy Policy</li>
<li>Terms</li>
<li>Help</li>
</ul>
</div>
<div class="col-md-3 col-sm-3">
<h5>Contact Us</h5>
<ul class="contact">
<li><i class="fa fa-phone"></i>+1 (234) 123 1234</li>
<li><i class="fa fa-envelope-o"></i>info#company.com</li>
<li><i class="fa fa-home"></i>123 Any street second floor, INDIA</li>
</ul>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="copyright">
<p>Company © 2019. All rights reserved</p>
</div>
</footer>
I took this code from https://webdesignerwall.com/wdw-snippet/footer-with-hover-effects Aesthetic outfits
You can learn more about this issue in another thread I found:
https://wordpress.org/support/topic/footer-hover-link-wont-change/
I have been seriously messing with this one thing for over an hour now. Basically I have a navigation bar, there is an icon on the far left, and the links are aligning to the bottom of the image.
I have tried messing with padding, margins, line height, vertical-align and everything else I could think of. I also tried having the image inside and before the ul. I need the ul items (will be links) to be vertically aligned to the center of the icon.
I have put all the code into one file that I will copy here. Also, when you post please explain why a solution will work, not just post code. The other posts I searched for about this before I posted here didn't explain anything, just included code that didn't help when I tried it. Unfortunately, because I have no idea what the solution is or what it relates to I am including all of the code.
body {
margin: 0;
/*background-color: #10f009;*/
font-size: 62.5%;
font-family: sans-serif;
}
img {
margin: 0 0 0 0;
max-width: 100%;
height: 50%;
}
.smallSection {
margin: 100px;
}
.paragraph {
font-size: 2em;
max-width: 500px;
}
.title {
font-size: 2.4em;
}
.list {
list-style: solid inside url("");
font-size: 2em;
}
.nav-link {
list-style-type: none;
display: inline-block;
text-align: center;
font-size: 2em;
width: 200px;
border: 1px solid red;
}
.nav-icon {
display: inline-block;
border: 1px solid red;
}
.largeSection {} #section1 {
background-image: url("../img/placeholder.jpg")
}
#nav {
border: 1px solid red;
margin: 0;
padding: 0;
align: top;
height: 100px;
line-height: 1;
}
/*temporary*/
div {
border: 1px solid red;
}
<!-- Dawn Little -->
<div id="section1" class="largeSection">
<!-- Navigation -->
<div>
<ul id="nav">
<div style="width:70px;height:70px;border: 1px solid red;display: inline-block;">
<!-- The img link is obviously broken so this is here instead. -->
</div>
<!-- <img src="img/herbfalife-icon.png" width="70px" height="70px" class="nav-icon"> -->
<li class="nav-link">Who am I</li>
<li class="nav-link">What I do</li>
<li class="nav-link">3-Day Trial</li>
<li class="nav-link">Challenges</li>
<li class="nav-link">Become a Coach</li>
</ul>
</div>
<div class="smallSection">
<p class="paragraph">
<span class="title">Client Name<br /></span> Hi, I'm a wife, mother, and Personal Wellness Coach with Herbalife Nutrition. My super power - I change lives.
</p>
</div>
</div>
<!-- What I do -->
<div id="section2" class="largeSection">
<div class="smallSection">
<p class="paragraph">
<span class="title">What I do</span>
<ul class="list">
<li>Wellness Evaluations</li>
<li>Nutrition Coaching</li>
<li>Impact Lifestyle</li>
<li>Get Results</li>
<li>Coach Coaches</li>
</ul>
</p>
</div>
</div>
<!-- 3-day trial -->
<div id="section3" class="largeSection">
<div class="smallSection">
<p class="title">
Try Our 3-Day Trial
</p>
<p class="title">
What you get:
</p>
<ul class="list">
<li>Personal Wellness Coach</li>
<li>Wellness Evaluation</li>
<li>Meal Plan</li>
<li>Daily Support</li>
<li>Plan of Action</li>
<li>6 Meals</li>
<li>Metabolism Booster</li>
</ul>
</div>
</div>
<!-- Challenges -->
<div id="section4" class="largeSection">
<div class="smallSection">
<p class="title">
Join a Weight Loss Challenge
</p>
<p class="title">What you get:</p>
<ul class="list">
<li>Personal Wellness Evaluation</li>
<li>Personalized Program</li>
<li>Nutrition Classes</li>
<li>ommunity of Support</li>
<li>Accountability</li>
<li>Opportunity to Win Cash & Prizes</li>
</ul>
</div>
</div>
<!-- Become a coach -->
<div id="section5" class="largeSection">
<div class="smallSection">
<p class="title">
Become a Coach
</p>
<p class="title">
What you get:
</p>
<ul class="list">
<li>Opportunity to Change Lives</li>
<li>Opportunity for Personal & Financial Growth</li>
<li>Training</li>
<li>Potential to Change Lives in Over 90 Countries</li>
<li>Be Part of a Team</li>
<li>Get in the Best Shape You've Ever Been</li>
</ul>
</div>
</div>
This way that you are coding is a bit tricky to align.I will rewrite your code. However, I recommend you to use a CSS framework like bootstrap or zurb.
Firstly, you need to rewrite HTML part like
<!-- Navigation -->
<div class="header clearfix">
<div class="logo">
<!-- The img link is obviously broken so this is here instead. -->
</div>
<div class="nagivation">
<ul id="nav">
<li class="nav-link">Who am I</li>
<li class="nav-link">What I do </li>
<li class="nav-link">3-Day Trial</li>
<li class="nav-link">Challenges</li>
<li class="nav-link">Become a Coach</li>
</ul>
</div>
</div>
I have added header and nagivation
then add these lines to your css to
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.clearfix { display: inline-block; }
/* start commented backslash hack \*/
* html .clearfix { height: 1%; }
.clearfix { display: block; }
/* close commented backslash hack */
.header{
min-height:70px;
clear:both
}
.logo{
width:20%;
float:left;
}
.nagivation{
width:80%;
float:right;
}
you need to remove #nav also in your CSS code.
based on your needs, you can change this class
.nagivation #nav{
// add needed adjustment
}
you can have an access to all codes here https://jsfiddle.net/mhadaily/7f152z3r/
The easiest way to accomplish what you want is to simply float the icon as seen in the css below and in this pen.
#nav {
border: 1px solid red;
height:100px;
line-height:1;
display:inline-block;
}
.nav-icon {
display: inline-block;
border: 1px solid red;
float:left;
}
Floats force other elements to flow around the floated element. You just want to be wary of floats because they wreak havoc on your layout if you're not vigilant (they collapse their parent containers). You can read all about it here.
I am not a UI expert. But By looking at the following tag I can asked you few question to understand? Because You are writing non-li tags within ul. Try ti wrap your code with li tag.
Just go to w3cshool link.
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_lists_menu
http://www.w3schools.com/html/html_lists.asp
<ul id="nav">
<div style="width:70px;height:70px;border: 1px solid red;display: inline-block;">
<!-- The img link is obviously broken so this is here instead. -->
</div>
<!-- <img src="img/herbfalife-icon.png" width="70px" height="70px" class="nav-icon"> -->
<li class="nav-link">Who am I</li>
<li class="nav-link">What I do </li>
What about simply moving the li elements up a little bit?
.nav-link {
position: relative;
bottom: 20px;
}
First off, the only elements that should be inside a <ul> are <li>. That <div> (or link or whatever it is in reality) may cause you grief.
The real problem, however, is that you're using the wrong CSS property on the wrong element. You want vertical-align (not "align"), and it should be applied to the list-items (not the container).
Try this:
<ul>
<li class="nav-link"><!-- img here --></li>
<li class="nav-link">Who am I</li>
<li class="nav-link">What I do</li>
<li class="nav-link">3-Day Trial</li>
<li class="nav-link">Challenges</li>
<li class="nav-link">Become a Coach</li>
</ul>
with
.nav-link { vertical-align: middle; }
I've been trying to change the text color in a bootstrap template's navbar and have been unsuccessful. Anyone know where I'm going wrong? Here is my code.
<!--navbar-->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner" id="nav-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Restaurant</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><i class="icon-home icon-white"></i> Home</li>
<li>Link</li>
<li>Link</li>
<li>Link</li>
<li class="dropdown">
Dropdown <b class="caret"> </b>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
</ul>
</li>
</ul>
<form class="navbar-search pull-right" action="">
<input type="text" class="search-query span2" placeholder="Search">
</form>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</div><!-- /.navbar-inner -->
</div><!-- /.navbar -->
<!--navbar-->
The CSS:
.navbar-inner {
color: #FFF;
}
I also tried this:
#nav-inner {
color: #FFF;
}
If you want to change the css for the tabs you need to add color: #ddd; to the following
.navbar .nav > li > a {
float: none;
line-height: 19px;
padding: 9px 10px 11px;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
color: #ddd;
}
Hope it helps!!
My guess is that Bootstrap defines a more specific CSS rule that is winning out over your more general rule. You should examine the page with Firefox or Chrome's developer tools to see which styles are winning out over others. If your style doesn't even show up, then you know there's a more basic problem, but if Bootstrap's style is overriding your color, you have to give your style a higher precedence.
For a sanity check, try this overkill rule:
html body .navbar .navbar-inner .container {
color: #FFF;
}
And if that works, then experiment with a lower level of specificity to see how specific you really need to get.
If all else fails, you can always do:
color: #FFF !important;
The CSS2 specification lays this out in detail.
.navbar .nav > li > a {
float: none;
color: #5FC8D6;
background-color: #002E36;
}
.navbar .nav > li > a:hover {
float: none;
color: #002E36;
background-color: #5FC8D6;
}
It works... try it out.......
.navbar-nav > li > a:link
{
color:red;
}
nav.navbar-nav.navbar-right li a {
color: blue;
}
Works like a charm! Found it on another thread, so am not taking credit for it.
Got an issue in ie7!, see the image below for how the dropdown menu looks. This works fine in every other browser but in ie7, as soon as you venture outside of the main li 'i.e.: the top link' the menu dissapears. I have already checked setting red boxes around everything and the li element is extending correctly to contain the sub menu but I cannot fix it. Any ideas?
Example of markup:
<nav>
<ul class="clearfix">
<li class="dropdown-link">Top Link
<ul class="clearfix dropdown-holder">
<li>
<div class="arrow"></div>
<div class="dropdown-holder-inner">
<ul class="dropdown">
<li>Link</li>
<li>Link</li>
<li>Linky</li>
<li>Link</li>
<li>Link</li>
<li class="last-child">Link</li>
</ul>
</div>
</li>
</ul>
</li>
</ul>
</nav>
CSS is quite heavy so I have put the Full Code on jsfiddle: http://jsfiddle.net/n2kgX/3/
image: http://i.stack.imgur.com/k24Du.png
I create a sample here: http://jsfiddle.net/jho1086/bbULV/5/, I change the html code and css a little bit because in my opinion container are too many. And I change the HTML5 tag (<nav>) because IE8 and below is not supported with HTML5, unless you have a fixed.
<div id="nav">
<ul class="clearfix sf-menu">
<li class="dropdown-link">Top Link
<div class="clearfix dropdown-holder">
<div class="arrow"></div>
<ul class="dropdown clearfix">
<li>Link</li>
<li>Link</li>
<li>Linky</li>
<li>Link</li>
<li>Link</li>
<li class="last-child">Link</li>
</ul>
</div>
</li>
</ul>
</div>
css
#nav { background:#6B6C6E; width:300px; margin:30px auto 0;}
.sf-menu li{float:left; font:12px/1em 'arial'; position:relative; padding:0 0 5px;}
.sf-menu li a{float:left;padding:12px 10px 5px;color:#fff; text-transform:uppercase;}
.sf-menu .dropdown-holder{
position:absolute;
left:-999em;
width:218px;
top:93%;
}
.sf-menu li:hover .dropdown-holder {left:-999em;}
.sf-menu li:hover .dropdown-holder {left:0;}
.arrow { background:url(arrow.png) no-repeat left top; width:32px; height:8px; position:relative; z-index:2; left:10px;}
.dropdown {
box-shadow:0 0 5px #bec2c8;
background:#fff;
height:100%;
position:relative;
z-index:1;
padding:10px 10px 5px;
}
.sf-menu .dropdown li{text-transform:capitalize; border-bottom:1px solid #ccc;}
.sf-menu .dropdown li.last-child { border:0;}
.sf-menu .dropdown a{
float:left;
padding:5px 0;
width:198px;
color:#333;
}
Hope it helps.
I have a feeling that Your example is overcomplicated.
This is the simplest implementation of nested menu (with hover) I know of:
<ul class="outer">
<li>
<p>TOP MENU</p>
<ul class="inner">
<li>link1</li>
<li>link2
<ul class="inner">
<li>link2.1</li>
</ul>
</li>
<li>link3</li>
</ul>
</li>
</ul>
With a little bit of css:
.outer {
border: 1px solid red;
width: 100px;
}
.inner {
display: none;
}
.inner li {
padding: 0 0 0 10px;
}
.outer li:hover > .inner {
display: block;
}
Tested on IE8 (in IE7 mode with IE7 Standards). Check here: http://jsfiddle.net/BUuyV/11/
Here is what you can do:
<!--[if lte IE 7]>
<style type="text/css">
nav ul li:first-child ul.dropdown-holder{
left: 0px;
top:-4px;
}
</style>
<![endif]-->
Note: For :first-child to work in IE8 and earlier, a <!DOCTYPE> must be declared.
i have been trying to have a drop down menu opon mouseover of the "profile" image button.
by using only css, this is what i achieve.
i also added text decoration to none but the underline still exist.
I have also tried using javascript but it doesnt work out for me.
Would any1 help enhancing this?
my html code:
<td class="header_button ">
<div id="menu">
<ul id="Ul1">
<li >
<asp:ImageButton runat="server"
ImageUrl="../img/Button/Profile.png" CssClass="profile_dropdown"
onclick="btnMyProfile_Click" />
</li>
<li class="item" >
Edit Profile
</li>
<li class="item">
My Follow
</li>
<li class="item">
My Uploads
</li>
<li class="item">
My Child Profile
</li>
</ul>
</div>
<div style="clear:both"></div>
</td>
my css code:
.profile_dropdown
{
height:75px;
weight:75px;
position:static;
}
#menu ul .item
{
display: none;
text-decoration: none;
background: #222222 85% 55% no-repeat;
font-family: 'Century Gothic';
font-size: large;
font-weight: bold;
color: #9FC54E;
white-space: nowrap;
}
#menu ul:hover .item{display:block;}
#menu{margin-top:-22px;position:fixed}
You should add
#menu li a {
text-decoration:none
}