POP up only css

POP UP only CSS

This is another attempt at CSS-tricks to try to control the event click with CSS, using, as in the example posted a few days ago, labels that are normally reserved for the creation of forms such as INPUT and LABEL. Here, it is create a pop-up , a window with some content, that opens when weclick on any button class and, in principle, could contain anything. In this example, I played a bit, deleted things, adding others, testing let it play out and the first thing I should clarify is that it does not work in versions prior to IE9 and if you do not know in that version. The second is that I have not found a way to control when you try to put two or more instead of a repeating except CSS and using IDs instead of classes which does not make much sense so that part, and if anyone will be pending have an idea, I'm all ears.

this is another with whatever content you want, including links or images



This would be the HTML:

<input id="popup" type="checkbox"  class="popUpControl">
class="elboton" <label for="popup">
  <span class="click"> show </ span>
  <span class="hiddenbox">
    .......
  </ Span>
</ Label>

The INPUT tag is of type checkbox, but always remain hidden, is not allowed to use CSS because we can only know if you are "marked" because when we click , change the property called checked.LABEL The label is associated with the first and is what we see. A pseudo-SPAN is SPAN button and other content that permutará, becoming visible or hiding, with some kind of animation. 's CSS:




<style>
  / * LABEL label * /
  . Elboton {
    background-color: # AAA;
    border-radius: 10px;
    box-shadow: 0 0 10px # 222 inset;
    color: # FFF;
    cursor: pointer;
    display: inline-block;
    font-size: 20px;
    margin: 0;
    padding: 5px 15px;
    position: relative;
    text-shadow: 1px 1px 1px # 000;
  }
  / * In a post Blogger. hidden internal line breaks to keep my sanity * /
  . Elboton br {display: none;}
  / * The container with what we want to show * /
  . Hiddenbox {
    background-color: # FFF;
    border-radius: 10px;
    box-shadow: 0 0 15px # 000 inset;
    left: 0;
    line-height: 0;
    margin: 25px 0;
    opacity: 0;
    padding: 15px;
    position: absolute;
    text-align: center;
    top: 100%;
    z-index: 100;
    -Moz-transform-origin: 0 0;
    -Webkit-transform-origin: 0 0;
    -O-transform-origin: 0 0;
    -Ms-transform-origin: 0 0;
    -Moz-transform: scale (0);
    -Webkit-transform: scale (0);
    -O-transform: scale (0);
    -Ms-transform: scale (0);
    -Moz-transition: all 1s;
    -Webkit-transition: all 1s;
    -O-transition: all 1s;
    -Ms-transition: all 1s;
  }
  / * Displays the contents hidden * /
  . PopUpControl: checked ~ label>. Hiddenbox {
    opacity: 1;
    -Moz-transform: scale (1);
    -Webkit-transform: scale (1);
    -O-transform: scale (1);
    -Ms-transform: scale (1);
  }
  / * The CHECKBOX we keep hidden forever * /
  . PopUpControl {display: none;}
  / * Change the text of pseudo-button * /
  . PopUpControl: checked ~ label> span.click {display: none;}
  . PopUpControl: checked ~ label: before {content: "hide";}
</ Style>

Ah. I forgot. Nor I have idea how to make pop-up appears to animate when and only when hidden does.

0 comments:

Post a Comment

Powered by Blogger.

Copyright © / webeXquisite : Site Management

Template by : webeXquisite / powered by :blogger