Position an object relative to its container? - html

I'm making a server listing website and for each server I'd like to display an image and some information that will be shown when the pictured is "hovered" with the mouse.
When the server name is too long, I want it to scroll to show the remaining text when hovered, how would I do this without specifying the length in CSS?
Example: http://jsfiddle.net/5EhSx/2
<div class='server'>
<div class='server_info'>
<div align='center' style='margin: 5px; white-space:nowrap; overflow:hidden;'><span class='server_name'>Abc def ghi jkl mno pqr stu vwx yza bcd efg hij klm nop qrs tuv wxy zab cde</span>
</div>
<div style='overflow:hidden; padding: 0 5px;'>
<div style='float:left;'>26 Comments</div>
<div style='float:right;'>17649 Votes</div>
</div>
<div style='overflow:hidden; padding: 0 5px;'>
<div style='float:left;'>Uptime: 99.7%</div>
<div style='float:right;'>73/96 Players</div>
</div>
</div>
</div>
Css:
.server {
font-family:Verdana, Geneva, sans-serif;
font-size:12px;
height: 170px;
width: 310px;
border: 1px solid grey;
position:relative;
overflow:hidden;
border-bottom-right-radius:7px;
border-bottom-left-radius:7px;
cursor:pointer;
float:left;
border-radius: 7px;
}
.server_info {
color: #FFFFFF;
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
width: 100%;
bottom: 0;
border-bottom-right-radius:7px;
border-bottom-left-radius:7px;
height: 25px;
transition: height 0.5s;
-webkit-transition: height 0.5s;
}
.server_name {
position: relative;
left: 0;
transition: left 1s;
-webkit-transition: left 1s;
}
.server:hover .server_info {
height: 60px;
transition: height 0.5s;
-webkit-transition: height 0.5s;
}
.server:hover .server_name {
left: -165px;
transition: left 3s;
-webkit-transition: left 3s;
}

You can specify both properties: width and left (if position:absolute) or margin-left (if position:relative) in percentage, like: width:20%; margin-left:15%;

Related

Pure CSS and HTML problem - Why the :hover status would ruin a position:absolute item in Chrome?

