Solved

CSS Sticky Tape

Posted on 2013-11-16
9
322 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 53

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 53

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 53

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 53

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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Title # Comments Views Activity
CSS style formatting? 2 62
Expanding/Collapsing Tree on SharePoint List 29 66
Can't find an open element in HTML 5 55
Sticking text to shapes in Raphael.js 6 41
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

752 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