I am working on a footer where I did use some images but the problem is I can not make images responsive.
I don't have enough experience in frontend if anyone can give an idea or little help will really appreciate. I use bootstrap.
Here is what I've tried so far.
HTML:
<div className="clearfix" />
<footer className="footer">
<div className="container-fluid">
<div className="text-left">
<img src="https://tssg.org/wp-content/uploads/2018/01/Irelands_EU_ESIF_2014_2020_en.png"
alt="European Structural and Investment Funds" />
<img src="https://tssg.org/wp-content/uploads/2018/01/european-union-logo.png"
alt="European Regional Development Fund" />
<img src="https://tssg.org/wp-content/uploads/2018/01/HEA_Grey.png"
alt="Higher Education Authority Ireland" />
<img src="https://tssg.org/wp-content/uploads/2018/01/EI.png"
alt="Enterprise Ireland Logo" />
<img src="https://tssg.org/wp-content/uploads/2018/01/sfi-logo.png"
alt="Science Foundation Ireland Logo" />
<span className="text-right">Copyright © 2019</span>
</div>
</div>
</footer>
</div>
CSS:
.footer {
bottom: 0px;
color: #272727;
text-align: center;
padding: 12px 30px;
position: absolute;
right: 0;
left: 200px;
//background-color: #f9f9f9;
border-top: 1px solid rgb(223, 223, 255);
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
background-color: #ede9e9;
// background:#33444a;ede9e9
}
.footer img {
border: none !important;
width: auto !important;
max-height: 28px !important;
cursor: pointer;
}
.footer img:not(:last-child) {
margin-right: 50px ;
}
Couple of things:
You should use class="classes here" instead of className="classes here" in your HTML.
In your CSS add height:auto and max-width:100% to your .footer img class like so:
.footer img {
border: none !important;
width: auto !important;
height:auto;
max-width:100%;
max-height: 28px !important;
cursor: pointer;
}
That should make the images responsive.
Add class "img-responsive" for BootStrap 3 and Add class "img-fluid" for BootStrap 4.
Example:
<img src="https://tssg.org/wp-content/uploads/2018/01/sfi-logo.png" alt="Science Foundation Ireland Logo" class="img-responsive" />
Hope this helps.
Related
I'm kind of new to css and html, never touched JS or jquery.
I'm building as practice a website that looks like somewhat a portfolio site where I have some photos that are clickable. One thing that I wanted to do is, when a user hovers an image, an opaque box would pop up from the photo's bottom showing some text, the problem is that I want this text to be clickable as well so I put it inside the same anchor tag, but they don't overlap instead the clickable area stretches and the text gets positioned to the side of the image.
Is there a way of doing it so the "clickable area" doesn't stretch and the text overlap the image but without using the image as a background ?
Here's what I'm trying to achieve https://theme-frsch2.tumblr.com/ .
I've tried wrapping the text in a div and moving the text so it would overlap the image but the problem is that the "clickable" area would still be stretched anyway.
And this is what I got so far.
HTML
#allimg{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#allimg a{
margin: 10px;
border: 2px solid red;
}
#allimg img{
transition: 0.1s ease;
box-shadow: 5px 5px 10px #888888;
float: left;
border: 1px solid pink;
}
#allimg img:hover{
transform: scale(1.02);
}
#allimg a p{
color: black;
position: relative;
bottom: 20px;
left: 0;
text-align: center;
}
<div id="allimg">
<a href="link1">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text1
</p>
</a>
<a href="link2">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text2
</p>
</a>
<a href="link3">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text3
</p>
</a>
<a href="link4">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text4
</p>
</a>
</div>
Here is jsfiddel link
If you want to overlap text inside an image and achieve that hover effect on the website you attached
you have to use position: absolute for your text
and set the position for your anchor tag to relative
make it hideen by setting visibility property to hidden and opacity
to 0
then on anchor tag hover, you set it back visible and 1 opacity
#allimg{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#allimg a{
margin: 10px;
border: 2px solid red;
position: relative;
}
#allimg img{
transition: 0.1s ease;
box-shadow: 5px 5px 10px #888888;
float: left;
border: 1px solid pink;
}
#allimg img:hover{
transform: scale(1.02);
}
#allimg a p{
color: black;
position: absolute;
bottom: 0;
left: 0;
margin: 0;
text-align: center;
width: 100%;
padding: 10px 0;
background: rgba(255,255,255,.5);
visibility: hidden;
opacity: 0;
transition: .2s ease-in-out;
}
#allimg a:hover p{
visibility: visible;
opacity: 1
}
<div id="allimg">
<a href="link1">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text1
</p>
</a>
<a href="link2">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text2
</p>
</a>
<a href="link3">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text3
</p>
</a>
<a href="link4">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text4
</p>
</a>
</div>
Put the image in parent container and text in child container, then in css file add 'position:relative' to the parent container and add 'position:absolute' to the child container.
This will overlap text and image.
Somewhat like this:
HTML Part:
<div class="parent">
<img src="https://via.placeholder.com/150" alt="image">
<div class="child">
<p>Text goes here</p>
</div>
</div>
CSS Part:
.parent
{
position:relative;
text-align:center;
}
.child
{
position:absolute;
top:0px;
left:0px;
}
This will overlap text on image and you make changes as you want in the position of the text.
Here's my solution with smooth transition.
#allimg{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#allimg a{
position: relative;
margin: 10px;
border: 2px solid red;
box-sizing: border-box;
transition: all 0.3s ease;
}
#allimg img{
position: abosolute;
vertical-align: bottom;
transition: 0.1s ease;
box-shadow: 5px 5px 10px #888888;
border: 1px solid pink;
transition: all 0.3s ease;
}
#allimg img:hover{
transform: scale(1.02);
}
#allimg a p{
margin: 0;
padding: 5% 0;
width: 100%;
color: black;
background-color: #fff;
box-sizing: border-box;
position: absolute;
text-align: center;
bottom: 0;
left: 0;
opacity: 0;
transition: all 0.3s ease;
}
#allimg a:hover{
transform: scale(1.1);
transition: all 0.3s ease;
}
#allimg a:hover p{
opacity: 1;
transition: all 0.6s ease;
}
<div id="allimg">
<a href="link1">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text1
</p>
</a>
<a href="link2">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text2
</p>
</a>
<a href="link3">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text3
</p>
</a>
<a href="link4">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text4
</p>
</a>
</div>
I'm am facing this problem. I'd like to have a field of divs align next to each other. When the user hovers over the div, the div changes its background-color and gets bigger. With that, it should also be over the divs next to it. But it doesn't do that on one side.
I tried it with different aproaches, like setting the z-index from .thin to 1000 and the one from .thin:hover to 1200 and also tried to change the position to absolute, which made it be over the other ones but floating on the left side.
body {
margin: 0px;
padding: 20px;
overflow: hidden;
font-family: Arial, Helvetica, sans-serif;
z-index: -1;
position:relative;
}
.tiles{
width: 100%;
height: 100%;
align-content: center;
}
.thin {
width: 150px;
height: 150px;
background-color: #EFF0F1;
margin: 3px;
float: left;
border-radius: 3px;
display: table;
}
.thin:hover {
width: 190px;
height: 190px;
background-color: #01A3EE;
margin: -13px;
float: left;
border-radius: 3px;
-webkit-transition: background-color 300ms linear, margin 600ms linear, width 600ms linear, height 600ms linear;
-ms-transition: background-color 300ms linear, margin 600ms linear, width 600ms linear, height 600ms linear;
transition: background-color 300ms linear, margin 600ms linear, width 600ms linear, height 600ms linear;
}
p {
text-align: center;
vertical-align: middle;
display: table-cell;
}
<html>
<head>
<base target="_parent">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
<title></title>
<meta>
<meta>
</head>
<body onfocusout="" style="" onload="">
<div id="" class="tiles">
<div id="" class="thin">
<p id="">Residential Property</p>
</div>
<div id="" class="thin">
<p id="">Sales Lead</p>
</div>
<div id="" class="thin">
<p id="">Sales Opportunity</p>
</div>
<div id="" class="thin">
<p id="">Purchase Lead</p>
</div>
<div id="" class="thin">
<p id="">Purchase Opportunity</p>
</div>
</div>
</body>
</html>
So how can i make the div overlap the surrounding divs without moving the div to a different location.
I hope, someone can help with my problem. Thank you very much.
Here is working example: JsFiddle
.container {
display: flex;
}
.item {
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 100px;
background: #ccc;
cursor: pointer;
margin: 5px;
transition: all .4s;
}
.item:hover {
background-color: tomato;
transform: scale(1.3);
}
<div class="container">
<div class="item">
some text
</div>
<div class="item">
some text
</div>
<div class="item">
some text
</div>
<div class="item">
some text
</div>
</div>
z-index only works on positioned elements - below I have made your box relative and added a higher z-index to the hover
The only way to make the elements not move when hovered is to use a transform and scale them, instead of changing their physical width and height.
body {
margin: 0px;
padding: 20px;
overflow: hidden;
font-family: Arial, Helvetica, sans-serif;
}
.tiles {
width: 100%;
height: 100%;
align-content: center;
}
.thin {
width: 150px;
height: 150px;
background-color: #EFF0F1;
margin: 3px;
float: left;
border-radius: 3px;
display: table;
/* added below 2 lines */
z-index: 1;
position: relative;
}
.thin:hover {
background-color: #01A3EE;
transform: scale(1.2); /* change the width and height to a scale transformation so element doesn't move on resize, also no need to repeat items declared in .thin, unless you need to override them */
z-index: 2; /* add this */
-webkit-transition: background-color 300ms linear, transform 600ms linear;
-ms-transition: background-color 300ms linear, transform 600ms linear;
transition: background-color 300ms linear, transform 600ms linear;
}
p {
text-align: center;
vertical-align: middle;
display: table-cell;
}
<html>
<head>
<base target="_parent">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="CSS/style.css" rel="stylesheet" type="text/css" />
<title></title>
<meta>
<meta>
</head>
<body onfocusout="" style="" onload="">
<div id="" class="tiles">
<div id="" class="thin">
<p id="">Residential Property</p>
</div>
<div id="" class="thin">
<p id="">Sales Lead</p>
</div>
<div id="" class="thin">
<p id="">Sales Opportunity</p>
</div>
<div id="" class="thin">
<p id="">Purchase Lead</p>
</div>
<div id="" class="thin">
<p id="">Purchase Opportunity</p>
</div>
</div>
</body>
</html>
I think you can use scale(1.1); grow the div, it is the much simpler way to do the needful. You only need to update the CSS of :hover
.thin:hover {
transform: scale(1.1);
background-color: #01A3EE;
float: left;
border-radius: 3px;
transition: all 0.3s linear;
}
.top {
height: 500px;
width: 100%;
border: orange 25px outset;
margin-top: 20px;
margin-bottom: 20px;
}
.demo-2 {
position: relative;
width: 100%;
height: 500px;
overflow: hidden;
}
.demo-2 p,
.demo-2 h2 {
color: black;
padding: 10px;
left: -20px;
top: 20px;
position: relative
}
.demo-2 p {
font-family: 'American captain';
font-size: 12px;
line-height: 18px;
margin: 0
}
.demo-2 h2 {
font-size: 20px;
line-height: 24px;
margin: 0;
font-family: 'American captain'
}
.effect img {
position: absolute;
left: 0;
bottom: 0;
cursor: pointer;
margin: -12px 0;
-webkit-transition: bottom .3s ease-in-out;
-moz-transition: bottom .3s ease-in-out;
-o-transition: bottom .3s ease-in-out;
transition: bottom .3s ease-in-out
}
.effect img.top:hover {
bottom: -96px;
padding-top: 100px
}
h2.zero,
p.zero {
margin: 0;
padding: 0
}
<div class="top">
<img src="https://i.kinja-img.com/gawker-media/image/upload/qmybkmtqtg88gzoyltt1.jpg" alt="A Sam Hawkz Production" style="width:100%;height: 450px;">
</div>
<ul class="demo-2 effect">
<li>
<h2 class="zero">This is a cool title!</h2>
<p class="zero">Lorem ipsum dolor sit amet.</p>
</li>
<li>
<img class="top" src="http://casuallyhardcore.com/wp-content/uploads/2012/01/hardcore-gamer.jpg" alt="" />
</li>
</ul>
The 'top' class is for the first image in which i want the border and the 'demo-2' class is for the second image in which the border is coming but i don't want that. I saw the code a lot of times but there is no border attribute in any of the demo-2 class. . Any help would be highly appreciated. Thanks in advance. :)
you are using same class .top for div and img tag.
.top {
height: 500px;
width: 100%;
border: orange 25px outset;
margin-top: 20px;
margin-bottom: 20px;
}
change to
.top {
height: 500px;
width: 100%;
margin-top: 20px;
margin-bottom: 20px;
}
div.top {
border: orange 25px outset;
}
Remove the top class from second image and define a new class for it.
<div class="top">
<img src="https://i.kinja-img.com/gawker-media/image/upload/qmybkmtqtg88gzoyltt1.jpg" alt="A Sam Hawkz Production" style="width:100%;height: 450px;">
</div>
<ul class="demo-2 effect">
<li>
<h2 class="zero">This is a cool title!</h2>
<p class="zero">Lorem ipsum dolor sit amet.</p>
</li>
<li>
<img src="http://casuallyhardcore.com/wp-content/uploads/2012/01/hardcore-gamer.jpg" alt="" />
</li>
</ul>
Remove class="top" for second image as shown bellow
<pre>
<li>
<img src="http://casuallyhardcore.com/wp-content/uploads/2012/01/hardcore-gamer.jpg" alt="" />
</li>
</pre>
Okay so I have been doing some renovations to my website and I am trying to make it so on the home page you see several images and what I want to happen is that when you hover over the image it blurs and and text appears in the center of the image. I've been able to make the images blur but the thing is is that all the tutorials and Q&A on Forums that I've found use absolute positioning.
When I do that though I end up with all the images stacked on top of each other. I then put divs around each image and made the images relatively positioned. The result was the same. I checked my code in validators and it came out with no errors. I could really need some help.
Here is my current setup (the images are where I want them and they blur on hover)
https://jsfiddle.net/u9smc561/
Here is my HTML
<!-- title div -->
<div id="head">
<img src=http://www.mem3500films.minksfamily.com/pic/title.png alt="title" class="M35F">
</div>
<!-- menu bar line for anything bigger than 800px -->
<div class="menuBar line">
<img class='menu home' src=http://www.mem3500films.minksfamily.com/pic/home.png alt="Home" onclick="window.location='index.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
<img class='menu about' src=http://www.mem3500films.minksfamily.com/pic/about.jpg alt="About" onclick="window.location='About.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
<img class='menu comment' src=http://www.mem3500films.minksfamily.com/pic/comment.jpg alt="Comments" onclick="window.location='Comments.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
<img class='menu pic' src=http://www.mem3500films.minksfamily.com/pic/pic.png alt="Pictures" onclick="window.location='Pictures.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
<img class='menu active' src=http://www.mem3500films.minksfamily.com/pic/active.png alt="Activities" onclick="window.location='games.html';">
<img class="blank" src=http://www.mem3500films.minksfamily.com/pic/blank.png alt="b">
</div>
<!-- menu bar line for anything smaller than 800px -->
<div class="smenuBar" style="font-size: 2px;">
<nav>
<ul>
<li class="line">
<img class='menuPic menu' src=http://www.mem3500films.minksfamily.com/pic/mobileMenu.png alt="Menu">
<ul class="selector">
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/home.png alt="Home" onclick="window.location='index.html';"></li>
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/about.jpg alt="About" onclick="window.location='About.html';"></li>
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/comment.jpg alt="Comments" onclick="window.location='Comments.html';"></li>
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/pic.png alt="Pictures" onclick="window.location='Pictures.html';"></li>
<li><img class='menu' src=http://www.mem3500films.minksfamily.com/pic/active.png alt="Activities" onclick="window.location='games.html';"></li>
</ul>
</li>
<li class="close">
<img src=http://www.mem3500films.minksfamily.com/pic/close.png alt="Close" style="margin-top: 5px;">
</li>
</ul>
</nav>
</div>
<!-- Explanation area -->
<br>
<br>MEM 3500 Films is a collection of stop-motion animated videos.
<br>To learn more about MEM 3500 Films check out the About Page.
<br>Just click on the movie poster to go to that movies page where you can watch it.
<!-- main div section with the posters -->
<div style="margin-left:0%; margin-right:0%; width:100%; text-align:left;font-size: 25px">
<br>
<br>
<div class="left">
<img class="poster1" src=http://www.mem3500films.minksfamily.com/pic/tcb.png alt="The Coffee Break" />
<br>
<img class="poster1" src=http://www.mem3500films.minksfamily.com/pic/tvsr.png alt="tvsr" />
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/lt.james.png alt="Lt. James">
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/TRR.jpg alt="The robbers race">
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/TFP.jpg alt="The French Plane">
</div>
<div class="right">
<img class="poster1" src=http://www.mem3500films.minksfamily.com/pic/MKI6.png alt="MKI6" />
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/TPSPoster.png alt="tps">
<br>
<img class="poster1" src=http://www.mem3500films.minksfamily.com/pic/ag.jpg alt="The Air-to-Ground Attack">
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/tcp.jpg alt="The Counterfeiters">
<br>
<img class="poster" src=http://www.mem3500films.minksfamily.com/pic/mem3500films.jpg alt="mem 3500 films">
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
<!-- footer credits -->
<div style="width:100%; text-align:center; font-size: 25px;">
<br>
<footer style="">LEGO, the LEGO logo, and the Minifigure are trademarks and/or copyrights of the LEGO Group. I am not supported by LEGO or in any way is this website. Check out the LEGO website for more cool stuff. LEGO.com
<br>
<p style="margin: 0;">
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0; width:88px; height:31px; margin: 10px;" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" />
</a>
</p>
</footer>
</div>
And my CSS
/* makes the stuff for the tall posters */
.poster {
-webkit-transition: -webkit-filter 0.4s;
-moz-transition: -webkit-filter 0.4s;
-ms-transition: -webkit-filter 0.4s;
-o-transition: -webkit-filter 0.4s;
transition: -webkit-filter 0.4s;
width: 100%;
border-radius: 15px;
max-width: 450px;
max-height: 601px;
}
.poster:hover{
-webkit-filter: blur(7px);
filter: blur(7px);
}
/* makes the stuff for the wide posters */
.poster1 {
-webkit-transition: -webkit-filter 0.3s;
-moz-transition: -webkit-filter 0.3s;
-ms-transition: -webkit-filter 0.3s;
-o-transition: -webkit-filter 0.3s;
transition: -webkit-filter 0.3s;
width: 100%;
border-radius: 15px;
max-width: 450px;
max-height: 260px;
}
.poster1:hover{
-webkit-filter: blur(7px);
filter: blur(7px);
}
/* the main div holders for the posters */
.left {
width: 49%;
display: inline-block;
margin-left: 1px;
text-align: right;
}
.right {
width: 49%;
display: inline-block;
margin-right: 0px;
text-align: left;
}
/* the menu bar stuff */
#media only screen
and (min-width : 801px) {
.menuBar {
display: block;
}
.smenuBar, .close{
display: none;
}
/* makes sure the buttons are not to big */
.home {
width: 10.1%;
max-width: 107px;
}
.about {
width: 11.1%;
max-width: 117px;
}
.comment {
width: 16.7%;
max-width: 173px;
}
.pic {
width: 16.8%;
max-width: 174px;
}
.active {
width: 16.1%;
max-width: 167px;
}
.blank {
width: 1%;
max-width: 3px;
max-height: 25px;
margin-top: 10px;
margin-bottom: 10px;
}
/* makes the hover effect for the menu buttons */
.menu {
cursor: pointer;
margin-top: 10px;
margin-bottom: 10px;
-webkit-transition: -webkit-filter 0.5s; /* Safari */
-moz-transition: -webkit-filter 0.5s;
-ms-transition: -webkit-filter 0.5s;
-o-transition: -webkit-filter 0.5s;
transition: -webkit-filter 0.5s;
}
.menu:hover {
cursor: pointer;
margin-top: 10px;
margin-bottom: 10px;
-webkit-filter: invert(1); /* Safari */
-moz-filter: invert(1);
-ms-filter: invert(1);
-o-filter: invert(1);
filter: invert(1);
}
}
/* end of computer menu bar config */
/* start of mobile menu config */
#media only screen
and (max-width : 800px) {
/* stuff to make sure the other menu doesn't show */
.menuBar {
display: none;
}
.smenuBar, .close {
display: block;
}
.menuPic {
width: 90%;
max-width: 143px;
}
/* stuff to make sure there isn't indenting */
li {
list-style-type: none;
padding: 0;
}
ul {
list-style-type: none;
padding: 0;
margin: 0;
}
/* drop down part of the menu stuff */
nav ul ul {
height: 0px;
overflow: hidden;
-webkit-transition: height 0.5s; /* Safari */
-moz-transition: height 0.5s;
-ms-transition: height 0.5s;
-o-transition: height 0.5s;
transition: height 0.5s;
}
nav ul .line:hover > ul {
height: 335px;
}
nav ul .line:active > ul {
height: 335px;
}
nav ul .line:hover + .close {
height: 52px;
}
nav ul .line:active + .cose {
height: 52px;
}
.close {
text-align: center;
background:rgba(0,0,0,0.8);
height: 0px;
overflow: hidden;
-webkit-transition: all 0.5s; /* Safari */
-moz-transition: all 0.5s;
-ms-transition: all 0.5s;
-o-transition: all 0.5s;
transition: all 0.5s;
}
/* makes the hover effect for the menu buttons */
.menu {
cursor: pointer;
margin-top: 10px;
margin-bottom: 10px;
-webkit-transition: -webkit-filter 0.5s; /* Safari */
-moz-transition: -webkit-filter 0.5s;
-ms-transition: -webkit-filter 0.5s;
-o-transition: -webkit-filter 0.5s;
transition: -webkit-filter 0.5s;
}
.menu:hover {
cursor: pointer;
margin-top: 10px;
margin-bottom: 10px;
-webkit-filter: invert(1); /* Safari */
-moz-filter: invert(1);
-ms-filter: invert(1);
-o-filter: invert(1);
filter: invert(1);
}
}
.selector {
width: 100%;
background-image:url('pic/wline.jpeg');
padding: 0;
}
/* end of menu config */
/* sets the body properties */
body {
background-image:url('http://www.mem3500films.minksfamily.com/pic/lego.jpeg');
background-color: #ffd700;
text-align:center;
font-size: 25px;
}
/* the title attributes */
body{margin:0;padding:0}
#head {
background-image:url('http://www.mem3500films.minksfamily.com/pic/lego1.jpeg');
background-repeat:repeat;
width: 100%;
}
/*the menu line div attributes */
body{margin:0;padding:0}
.line {
background-image:url('http://www.mem3500films.minksfamily.com/pic/line.jpeg');
background-repeat:repeat;
width: 100%;
}
/* makes sure that the website title is not to big */
.M35F {
width: 100%;
max-width: 905px;
margin-top: 20px;
margin-bottom: 20px;
}
/* makes sure links never get underlined */
a {
text-decoration:none;
}
/* gives the footer a background image */
footer {
background-image:url('pic/white.jpeg');
background-repeat:repeat;
text-align: left;
background-color: #FFFFFF;
color: #888888;
font-size: 25px;
}
In my current setup I have it so the images resize with the window then stop getting bigger at a certain size. This works fine now and I want it to be able to do this in the end.
But I have tried SOOOO many things to get this to work and spent hours (literally) but no matter what I've done it doesn't seem to work. Is what I am shooting for not even possible with CSS and HTML?
Remember an important concept. Absolute positioned elements are positioned relatively the first ANCESTOR that has positon different from "static"
Thus, to position your "strings" you need to
wrap the images in a div
make that div "position: relative"
put the text in a div or a span or other container
make the container "position: abolute"
This way you should not have problem with images staing one over another.
.poster p {
position:relative;
top:50%;
transform:translateY(-50%);
}
This will position itself in the vertical center.
add the following to .poster:
text-align:center;
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>