Solved

CSS Sticky Tape

Posted on 2013-11-16
9
321 Views
Last Modified: 2013-11-17
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

0
Comment
Question by:RecipeDan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 400 total points
ID: 39653808
You had double opening figure tags at the top and double closing at the bottom.  You need to open and close your tags in the same order.  I removed the figure tag at the top and closing at the bottom.
http://jsbin.com/OWaramU/1/edit?html,output
<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

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39653840
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&
0
 
LVL 1

Author Comment

by:RecipeDan
ID: 39653874
It works great but how do I get them Vertical?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 100 total points
ID: 39653881
Get rid of the float:left.  That tells the browser not to put them on the next line if there is room on the current line.

Cd&
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39653890
Use the link I gave you http://jsbin.com/OWaramU/1/edit?html,output and play with the rotate  value's.  rotate(-12deg)
0
 
LVL 1

Author Comment

by:RecipeDan
ID: 39654069
No I mean something like this

Video 1
Video 2
Video 3

Not this: video 1  video 2   video 3
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39654085
Cd& gave you the answer.  Take away the float left.  http://jsbin.com/OWaramU/3/edit?html,output
0
 
LVL 1

Author Comment

by:RecipeDan
ID: 39654140
OK...it works great. For some reason the link wouldn't open on my phone. Anyway, thanks everyone for your help.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39654283
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

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question