I want to make a utility box on the left side of my page, with two buttons: A blue one and a grey one. The grey one has a tooltip within it.
Here is the code:
body {background:black}
#side-root {
position:fixed;
bottom:0;
z-index:9999;
display:flex;
width:100%;
top: 50%;
flex-direction: column;
width: 65px !important;
bottom:auto !important;
transform:translate(0,-50%);
left:0;
padding-right:40px;
}
#side-root a:hover, #side-root b:hover{
padding-left:9px;
}
#side-root a div, #side-root b div{
height:45px;
width:45px;
background-repeat:no-repeat;
margin:0 auto;
background-size:45px
}
.side-a {
background:#1877F2d6;
width:100%;
cursor:pointer;
backdrop-filter:blur(15px) contrast(5);
}
.side-a:hover {
background:#1877F2;
backdrop-filter:none;
}
.side-b {
background:#B1B1B1d6;
width:100%;
cursor:pointer;
backdrop-filter:blur(15px) contrast(5);
}
.side-b:hover {
background:#B1B1B1;
backdrop-filter:none;
}
.b-tooltip {
position: fixed;
white-space: nowrap;
width: auto !important;
height: auto !important;
padding: 0.5rem;
font-size: 0.875rem;
box-shadow: 0 1px 1px rgba(173, 168, 168, 0.1);
border-radius: 3px;
background-color: #333;
color: #fff;
border: 1px solid #333;
line-height: 18px;
box-sizing: border-box;
transition: opacity .2s ease-in-out;
z-index:9;
top:4px;
left:76px;
}
.b-tooltip svg {
position: static;
fill: #fff;
margin-right: 0.5rem;
width: 14px;
height: 14px;
vertical-align: middle;
}
<div id="side-root">
<a class="side-a">
<div class="side-a-icon"></div>
</a>
<b class="side-b">
<div class="side-b-icon">
<div class="b-tooltip">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M19 0C8.5 0 0 8.5 0 19s8.5 19 19 19 19-8.5 19-19S29.5 0 19 0zm0 24.8c-1.6 1.6-4.2 1.6-5.8 0l-5.4-5.4 2.9-2.9 5.4 5.4 11-11 2.9 2.9-11 11z"></path></svg>
<span>done</span>
</div>
</div>
</b>
</div>
The expected behavior is to keep the .b-tooltip box always fixed. However, it's very strange that if I hover the mouse on the .side-b, the .b-tooltip box would go up.
What's even weird is that this happens only on Chrome Version 96.0.4664.55 (Official Build) (x86_64) :
And even worse, is that on Safari Version 15.1 (17612.2.9.1.20), it's still not right (the problem is that .b-tooltip is always on the first blue box, which should be on the second grey box)
What I want is:
Don't shift the .b-tooltip box when I hover
Make the .b-tooltip box's position related to the second grey box, not the first blue box.
Is this that you are looking for?
body {background:black}
#side-root {
position:fixed;
bottom:0;
z-index:9999;
display:flex;
width:100%;
top: 50%;
flex-direction: column;
width: 65px !important;
bottom:auto !important;
transform:translate(0,-50%);
left:0;
padding-right:40px;
}
#side-root a:hover, #side-root b:hover{
padding-left:9px;
}
#side-root a div, #side-root b div{
height:45px;
width:45px;
background-repeat:no-repeat;
margin:0 auto;
background-size:45px
}
.side-a {
background:#1877F2d6;
width:100%;
cursor:pointer;
backdrop-filter:blur(15px) contrast(5);
position: relative;
}
.side-a:hover {
background:#1877F2;
backdrop-filter:none;
}
.side-b {
background:#B1B1B1d6;
width:100%;
cursor:pointer;
backdrop-filter:blur(15px) contrast(5);
position: relative;
}
.side-b:hover {
background:#B1B1B1;
backdrop-filter:none;
}
.b-tooltip {
position: absolute;
white-space: nowrap;
width: auto !important;
height: auto !important;
padding: 0.5rem;
font-size: 0.875rem;
box-shadow: 0 1px 1px rgba(173, 168, 168, 0.1);
border-radius: 3px;
background-color: #333;
color: #fff;
border: 1px solid #333;
line-height: 18px;
box-sizing: border-box;
transition: opacity .2s ease-in-out;
z-index:9;
top:4px;
left:76px;
}
.side-b:hover .b-tooltip {
left: 86px;
}
.b-tooltip svg {
position: static;
fill: #fff;
margin-right: 0.5rem;
width: 14px;
height: 14px;
vertical-align: middle;
}
<div id="side-root">
<a class="side-a">
<div class="side-a-icon"></div>
</a>
<b class="side-b">
<div class="side-b-icon">
<div class="b-tooltip">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M19 0C8.5 0 0 8.5 0 19s8.5 19 19 19 19-8.5 19-19S29.5 0 19 0zm0 24.8c-1.6 1.6-4.2 1.6-5.8 0l-5.4-5.4 2.9-2.9 5.4 5.4 11-11 2.9 2.9-11 11z"></path></svg>
<span>done</span>
</div>
</div>
</b>
</div>

(HTML: data-filter attribute) How to set default attribute section instead of showing all record.on page load

