Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CSS Sticky Tape

Posted on 2013-11-16
9
Medium Priority
?
338 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
  • 4
  • 3
  • 2
9 Comments
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 1600 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 400 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 54

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 54

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 54

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

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!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

971 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