Hello Friends When i Inspect element my Code is so far ...
<div class="ja-megamenu " id="ja-megamenu">
<ul class="megamenu level0">
<li class="mega first active">
<a href="http://127.0.0.1/" class="mega first active" id="menu435" >
<span class="has-image" >
<img src=images/on_home.png>
</span>
</a>
</li>
<li class="mega haschild">
<a href="/index.php?option=com_community&view=frontpage&Itemid=455" class="mega haschild" id="menu455" title="Grower Community">
<span class="has-image" >
<img src=images/active_11.png>
</span>
</a>
<div class="childcontent cols1 ">
<div class="childcontent-inner-wrap">
<div class="childcontent-inner clearfix" style="width: 200px;">
<div class="megacol column1 first" style="width: 200px;">
<ul class="megamenu level1">
<li class="mega first">
<div class="group">
<div class="group-title">
<a href="/index.php?option=com_community&view=photos&Itemid=507" class="mega first" id="menu507" title="Photos">
<span class="has-image" >
<img src=images/wt_under_link_01_01.png>
</span>
</a>
</div>
</div>
</li>
<li class="mega last">
<a href="/index.php?option=com_allvideoshare&view=category&slg=0&orderby=default&Itemid=934" class="mega last" id="menu934" title="Videos">
<span class="has-image" >
<img src=images/wt_under_link_01_02.png>
</span>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</li>
<li class="mega">
<a href="/index.php?option=com_kunena&view=topics&mode=replies&Itemid=506" class="mega" id="menu506" title="Forum">
<span class="has-image" >
<img src=images/active_05.png>
</span>
</a>
</li>
<li class="mega last">
<a href="/index.php?option=com_easyblog&view=blogger&limit=-2&Itemid=944" class="mega last" id="menu944" title="Blog">
<span class="has-image" >
<img src=images/active_07.png>
</span>
</a>
</li>
</ul>
</div>
Now here I want to change the image on hover ...
I am using somehing like this
.ja-megamenu ul.level0 li.mega a.mega span.has-image:hover{
background:url(../../images/act_05.png) no-repeat 0 0;
}
but the image hover is not occurs ... can any one please help me
I think hover is not happens due to span ...
please suggest me what i can do here ?
As it's been said already, the background image will not display as long as you have an image over it, so you could use this to hide the image when hovering the span:
.ja-megamenu ul.level0 li.mega a.mega span.has-image:hover > img {
visibility:hidden;
}
See this jsfiddle
I would recommend applying the :hover pseudo-class to the anchor (a.mega:hover) then changing the child <span> beneath it.
.ja-megamenu ul.level0 li.mega a.mega:hover span.has-image {
/* background change */
}
Keep in mind that as long as there is a child <img> within the span, that's going to overlap whatever you have set a background on the span. That is to say the span's background will never overcome the <img src="..."> in terms of visuals.
It looks like you are trying to change the background image of the span and not the src of the image tag.
In order to do that you would probably have better luck with using jQuery.
Related
I have a pricing plan page that I am trying to add a toggle switch to. I can't seem to figure out the proper way to vertically align the text of it: here is my fiddle
I've tried to set the margin and the padding but the Monthly and Annual are always at the top.
<div class="background">
<div class="container">
<div class="toggle-btn" style="background-color:transparent;text-align:center;position:relative;z-index:99;vertical-align:top;">
<span style="margin:0.8em;color:rgb(44, 46, 47);font-size:18px;bottom:0px;">Monthly</span>
<label class="switch" style="margin-bottom:15px;">
<input type="checkbox" id="checbox" onclick="check()" />
<span class="slider round"></span>
</label>
<span style="margin:0.8em;color:rgb(44, 46, 47);font-size:18px;bottom:0px;">Annual </span>
</div>
<div class="panel pricing-table">
<div class="pricing-plan">
<img src="https://s22.postimg.cc/8mv5gn7w1/paper-plane.png" alt="" class="pricing-img">
<h2 class="pricing-header">Personal</h2>
<ul class="pricing-features">
<li class="pricing-features-item">Custom domains</li>
<li class="pricing-features-item">Sleeps after 30 mins of inactivity</li>
</ul>
<span class="pricing-price">Free</span>
Sign up
</div>
<div class="pricing-plan">
<img src="https://s28.postimg.cc/ju5bnc3x9/plane.png" alt="" class="pricing-img">
<h2 class="pricing-header">Small team</h2>
<ul class="pricing-features">
<li class="pricing-features-item">Never sleeps</li>
<li class="pricing-features-item">Multiple workers for more powerful apps</li>
</ul>
<span class="pricing-price">$150</span>
Free trial
</div>
<div class="pricing-plan">
<img src="https://s21.postimg.cc/tpm0cge4n/space-ship.png" alt="" class="pricing-img">
<h2 class="pricing-header">Enterprise</h2>
<ul class="pricing-features">
<li class="pricing-features-item">Dedicated</li>
<li class="pricing-features-item">Simple horizontal scalability</li>
</ul>
<span class="pricing-price">$400</span>
Free trial
</div>
</div>
</div>
</div>
Remove the margin-bottom from that switch element and add display:flex;justify-content:center;align-items:center; to .toggle-btn
Here's the edited fiddle: https://jsfiddle.net/bjd3wps1/
you just had to add position: relative to the spans containing the text and than update the bottom value to bottom: -5px
here's the updated fiddle: https://jsfiddle.net/a2nwet54/
here is the fiddle I am working on Demo
How do I make this column completely responsive so that when the screen size becomes less I want all the elements to stay inline rather than stacking below one another.
How to solve this ?
Here is the sample markup
<div id="apologies-list">
<ul id="apologies-list-content">
<li><a tabindex="-1" href="#">
<div class="user-avatar list-padding span12 clearfix" >
<div class="span1">
<input class="case" name="case" type="checkbox" value="">
</div>
<div class="span2">
<img id="list-avatar" src="http://placehold.it/60x60" alt="" />
</div>
<div class="span6">
<span>Apologies initials</span>
<small>January 31, 2009 9:18 am</small>
</div>
<div class="span3 ">
<span class="badge badge-info custom-badge">2</span>
<i class="icon-trash"></i>
</div>
</div>
</a>
</li>
</ul>
</div>
For CSS please check my fiddle.
use css media queries
#media screen and (max-width:400px)
{
#apologies-list-content li div {display:inline-block}
}
I have some images:
<div class="builder-item-content row">
<div class="twelve columns b0">
<ul class="upcoming-events">
<li>
<a href="http://www.padi.com/scuba/" target="_blank">
<img src="assets/images/padi_logo.png" alt="" style="text-align:center">
</a>
</li>
<li>
<a href="http://www.sssnetwork.com/" target="_blank">
<img src="assets/images/sss_logo.png" alt="">
</a>
</li>
<li>
<a href="http://www.scubapro.com/" target="_blank">
<img src="assets/images/scubapro02.png" alt="">
</a>
</li>
</ul>
</div>
I want to center them inside the container. How I can do this?
Without really testing this I think after class you have
<ul class="upcoming-events" style="Width:800px; Margin:0 auto;">
This should work with the div as well. Width can be whatever you would want it to be... I just put 800px. The important part is margin:0 auto;
div.builder-item-content.row {
text-align: center;
}
Since images are inline-level, they can be centered with text-align (even tho they aren't text).
I am using the plugin Glide.js on my frontpage, and I have build it up almost like shown on the plugin page. This also means that I wish my slider images to have 100% width, but at the same time I want them to be cropped/cut off at the bottom at the window. Precisely like it is don on the plugin page.
My html code looks like this:
<header class='header'>
<div class='header-wrapper'>
<img class='header-logo' src='/assets/glide-logo-cfe0cb95a81b55ff1e872b0c578c527d.png'>
<nav class='header_nav'>
<ul class='header_nav-wrapper'>
<li class='header_nav-item'>
<a class='header_nav-item-a' href='#' id='aboutOpen'>About us</a>
</li>
<li class='header_nav-item'>
<a class='header_nav-item-a' href='#'>Create account</a>
</li>
<li class='header_nav-item'>
<form>
<button class='header_nav-item-a header_nav-item-a--btn header_nav-item-a--donate' src='https://www.paypalobjects.com/en_US/i/btn/'>Login</button>
</form>
</li>
</ul>
</nav>
</img>
</div>
</header>
<div class='slider'>
<div class='slides'>
<div class='slide content_article content_article--fast'>
<center>
<img class='slider-img' src='/assets/bg-fast-219ed63d5978022b88ba2389b4f673b6.jpg'>
<div class='content_article-wrapper'>
<h1 class='content_article-h'>Title 1</h1>
<p class='content_article-p'>
Sub title 1
</p>
<div class='content_article-btns'>
<a class='content_article-btn header_nav-item-a header_nav-item-a--btn' href='#'>
<span class='entypo-download'></span>
Read more 1
</a>
<a class='content_article-btn header_nav-item-a header_nav-item-a--btn' href='#'>See examples 1</a>
</div>
<img class='content_article-img box-shadow animated fadeOutDownBig' src='/assets/fast-img-3d905c8a57b66ef354467a9a0a07d168.png'>
</div>
</center>
</div>
<div class='slide content_article content_article--simple'>
<center>
<img class='slider-img' src='/assets/bg-responsive-07aefbc31666790f38a6e3e3b46f67a8.jpg'>
<div class='content_article-wrapper'>
<h1 class='content_article-h'>Title 2</h1>
<p class='content_article-p'>
Sub title 2
</p>
<div class='content_article-btns'>
<a class='content_article-btn header_nav-item-a header_nav-item-a--btn' href='#'>
<span class='entypo-download'></span>
Read more 2
</a>
<a class='content_article-btn header_nav-item-a header_nav-item-a--btn' href='#'>See examples 2</a>
</div>
<img class='content_article-img box-shadow animated fadeOutDownBig' src='/assets/responsive-img-662aaea9b8453dc6eac46064fdcc7a56.png'>
</div>
</center>
</div>
<div class='slide content_article content_article--responsive'>
<center>
<img class='slider-img' src='/assets/bg-simple-2d45eb663c4c69d72f66c19eb0cce285.jpg'>
<div class='content_article-wrapper'>
<h1 class='content_article-h'>Title 3</h1>
<p class='content_article-p'>
Sub title 3
</p>
<div class='content_article-btns'>
<a class='content_article-btn header_nav-item-a header_nav-item-a--btn' href='#'>
<span class='entypo-download'></span>
Read more 3
</a>
<a class='content_article-btn header_nav-item-a header_nav-item-a--btn' href='#'>See examples 3</a>
</div>
<img class='content_article-img box-shadow animated fadeOutDownBig' src='/assets/simple-img-af275d5091063498174655c95fa41079.png'>
</div>
</center>
</div>
</div>
</div>
My css is very simple, but only handles the 100% width stretch:
.slider-img {
width: 100%;
}
So how do I cut off my slider images so they fit the height of the screen?
Here is the CSS
.crop{
float:left;
margin:.5em 10px .5em 0;
overflow:hidden; /* this is important */
border:1px solid #ccc;
}
/* input values to crop the image */
.crop img{
margin:-20px -15px -40px -55px;
}
I'm building a page for a company I'm interning for, and can't seem to figure this one out. The code you see below is just a simplified template, so that I don't give any information about the company away (and all the style attributes are in a separate document, so everything in the code is alright.
What I'm having a problem with is making multiple onClick events work. For that matter, is using the onClicks in the comment tags even feasible? I want the text that says Further Instruction to have it's href path changed depending on the animal picture that's clicked.
Also, I can't use any JavaScript, so please don't suggest the use of any. Happen to have any ideas?
<div id="container">
<div class="mainPicture">
<img alt="" id="awesome" name="Awesome2" src="awesome.png" />
</div>
<div id="gallery">
<ul class="popOut">
<li>
<a href="DogText.html" target="AnimalInfo" onClick="document.Awesome2.src='dog.jpg'"> <!--onClick="document.furtherInstructions.href='DogText.html'">-->
<img src="dog.jpg" alt="dog"><img src="dog.jpg" alt="dog" class="preview">
</a>
</li>
<li>
<a href="CatText.html" target="AnimalInfo" onClick="document.Awesome2.src='cat.jpg'"> <!--onClick="document.furtherInstructions.href='CatText.html'">-->
<img src="cat.jpg" alt="cat"><img src="cat.jpg" alt="cat" class="preview">
</a>
</li>
<li>
<a href="ParrotText.html" target="AnimalInfo" onClick="document.Awesome2.src='parrot.jpg'"> <!--onClick="document.furtherInstructions.href='ParrotText.html'">-->
<img src="parrot.jpg" alt="parrot"><img src="parrot.jpg" alt="parrot" class="preview">
</a>
</li>
<li>
<a href="LizardText.html" target="AnimalInfo" onClick="document.Awesome2.src='lizard.jpg'"> <!--onClick="document.furtherInstructions.href='LizardText.html'">-->
<img src="lizard.jpg" alt="lizard"><img src="lizard.jpg" alt="lizard" class="preview">
</a>
</li>
<li>
<a href="HorseText.html" target="AnimalInfo" onClick="document.Awesome2.src='horse.jpg'"> <!--onClick="document.furtherInstructions.href='HorseText.html'">-->
<img src="horse.jpg" alt="horse"><img src="horse.jpg" alt="horse" class="preview">
</a>
</li>
<li>
<a href="ChickenText.html" target="AnimalInfo" onClick="document.Awesome2.src='chicken.jpg'"> <!--onClick="document.furtherInstructions.href='ChickenText.html'">-->
<img src="chicken.jpg" alt="chicken"><img src="chicken.jpg" alt="chicken" class="preview">
</a>
</li>
<li>
<a href="DefaultText.html" target="AnimalInfo" class="center" onClick="document.Awesome2.src='awesome.png'"> <!--onClick="document.furtherInstructions.href='DefaultText.html'">-->
<p>Default Image</p>
</a>
</li>
</ul>
<div id="rightcol">
<iframe src="DefaultText.html" title="Information About Animals" name="AnimalInfo" class="fixThisHeight">
</iframe>
</div>
<div id="externalInstructions">
<a href="DefaultText.html" name="furtherInstructions">
<p>Further Instructions</p>
</a>
</div>
</div>
</div>
Just separate your commands with a semi-colon:
onClick="document.Awesome2.src='chicken.jpg'; document.furtherInstructions.href='ChickenText.html';">