I need that default filter value should be set, instead of showing all elements.
Once Page is loaded, By default all values are getting displayed and on click of anchor specific filter values are getting displayed (like blue color in this example).
For Given Example:
After page load, instead of showing all color, Blue color elements needs to be shown. By default all values are getting displayed, but I need a specific color data value.
CSS:
section {
display: block;
float: left;
border: 2px solid green;
min-height: 300px;
width: 100%;
border-radius: 4px;
}
a {
display: block;
float: left;
width: 25%;
text-decoration: none;
text-align: center;
padding: 5px 0;
color: white;
background: #1271C7;
}
div {
display: block;
float: left;
height: 40px;
width: 40px;
border: 1px solid black;
margin: 10px;
-webkit-transition: all .8s linear;
-moz-transition: all .8s linear;
-o-transition: all .8s linear;
-ms-transition: all .8s linear;
transition: all .8s linear;
margin-top: 20px;
}
div[data-filter="red"] {
background: red;
}
div[data-filter="green"] {
background: green;
}
div[data-filter="blue"] {
background: blue;
}
a:focus[data-filter] {
opacity: .8;
outline: none;
}
a[data-filter="red"]:focus ~ div:not([data-filter="red"]) {
height: 0px;
width: 0px;
border: none;
margin: 0;
}
a[data-filter="green"]:focus ~ div:not([data-filter="green"]) {
height: 0px;
width: 0px;
border: none;
margin: 0;
}
a[data-filter="blue"]:focus ~ div:not([data-filter="blue"]) {
height: 0px;
width: 0px;
border: none;
margin: 0;
}
HTML:
<section>
<a id="tab2" href="#" data-filter="red" tabindex="-1">RED</a>
<a id="tab3" href="#" data-filter="green" tabindex="-1">GREEN</a>
<a id="tab4" href="#" data-filter="blue" tabindex="-1">BLUE</a>
<div data-filter="red"/>
<div data-filter="blue"/>
<div data-filter="red"/>
<div data-filter="blue"/>
<div data-filter="green"/>
<div data-filter="red"/>
<div data-filter="red"/>
<div data-filter="red"/>
<div data-filter="blue"/>
<div data-filter="green"/>
<div data-filter="blue"/>
<div data-filter="green"/>
<div data-filter="green"/>
</section>
You can use jQuery to customize your app. Using css alone you can't do this. here is the solution using jquery.
$(document).ready(function(){
$('div[data-filter="red"').show(0); // only red column on page load
$("a").click(function(e){
e.preventDefault();
var x=$(this).attr("data-filter"); //returns data-filter value of a tag
if(x=="all"){
$('div[data-filter').show(0);
}
else{
$("div[ data-filter]").hide(0);
$('div[data-filter="' + x +'"]').show(0);
}
})
})

Overflow:hidden effecting zoom image

