Link to home
Start Free TrialLog in
Avatar of RecipeDan
RecipeDan

asked on

CSS Sticky Tape

I am trying to use the CSS Sticky Tape Feature. It works ok except the sticky tape shows 4 ticky tapes instead of 3. It is probably due to the figure group.

<html>
<head>
<title>Test</title>
<style type="text/css">
figure, figcaption {
display: block;
}
#picture{
width:100%;
overflow:hidden;
padding:20px 10px;
}
#picture figure{
float:left;
position:relative;
width:200px;
-webkit-transform:rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
transform: rotate(-3deg);
-webkit-backface-visibility:hidden;
}
#picture figure:nth-child(even) {
-webkit-transform:rotate(5deg);
-moz-transform: rotate(5deg);
-o-transform: rotate(5deg);
-ms-transform: rotate(5deg);
transform: rotate(5deg);
-webkit-backface-visibility:hidden; 
}
figure:before { 
content: '';
display: block;
position: absolute;
left:5px; 
top: -15px; 
width: 75px; 
height: 25px; 
background-color: rgba(222,220,198,0.7);
-webkit-transform: rotate(-12deg);
-moz-transform: rotate(-12deg);
-o-transform: rotate(-12deg);
-ms-transform: rotate(-12deg);
}
</style>
</head>
<body>
<div id="picture">
<figure role="group">
<figure>
<img src="TestVideos/Clouds.jpg" width="200" height="200" />
<figcaption>Clouds</figcaption>
</figure>
<figure>
<img src="TestVideos/Fields.jpg" width="200" height="200" />
<figcaption>Fields</figcaption>
</figure>
<figure>
<img src="TestVideos/sunset.jpg" width="200" height="200" />
<figcaption>Sunset</figcaption>
</figure>
</figure>
</div>
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It would have been semantically incorrect to nest figure inside of figure anyway.  Ofcourse that is academic, as the figure was not introduced until HTML5, so every reference to figure results in a validation error.  it will probably run alright in Firefox and Chrome.  May run in IE9+ if not in quirksmode or set to compatibility mode.

I IE <9 it is not going to work at all.

Cd&
Avatar of RecipeDan
RecipeDan

ASKER

It works great but how do I get them Vertical?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use the link I gave you http://jsbin.com/OWaramU/1/edit?html,output and play with the rotate  value's.  rotate(-12deg)
No I mean something like this

Video 1
Video 2
Video 3

Not this: video 1  video 2   video 3
Cd& gave you the answer.  Take away the float left.  http://jsbin.com/OWaramU/3/edit?html,output
OK...it works great. For some reason the link wouldn't open on my phone. Anyway, thanks everyone for your help.
I'm sorry, for reference this is the updated code
<html>
<head>
<title>Test</title>
<style type="text/css">
figure, figcaption {
display: block;
}
#picture{
width:100%;
overflow:hidden;
padding:20px 10px;
}
#picture figure{
    /*float:left;*/
position:relative;
width:200px;
-webkit-transform:rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
transform: rotate(-3deg);
-webkit-backface-visibility:hidden;
}
#picture figure:nth-child(even) {
-webkit-transform:rotate(5deg);
-moz-transform: rotate(5deg);
-o-transform: rotate(5deg);
-ms-transform: rotate(5deg);
transform: rotate(5deg);
-webkit-backface-visibility:hidden; 
}
figure:before { 
content: '';
display: block;
position: absolute;
left:5px; 
top: -15px; 
width: 75px; 
height: 25px; 
background-color: rgba(222,220,198,0.7);
-webkit-transform: rotate(-12deg);
-moz-transform: rotate(-12deg);
-o-transform: rotate(-12deg);
-ms-transform: rotate(-12deg);
}
</style>
</head>
<body>
<div id="picture">
<figure role="group">
  <img src="TestVideos/Clouds.jpg" width="200" height="200" />
   <figcaption>Clouds</figcaption>
</figure>
<figure>
  <img src="TestVideos/Fields.jpg" width="200" height="200" />
  <figcaption>Fields</figcaption>
</figure>
<figure>
  <img src="TestVideos/sunset.jpg" width="200" height="200" />
  <figcaption>Sunset</figcaption>
</figure>
  
</div>
</body>
</html>

Open in new window