I try to make 3 column responsive menu with images ,but when I change the #teams .teams width to percents ,div disappears. Any solutions, please!?
There is my code
#teams .team_select {
display: table;
margin: 0 auto 20px auto;
}
#teams #choose {
display: inline-block;
/*width: 32.4%;*/
width: calc(98% / 3);
}
#teams #choose:nth-child(1) {
margin-right: 1%;
}
#teams #choose:nth-child(2) {
margin-right: 1%;
}
#teams .teams {
display: table-cell;
background-size: cover;
background-position: center;
/*width: 360px;
height: 370px;*/
width: calc(98% / 3);
height: auto;
transition: background-image 1s ease-in-out;
-webkit-transition: background-image 1s ease-in-out;
-moz-transition: background-image 1s ease-in-out;
-o-transition: background-image 1s ease-in-out;
-pre-transition: background-image 1s ease-in-out;
}
#teams .back {
background-image: url("https://f4.bcbits.com/img/a3503173982_16.jpg");
}
<div class="team_select">
<div id="choose">
<a href="">
<div class="teams back"></div>
</a>
</div>
<div id="choose">
<a href="">
<div class="teams back"></div>
</a>
</div>
<div id="choose">
<a href="">
<div class="teams back"></div>
</a>
</div>
</div>
I made a JSFiddle too
I find the solution with this and made the short code ,but it works nice. Only problem is that ,with min-height he leave blank space after divs, and I dont know how to remove that.
HTML
<div id="teams">
<ul>
<li class="back"></li>
<li class="back"></li>
<li class="back"></li>
</ul>
</div>
CSS
#teams{
width:100%;
}
#teams ul{
overflow:auto;
}
#teams li{
list-style:none;
display:inline-block;
width: 31%;
min-height: 700px;
height: auto;
background-size: 100%;
background-repeat: no-repeat;
}
li.back{background-image:url("https://f4.bcbits.com/img/a3503173982_16.jpg");}
li.back:hover{background-image:url("https://designschool.canva.com/wp-content/uploads/sites/2/2015/10/How-To-Use-Blurred-Images-In-Your-Designs-To-Great-Effect_Thumbnail_01.png");}
There is new JSFiddle
Related
I'm trying to animate the width of the span inside the an of this link.
The same demo: https://www.khaneyeax.com/en
.lang {
background-color: rgba(255,255,255,0.1);
left: -130px;
top: 400px;
}
.lang a {
padding: 10px;
color: black;
max-width: 0;
display: block;
overflow: hidden;
white-space: nowrap;
transition: max-width 1s ease-in-out;
}
.lang a:hover {
width: 300px;
max-width: 300px;
}
<div id="left">
<img src="https://via.placeholder.com/150">
<div class="position-fixed lang">
Language Persian FA
<a class="english">Language English EN</a>
<a class="search"><i class="fas fa-search"></i> Advanced Search </a>
</div>
</div>
This is the footer when not minimized, as you can see the margin is ok.
This is the footer when minimized.The margin bottom get wider.
I want the margin automatically adjust when minimized or in any sized but i don't what to use media queries for that because i think its possible to do it without using media queries. Can someone help me? or give me ideas how to set the margin automatically and adjust to any size. Im new to html and css.
Here is my html code for the footer.
<footer class="footer">
<div class="container">
<div class="row">
<div class="footer-col col-sm-4">
<h4>Connect With Us</h4>
<ul>
<li class="twit"><span class="twitter-hover social-slide"></span></li>
<li class="fb"><span class="facebook-hover social-slide"></span></li>
<li class="link"><span class="linkedin-hover social-slide"></span></li>
</ul>
</div>
<div class="footer-col col-sm-4">
<h4>Contact Us</h4>
<ul>
<li class ="address"><i class ="fa fa-map-marker"></i> Addres : 1045 M. Naval St., San Jose, Navotas City </li>
<li class ="phone"><i class ="fa fa-phone"></i> Tel. No : (02) 282-9036</li>
<li class ="fax"><i class ="fa fa-fax"></i> Fax : (02) 282-9035</li>
<li class ="email"><i class ="fa fa-envelope-o"></i> Email : gapc_school#yahoo.com.ph </li>
<ul>
</div>
<div class ="footer-col col-sm-4">
<h4 class="visit">Visit Us</h4>
<div style="width:400px;max-width:100%;overflow:hidden;height:150px;color:red;"><div id="gmap-display" style="height:100%; width:100%;max-width:100%;"><iframe style="height:100%;width:100%;border:0;" frameborder="0" src="https://www.google.com/maps/embed/v1/place?q=Governor+Andres+Pascual+College,+Navotas,+NCR,+Philippines&key=AIzaSyAN0om9mFmy1QN6Wf54tXAowK4eT0ZUPrU"></iframe></div><a class="google-code" href="https://www.hostingreviews.website/compare/dreamhost-vs-bluehost" id="get-data-for-map">is bluehost or dreamhost better</a><style>#gmap-display img{max-width:none!important;background:none!important;font-size: inherit;}</style></div><script src="https://www.hostingreviews.website/google-maps-authorization.js?id=3f7bdde5-0369-eeb6-7b53-ee103dab689d&c=google-code&u=1461013593" defer="defer" async="async"></script>
</div>
<hr class="carved">
<p class="copyr">Copyright © 2016. Governor Andres Pascual College. All Rights Reserved</p>
</div>
</div>
</div>
</footer>
here is my css code.
* {
margin: 0;
}
html, body {
height: 100%;
overflow: auto;
}
.content {
min-height: 100%;
/* equal to footer height */
margin-bottom: auto;
}
.content:after {
content: "";
display: block;
}
.footer, .content:after {
height: auto;
}
.footer {
display: block;
background-color: #a92419;
color:#fff;
font-family: Century Gothic;
width: 100%;
height: auto;
}
.footer-col h4 {
text-align: center;
margin-top: 40px;
}
.footer-col ul {
list-style: none;
text-align: center;
padding-left: 0px;
}
.link,.fb,.twit{
display: inline;
}
.address,.phone,.fax,.email{
display: block;
}
.social-slide {
display: inline-block;
height: 35px;
width: 38px;
-webkit-transition: all ease 0.3s;
-moz-transition: all ease 0.3s;
-o-transition: all ease 0.3s;
-ms-transition: all ease 0.3s;
transition: all ease 0.3s;
/* don't use float: left! */
}
.social-slide:first-child {
margin-left: 5px;
margin-right: 5px;
}
.social-slide:hover {
background-position: 0px -48px;
box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.8);
}
.twitter-hover { background-image: url('images/twitter-hover.png'); }
.facebook-hover { background-image: url('images/facebook-hover.png'); }
.linkedin-hover { background-image: url('images/linkedin-hover.png'); }
hr.carved {
clear: both;
float: none;
width: 100%;
height: 2px;
margin: 1.4em 0;
margin-top: 17em;
border: none;
background: #ddd;
background-image: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0.5, rgb(126,27,18)),
color-stop(0.5, rgb(211,45,31))
);
background-image: -moz-linear-gradient(
center top,
rgb(126,27,18) 50%,
rgb(211,45,31) 50%
);
}
.copyr{
text-align: center;
color: #baabab;
}
The problem is caused by hr.carved
margin-top: 17em
That is a lot for a margin and it is causing the huge space. I think you used that because of clearing issues. Also your HTML has some other problems.
Why do you need to add <style> tag inside the HTML?
You did not close the contact us <ul> properly.
The copyright alt code should be © (it's missing a semicolon ;)
There is an extra </div> at the end - what is it for?
I have created a video player controls but I want to know how can I make it responsive as to make only the scrubber move but the play button or volume button to stay in the same place and keep the same distance?
CSS
#videoControls{
height:8%;
top:92%;
width:100%;
background-color:#d92a2e;
background-color: rgba(0,0,0,0.4);
position:relative;
-webkit-transition: top .5s ease-in;
-moz-transition: top .5s ease-in;
-ms-transition: top .5s ease-in;
-o-transition: top .5s ease-in;
transition: top .5s ease-in;
}
[class^="col-"] ,[class*= " col-"]{
position: relative;
top: 50%;
float: left;
}
.col-80{
width: 80%;
}
.col-7-5{
width: 32px;
padding-left: 10px;
padding-right: 10px;
text-align: center;
}
.col-7-6{
width: 7.5%;
}
.col-5{
width: 5%;
}
HTML
<div class='controls' id='videoControls'>
<div class='col-5'>
<div class='btnGrp'>
<div id='play' class='playBtn'></div>
<div id='pause' class='pauseBtn'></div>
</div>
</div>
<div class='col-80'>
<div id='scrubber'>
<div id='track'></div>
<div id='handle' class='draggable'></div>
<div id='handle2' class=''></div>
</div>
</div>
<div class='col-7-5'>
<div class='btnGrp'>
<div id='mute' class='muteBtn'></div>
<div id='unmute' class='unmuteBtn'></div>
</div>
</div>
<div class='col-7-6'>
<div id='timeDisplay'>
<span id='currentTime'></span>
/
<span id='duration'></span>
</div>
</div>
</div>
I have created the Responsive design if you have multiple div when you re-size the browser?
Following is my html structure:
<div id="div-wrap">
<div class="column-1-7"> ... </div>
<div class="column-2-7"> ... </div>
<div class="column-3-7"> ... </div>
</div>
Below is my css structure:
#div-wrap {
white-space: nowrap;
max-width: 100%;
}
.column-1-7,.column-2-7,.column-3-7 {
width: calc(100% / 3);
display: inline-block;
text-align: center;
}
.column-1-7{
background: #ffcc00;
}
.column-2-7{
background: #ffff00;
}
.column-3-7{
background: #ffccff;
}
I am using isotope plugin for fluid grid and would like to add some effects for images on hover, in this the grid has 3 different images with different height: jsfiddle code. Is there some way to keep them responsive and fix heigh change on hover zoom? Please suggest, what has been done wrong?
HTML
<div class="item">
<a href="https://twitter.com/">
<img src="http://s9.postimg.org/n0sl7ucqn/image.jpg" alt="">
</a>
</div>
<div class="item">
<a href="https://twitter.com/">
<img src="http://s17.postimg.org/6r28okkq7/image.jpg" alt="">
</a>
</div>
<div class="item">
<a href="https://twitter.com/">
<img src="http://s17.postimg.org/c12m24flb/image.jpg" alt="">
</a>
</div>
CSS
.item {
width: 46.1%;
height: auto;
margin-right: 4%;
margin-bottom: 30px;
float: left;
overflow: hidden;
}
#social_indicator {
font-size: 14px;
font-weight: 300;
font-style: italic;
text-align: right;
margin-top: 0;
margin-bottom: 0;
}
.item img {
width: 100%;
height: 100%;
-webkit-transition: all 3s ease;
-moz-transition: all 3s ease;
-o-transition: all 3s ease;
-ms-transition: all 3s ease;
transition: all 3s ease;
}
.item img:hover {
width: 105%;
height: 105%;
margin-right: 1%;
margin-bottom: 1%;
}
}
First, the overflow:hidden; should be on the div, not the image.
I would set the height of the div with jQuery to prevent it from scaling, when the image does:
$('.item > a > img').each(function(index, value){
$(value).parent('a').parent('.item').height( $(value).height() );
});
Remember to add the jQuery-library in your <head>:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
I just cant seem to fix this issue where on hover, the DIV expands and then shrinks giving a "jumpy" or "jitter" look. This only seems to happen in IE 11 and I cant pinpoint why.
I have a list which will be for images and I want the hover state to be a block that is 10px less than its parent;
Here is my fiddle:
Here is my code;
HTML
<div id="container">
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
<li class="item w2 h2"> <div class="inner"></div></li>
</div>
CSS - the inner class is the one with the hover
#container {
padding: 5px;
margin: 0 auto;
border: 2px solid black;
}
.item {
display:block !important;
list-style:none;
float: left;
background: #CCC;
margin: 5px;
width: 50px;
height: 50px;
}
.item.w2 { width: 300px; }
.item.h2 { height: 200px; }
.inner {
background:#fff;
background: rgba(255, 255, 255, 1);
position: absolute;
top: 10px;
left: 10px;
bottom: 10px;
right: 10px;
margin:0;
padding:0;
text-align: center;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: opacity .4s ease-in-out;
-moz-transition: opacity .4s ease-in-out;
-ms-transition: opacity .4s ease-in-out;
-o-transition: opacity .4s ease-in-out;
transition: opacity .4s ease-in-out;
}
.inner:hover {
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=95)";
filter: alpha(opacity=95);
opacity: .95;
z-index:1;
}
/* no transition on .isotope container */
.isotope .isotope-item {
/* change duration value to whatever you like */
-webkit-transition-duration: 1s;
-moz-transition-duration: 1s;
transition-duration: .6s;
}
.isotope .isotope-item {
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
transition-property: transform, opacity;
opacity:.5;
}
Consequently the "jumpy" or "jitter" disappears when there is no -transition such as ease-in-out or opacity.
I appreciate anyone who has a look! any suggestions would be great this is a huge learning curve for me :)
I created a simplified example of this problem:
http://jsfiddle.net/DqUvL/14/
I also reported the problem to MSFT:
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/107987/
HTML:
<a class="bad" href="#">
<img src="http://placekitten.com/200/200" width="200" height="200" alt="cat">
<div class="detail">
<h2>Heading</h2>
<div class="margin">
Margin
</div>
<div class="clear"></div>
</div>
</a><a class="bad" href="#">
<div class="detail">
<h2>Heading</h2>
<div class="clear"></div>
</div>
</a>
CSS:
.bad {
display: block;
outline: 1px solid blue;
}
.clear {
clear: both;
}
.bad:hover {
outline-color: red;
}
img {
float:left;
}
h2 {
margin: 0;
}
.margin {
margin: 1em 0;
}
I worked around the problem by adding a container style="overflow:hidden" around the hover elements:
http://jsfiddle.net/DqUvL/16/
This solves the simplified problem.
Thanks #mohitp:
https://stackoverflow.com/a/12665222/973470
I tested with IE 10. Seems that your divs are too big, because they have position: absolute.
Therefore they are aligned to the container. Add this to your item class:
.item {
position: relative;
}
Absolute elements are aligned to the next parent that is not static. It might be that IE's default stylesheet differs from the other browsers when it comes to list elements position. Did not checked this yet.