I'm creating a slider where .slider-wrap is a parent div which has rule overflow: hidden; and I want my every image should zoom in whenever I hover on div slider-boxes everything is working fine until I'm using overflow: hidden; but when I start to use overflow: hidden; image doesn't zoom out as the Desired Result in Snippet 2 where I'm not using overflow: hidden;
I want my final result like Snippet 2
But I think overflow is important to use because there will be more images come when I will make it dynamic so is there any way to fix this issue.
here is the jsfiddle https://jsfiddle.net/rhulkashyap/7g3vypqh/
Snippet 1: I'm Getting
body{
background-color: #DD3735;
padding-top:30px;
}
.slider-wrap{
width:616px;
height:120px;
border:1px solid #ccc;
margin:0 auto;
box-shadow: 0 0 10px #000;
border-radius:5px;
overflow:hidden;
}
img, .slider-boxes{
width:120px;
height:120px;
}
.slider-boxes{
display: inline-block;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.slider-boxes:hover{
-webkit-transform: scale(1.30);
transform: scale(1.30);
box-shadow: 0 0 10px #000;
}
<div class="slider-wrap">
<div class="slider-boxes"><img src="https://pbs.twimg.com/profile_images/378800000108340114/a586d7a8df39836a114651aef74cd2d0_400x400.jpeg" alt="Image1"></div>
<div class="slider-boxes"><img src="https://s-media-cache-ak0.pinimg.com/736x/77/06/4e/77064e4e9ccc289ee5394dd7dbf48011.jpg" alt="Image2"></div>
<div class="slider-boxes"><img src="http://gloimg.gearbest.com/gb/2014/201411/goods-img/1415993980392-P-2179386.jpg" alt="Image3"></div>
<div class="slider-boxes"><img src="https://pbs.twimg.com/profile_images/378800000451012500/4628fbb9dc70514d389ed9491243866f_400x400.png" alt="Image4"></div>
<div class="slider-boxes"><img src="http://howtodrawdat.com/wp-content/uploads/2014/01/1st-pic-Dave-Minion-from-despicable-me.png" alt="Image5"></div>
</div>
Snippet 2: Desired Result
body{
background-color: #DD3735;
padding-top:30px;
}
.slider-wrap{
width:616px;
height:120px;
border:1px solid #ccc;
margin:0 auto;
box-shadow: 0 0 10px #000;
border-radius:5px;
}
img, .slider-boxes{
width:120px;
height:120px;
}
.slider-boxes{
display: inline-block;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.slider-boxes:hover{
-webkit-transform: scale(1.30);
transform: scale(1.30);
box-shadow: 0 0 10px #000;
}
<div class="slider-wrap">
<div class="slider-boxes"><img src="https://pbs.twimg.com/profile_images/378800000108340114/a586d7a8df39836a114651aef74cd2d0_400x400.jpeg" alt="Image1"></div>
<div class="slider-boxes"><img src="https://s-media-cache-ak0.pinimg.com/736x/77/06/4e/77064e4e9ccc289ee5394dd7dbf48011.jpg" alt="Image2"></div>
<div class="slider-boxes"><img src="http://gloimg.gearbest.com/gb/2014/201411/goods-img/1415993980392-P-2179386.jpg" alt="Image3"></div>
<div class="slider-boxes"><img src="https://pbs.twimg.com/profile_images/378800000451012500/4628fbb9dc70514d389ed9491243866f_400x400.png" alt="Image4"></div>
<div class="slider-boxes"><img src="http://howtodrawdat.com/wp-content/uploads/2014/01/1st-pic-Dave-Minion-from-despicable-me.png" alt="Image5"></div>
</div>
This is not the prettiest solution, but it does solve it somewhat..
Adding a
.sliding-wrap:hover
{
overflow: visible;
}
does the trick, but it doesn't make the easing out very pretty..
Fiddle

fix position div on top of parent so it doesn't move on resize

I know there is a lot of discussion out there on this topic, and I've read a lot and tired a number of things. This tutorial was very helpful http://alistapart.com/article/css-positioning-101 with some of my other pages. But this one is throwing me.
I'm trying to position the #mainwrapper central and on top on top of the #bubble div. I have achieved this by specifying the position with top:200px ect. But when resizing the window everything moves. I've fixed the issue on other pages by position using relative positioning. Howver when I tried that on this page it hides the #mainwrapper behind the #bubble.
Really stuck!
<div id="bubble">
<div class="content">
<div class ="nav_image">
<img src="../navbar/backbar.gif" height="114"/><br />
<nav>
<ul>
<li class='active'>Home</li>
<li class='has-sub'>Cottages
<ul>
<li class="has-sub">Farmhouse
<ul>
<li>Facilities</li>
<li>Guest Book</li>
<li>Booking Rates</li>
</ul>
</li>
<li class="has-sub">The Barn
<ul>
<li>Facilities</li>
<li>Guest Book</li>
<li>Booking Rates</li>
</ul>
</li>
<li class="has-sub">Granary
<ul>
<li>Facilities</li>
<li>Guest Book</li>
<li>Booking Rates</li>
</ul>
</li>
</ul>
</li>
<li>Croyde</li>
<li>Contact us</li>
</ul>
</nav>
</div>
</div>
</div>
<div id="mainwrapper">
<div id="box-1" class="box">
<img id="image-1" src="030.jpg"/>
<span class="caption simple-caption">
The Farmhouse
</span>
</div>
<div id="box-2" class="box">
<img id="image-2" src="040.jpg"/>
<span class="caption simple-caption">
The Barn
</span>
</div>
<div id="box-3" class="box">
<img id="image-3" src="038.jpg"/>
<span class="caption simple-caption">
The Granary
</span>
</div>
</div>
<div id="bubble2">
<div class="blurb">
<img src="../titles/the cottages (Copy).jpg" alt="The Cottages">
<p>The properties are idyllically situated right in the heart of the picturesque Devon coastal village of Croyde, which has history that stretches over a thousand years to pre-saxon times.</p>
<p>The Farmhouse & Barn are 17th century Grade II listed and both sleep 6. The Granary is Curtelage listed and sleeps 2. All of the cottages can be rented togther or seperatly as required. The Barn and Farmhouse are ideal for big parties with an interconnecting door which we can arrange to be unlocked.</p>
<p>The cottages are located centrally in the village, down a small quiet lane just 5 minutes walk to the pubs and eateries and 10 minutes walk to the beautiful sandy beach.</p>
</div>
</div>
</body>
</html>
CSS:
#charset "utf-8";
/* CSS Document */
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background: #4E5869;
color: #000;
}
#bubble {
width: 1013px;
height: 800px;
left: 6px;
margin: 0 auto;
background-image: url('../images/sea board (Copy).jpg');
background-repeat: no-repeat;
-moz-border-radius: 10px;
-khtml-border-radius: 10px;
-webkit-border-radius: 10px;
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-khtml-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
position: relative;
z-index: 90; /* the stack order: displayed under ribbon rectangle (100) */
}
#mainwrapper {
position: relative;
top: 32px;
width: 740px;
background: transparant;
padding: 20px 50px 20px 50px;
min-height: 250px;
height: auto;
}
#mainwrapper .box {
position: relative;
border: 3px solid white;
cursor: pointer;
height: 225px;
float: left;
overflow: hidden;
width: 225px;
-webkit-box-shadow: 1px 1px 1px 1px #ccc;
-moz-box-shadow: 1px 1px 1px 1px #ccc;
box-shadow: 1px 1px 1px 1px #ccc;
}
#bubble2{
position: relative;
width: 980px;
height: 300px;
margin: 0 auto;
background:white;
-moz-border-radius: 10px;
-khtml-border-radius: 10px;
-webkit-border-radius: 10px;
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-khtml-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
z-index: 90; /* the stack order: displayed under ribbon rectangle (100) */
}
#mainwrapper .box img {
position: relative;
left: 0;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
}
#mainwrapper .box .caption {
background-color: rgba(0,0,0,0.8);
position: absolute;
color: #fff;
z-index: 100;
-webkit-transition: all 300ms ease-out;
-moz-transition: all 300ms ease-out;
-o-transition: all 300ms ease-out;
-ms-transition: all 300ms ease-out;
transition: all 300ms ease-out;
left: 0;
}
#mainwrapper .box .simple-caption {
height: 70px;
width: 225px;
display: block;
bottom: -80px;
line-height: 15pt;
text-align: center;
}
#mainwrapper .box:hover .simple-caption {
-moz-transform: translateY(-100%);
-o-transform: translateY(-100%);
-webkit-transform: translateY(-100%);
transform: translateY(-100%);
}
#mainwrapper .span {
text-decoration: none;
color: white;
font-weight: bold;
}
h1{
font-size: 100%;
font-weight: bold;
padding-right: 15px;
padding-left: 15px;
}
h2, h3, h4, h5, h6, p {
margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
padding-right: 15px;
padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
}
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
border: none;
}
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
color: #33CCFF;
text-decoration: none;
font-size: medium;
font-weight: normal;
}
a:visited {
color: #0033CC;
text-decoration: underline;
}
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
text-decoration: none;
}
.content {
padding: 10px 0;
}
/* ~~ This grouped selector gives the lists in the .content area space ~~ */
.content ul, .content ol {
padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
}
/* ~~ miscellaneous float/clear classes ~~ */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the overflow:hidden on the .container is removed */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
Any help would be hreat!
Thanks
Does adding margin:0 auto; like this?
#mainwrapper {
position: relative;
top: 32px;
width: 740px;
background: transparant;
padding: 20px 50px 20px 50px;
min-height: 250px;
height: auto;
margin:0 auto;
}
Does that resolve you're issue? if you're having problems with absolutes falling behind other objects z-index can often be very helpful.
Pen of the above solution here
http://codepen.io/dave_agilepixel/pen/bgjlv

