less - Why does this CSS work on Codepen but not directly in browser? -


i'm trying implement css-only modal box animation onto website. works on codepen found: http://codepen.io/petebot/pen/dbvkj

but can't test or customize code on website because doesn't work on html page.

what missing here?

here's html page:

<html> <head> <title></title> <style> @import url(http://fonts.googleapis.com/css?family=yanone+kaffeesatz);  .transition (@time: .5s, @range: all, @ease: ease-out) {   -moz-transition: @range @time @ease;   -webkit-transition: @range @time @ease;   -o-transition: @range @time @ease;   transition: @range @time @ease; }  .transition-delay (@time: .4s) {     -webkit-transition-delay: @time;       -moz-transition-delay: @time;       -o-transition-delay: @time;       -transition-delay: @time;  }  .border-radius(@radius) {     -moz-border-radius:@radius;     -webkit-border-radius:@radius;    border-radius: @radius; }  .gradient (@coler1: #fff, @coler2: #ccc) {     background: @coler1;     background: -moz-linear-gradient(@coler1, @coler2);     background: -webkit-linear-gradient(@coler1, @coler2);     background: -o-linear-gradient(@coler1, @coler2); }  .box-shadow(@dims:0 0 10px, @color:#000) {     box-shadow: @dims @color; // opera, ffx4     -moz-box-shadow:@dims @color; // ffx3.5     -webkit-box-shadow:@dims @color; // safari/chrome/webkit     .ie7 { filter: e(%("progid:dximagetransform.microsoft.shadow(color='%d', direction=135, strength=3)", @color)); } }  .inset(@dims:1px 1px 1px, @color:#fff) {     box-shadow: @dims @color; // opera, ffx4     -moz-box-shadow:@dims @color; // ffx3.5     -webkit-box-shadow:@dims @color; // safari/chrome/webkit }  body {    width: 100%;    background: url(http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/grid.png) repeat #fefefe; }   .button {   margin: 40px auto;   font-size: 72px;   font-family: 'yanone kaffeesatz', arial, sans-serif;   text-decoration: none;   text-shadow: 1px 1px 0px #fff;   font-weight: 400;    color: #666;   border: 1px solid #ccc;   cursor: pointer;   padding: 20px 70px 30px;   position: relative;   top: 50px;   background: #eee;   width: 300px;   display: block;   text-align: center;   .inset;   .border-radius(5px);   .transition;   &:hover{ color: #333; background: #eeffff; .transition;} }  .modalbg {     position: fixed;     font-family: arial, helvetica, sans-serif;     top: 0;     right: 0;     bottom: 0;     left: 0;     background: rgba(0,0,0,0);     z-index: 99999;     .transition(2s);   .transition-delay(.2s);     display: block;     pointer-events: none;   .dialog {     width: 400px;     position: relative;     top: -1000px;     margin: 10% auto;     padding: 5px 20px 13px 20px;     .border-radius(10px);     .gradient;     .box-shadow;   } }  .modalbg:target {     display: block;     pointer-events: auto;   background: rgba(4, 10 ,30, .8);   .transition();   .dialog {     top: -20px;     .transition(.8s);     .transition-delay;   } }    .close {     background: #606061;     color: #ffffff;     line-height: 25px;     position: absolute;     right: -12px;     text-align: center;     top: -10px;     width: 24px;     text-decoration: none;     font-weight: bold;     -webkit-border-radius: 12px;     -moz-border-radius: 12px;     border-radius: 12px;   .box-shadow;   .transition;   .transition-delay(.2s);   &:hover { background: #00d9ff; .transition; } }  .fineprint {   font-style: italic;   font-size: 10px;   color: #646; } { color: #333; text-decoration: none; }  </style>  </head>  <body>  <a class="button" href="#openmodal">open up!</a>  <div id="openmodal" class="modalbg">   <div class="dialog">     <a href="#close" title="close" class="close">x</a>     <h2>holy crap!!!</h2>         <p>you freakin' did it!</p>         <p>you opened freakin' modal window! close it, ya dingus.</p>     <p class="fineprint">based on article "creating modal window html5 & css3" @ <a href="webdesignerdepot.com">webdesigner depot</a></p>     <p class="fineprint">p.s. sorry calling dingus earlier.</p>     </div> </div>  </body> </html> 

the problem have styles in less format. less css pre-processor. not supported natively browser. should compile less styles css , add styles page.

in codepen code works because css panel configured use less codepen feature, sadly can't site / page.

check out less docs see how compile valid css.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -