Responsive CSS question

Posted on 2016-11-06
Last Modified: 2016-11-16
Hi, I have created an animation for some xmas gift unwrapping as below,

I would need some help or guidance in making the ribbons responsive. Meaning, the ribbon ends should touch the ends and should adjust automatically to different screen size and to mobile. How do i do that?

Other thing is it, the "Open Here" strip shows up in some browsers (Chrome) but not in some browsers (Safari). How do i correct that to appear in all browsers.

Question by:Perumal_RM
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
LVL 25

Assisted Solution

lenamtl earned 100 total points
ID: 41876525

I usually put max-height  max-width in css instead of fixed dimension or I use percentage
this is usually play well for responsive.

So you may try different values for the ribbon css, the banner div is already 100% which is good.

Also try z-index value for the bottom ribbon

You may also want to read how media query work to set different css values depending of the device size screen.

I don't know if you are already using Bootstrap framework, it's have media query and helper class for alignment.

Open here tag does not show all the time even with Chrome..
Try to place the image into the tag div, now it is outside the div...
The animation is too quick so I don't think user will have the time to click on it anyway so you may adjust the delay .

By the way you have error with turn.js when inspecting the code with chrome (right click inspect)
turn.js:1798 Uncaught TypeError: Cannot read property 'disabled' of undefined
    at n.fn.init._eventMove (
    at HTMLDocument.<anonymous> (
    at HTMLDocument.dispatch (
    at HTMLDocument.r.handle (

Open in new window

I guess you need to initialize turn.js ..
LVL 34

Accepted Solution

Slick812 earned 400 total points
ID: 41877732
greetings Perumal_RM, , I do not see any way to have the Images you use in the -
  <div id='leftribbon'  style='position: absolute;top: 15%;left: 0;z-index: 1;'><img src='images/RibbonLeft.png'/></div>
  <div id='topribbon' style='position: absolute;top: 0;left: 47%;'><img src='images/RibbonTop.png'/></div>
  <div id='rightribbon' style='position: absolute;top: 38%;left: 55%;'><img src='images/RibbonRight.png'/></div>
  <div id='bottomribbon' style='position: absolute;top: 52%;left: 47%;'><img src='images/RibbonBottom.png'/></div>

Open in new window

ever be capable of being "responsive", this is mostly due to the image in -
     <img src='images/RibbonLeft.png'/>
you have the ribbon "BOW" and the "RIBBON" in the image, you need to have a separate "BOW" image in order to have that "CENTERED" on your <div id='banner'>

I have redone the four images you use in this ribbon thing, and use two images for the "ribbons" created a third image as the "bow.png" to be centered in the <div id='banner'>
center BOW imagevertical Ribbon imagehorizontal Ribbon image
In order to use any page on phones and tablets as a "responsive page" you MUST have the meta viewport -
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />

here is a page that looks responsive -
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
margin: 1px;

#banner {
border: 1px solid #922;


.magazine .turn-page{
background-size:100% 100%;

#openImg {
display: inline-block;
position: absolute;
top: 200px;
left: 50%;
margin-left: -260px;
cursor: pointer;
z-index: 4;

#leftribbon {
position: absolute;
top: 168px;
left: 0;
z-index: 2;

#topribbon {
position: absolute;
top: -2px;
left: 50%;
z-index: 2;
margin-left: -22px;

#bottomribbon {
position: absolute;
bottom: -1px;
left: 50%;
z-index: 2;
margin-left: -22px;

#rightribbon {
position: absolute;
top: 168px;
right: 0px;
z-index: 2;

#bow {
position: absolute;
top: 90px;
left: 50%;
margin-left: -175px;
z-index: 3;



<div id='banner'>
  <div class='magazine'>
  <div style="height: 395px; background-image:url(images/wrapper.png);" class='double'></div>
  <div class='orignalContent'>Discounted Price</div>
  <div id="openImg"><img id='openhere' src='images/openhere.png' /></div>
  <div id='leftribbon'><img src='images/ribbonHorz.png'/></div>
  <div id='topribbon'><img src='images/ribbonVer.png'/></div>
  <div id='rightribbon'><img src='images/ribbonHorz.png'/></div>
  <div id='bottomribbon'><img src='images/ribbonVer.png'/></div>
  <div id='bow'><img src='images/bow.png'/></div>

Open in new window

You really need to Not use the "inline" style like -
    <div id='leftribbon'  style='position: absolute;top: 15%;left: 0;z-index: 1;'>

and instead use the element ID  or CLASS to add CSS to your page like -
#leftribbon {
position: absolute;
top: 168px;
left: 0;
z-index: 2;

<div id='leftribbon'></div>

= = = = = = = = = = = = = =
also in this arrangement of layers, the z-index is important, , I did not understand what you were doing this the z-index values you used? ?

Ask questions if there is something that does not seem to be what you may need.

Featured Post

Technology Partners: 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

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

738 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