Make elements hidding using Z-index

Got an issue here regarding making other div-elements hidden when and other div has been visible.
As you see in my code below, when f.ex. star trek have been visible, I want pacific rim and world war z to disappear using z-index.
My HTML code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>BluShop</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<header id="header">
<h1>BluShop</h1>
</header>
<section id="leftContent">
<div id="pacificrimContent">
<h2>Pacific Rim</h2>
<img alt="pacificrim image" src="../bilder/pacificRim.jpg">
<p>Blahblahblah</p>
</div>
<div id="startrekContent">
<h2>Star Trek</h2>
<img alt="startrek image" src="../bilder/starTrek.jpg">
<p>blahblahblah</p>
</div>
<div id="worldwarzContent">
<h2>World War Z</h2>
<img alt="worldwarz image" src="../bilder/worldWarZ.jpg">
<p>blahblahblah</p>
</div>
</section>
<aside id="rightContent">
<div id="pacificrimPoster">
<img alt="pacificrim poster" src="../bilder/pacificRim.jpg">
</div>
<div id="startrekPoster">
<img alt="startrek poster" src="../bilder/starTrek.jpg">
</div>
<div id="worldwarzPoster">
<img alt="worldwarz poster" src="../bilder/worldWarZ.jpg">
</div>
</aside>
<footer id="footer">
</footer>
</div>
</body>
</html>
The CSS code
#charset "utf-8";
/* CSS Document */
body{
margin: 0;
}
#container{
width: 960px;
height: 600px;
margin: auto;
background-color: rgb(78, 80, 85);
border: solid 1px rgb(213, 214, 215);
}
#header{
height: 60px;
background-color: rgb(66, 69, 74);
margin-bottom: 10px;
}
#header h1{
float: left;
margin: 0px 10px 0px 10px;
color: rgb(14, 177, 238);
}
#leftContent{
float: left;
position: relative;
margin: 0px 10px 10px 10px;;
height: 460px;
width: 780px;
background-color: rgb(230, 231, 232);
}
#leftContent h2{
font-size: 20px;
margin: 10px 0px 0px 10px;
}
#leftContent img{
float: left;
margin: 0px 20px 10px 10px;
width: 310px;
height: 420px;
}
#leftContent p{
margin: -4px 20px 10px 0px;
}
#pacificrimContent, #startrekContent, #worldwarzContent{
position: absolute;
overflow: hidden;
transition: height .5s ease-in;
-webkit-transition: height .5s ease-in;
-moz-transition: height .5s ease-in;
}
#startrekContent, #worldwarzContent{
z-index: -1;
height: 0;
}
#rightContent{
float: right;
width: 140px;
height: 460px;
margin: 0px 10px 10px 10px;
background-color: rgb(230, 231, 232);
}
#rightContent img{
display: block;
width: 100px;
margin-left: auto;
margin-right: auto;
margin-top: 20px
}
#pacificrimContent:target, #startrekContent:target, #worldwarzContent:target{
height: 100%;
z-index: 10;
}
#footer{
height: 60px;
margin: 0;
background-color: rgb(16, 163, 210);
clear: both;
}
As you see I need Pacific Rim to be the standard movie that show up when people vist the website, and the other should be visible when I target them. Then the movie I target should be visible. Per now, Pacific Rim is ALWAYS visible and in the background of the other movie.
So if i f.ex. choose to target the star trek movie, and then so the world war z movie. I see the Pacific Rim movie behind when the transition is working.
I am not allowed to use javascript, so is there a way I can get this working?
Thanks!
jsfiddle.net/f8ns4 - JSFiddle to show what i mean!
Give your individual movie divs a background color so you cant see whats underneath it.
#pacificrimContent, #startrekContent, #worldwarzContent{
position: absolute;
overflow: hidden;
transition: height .5s ease-in;
-webkit-transition: height .5s ease-in;
-moz-transition: height .5s ease-in;
background-color: rgb(230, 231, 232);
}
Demo: http://jsfiddle.net/f8ns4/1/