css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="myContainer">
         <!-- inheritance applies only to contained divs -->
         <div style="background-color: green;"> I am happy today</div>
         &nbsp;
         <!-- apply the inheritance -->
         <div class="divBaseClass" >
            <div class="myDiv"> 
               001
            </div>
            <div class="myDiv45">
               002
            </div>
            <div class="myDiv45MovedUp">
               002.1
            </div>
            <div class="myDiv90">
               004
            </div>
            <div class="myDiv180">
               005
            </div>
            <div class="myDiv270">
               006
            </div>
            <p>Rotate counter clockwise</p>
            <div class="myDivMinus90">
               007
            </div>
            <div class="myDivMinus180">
               008
            </div>
            <div class="myDivMinus270">
               009
            </div>
            <p> Complements are equal</p>
            <p>+90=-270</p>
            <p>+180=-180</p>
            <p>+270=-90</p>
            <p>Rotate X axis</p>
            <div class="myNormalDiv">
               011 (0 rotation)
            </div>
            <div class="myXDiv">
               012 (30 deg X)
            </div>
            <div class="mySquishedXDiv">
               013 (70 deg X)
            </div>
			<p>Div 14 invisible, but takes up space below:<br>
			+90 deg X </p>
            <div class="myVanishedXDiv">
               014 (+90 deg X)   /* invisible */
            </div>
            <div class="my180XDiv">
               015 (+180 deg X)
            </div>
            <div class="myWeirderXDiv">
               016 (-30 deg X)
            </div>
            <p>positive Y rotations </p>
            <div class="mySquashedXDiv">
               017 (+45 deg Y)
            </div>
			<p>Div 18 invisible,<br>
			occupies space on the screen:<br>
			+90 deg Y
			</p>
            <div class="Plus90YDiv">
               018 (+90 deg Y)   
            </div>
            <div class="Plus180YDiv">
               019 (+180 deg Y) 
            </div>
		 <p>start of Img rotations</p>
		 <p> X and Y rotations in CSS are HIGHLY unintuitive </p>

		 <figure class="centerImg Image_1"> <span style="padding-right: 15px">X 000 pool</span>
               <a href="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg">
			   <img src="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg" alt="swimming pool" width="250" height="109" /></a>
		 </figure>
		 
		 <figure class="centerImg Image_2"> <span style="padding-right: 15px">X 145 pool</span>
               <a href="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg">
			   <img src="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg" alt="swimming pool" width="250" height="109" /></a>
		 </figure>
		 
		 <figure class="centerImg Image_3"> <span style="padding-right: 15px">X -45 pool</span>
               <a href="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg">
			   <img src="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg" alt="swimming pool" width="250" height="109" /></a>
		 </figure>
		 
		 <figure class="centerImg Image_4"> <span style="padding-right: 15px">Y +45 pool</span>
               <a href="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg">
			   <img src="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg" alt="swimming pool" width="250" height="109" /></a>
		 </figure>
		 
		  <figure class="centerImg Image_5"> <span style="padding-right: 15px">Y 145 pool</span>
               <a href="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg">
			   <img src="https://notquitemoi.files.wordpress.com/2019/02/my-pool-250px.jpg" alt="swimming pool" width="250" height="109" /></a>
		 </figure>
         </div>
			<!--  inheritance now out of scope -->
		 <p> now we escape the scope of divBaseClass:<br>
		 notice the height of the final div</p>
        
         <div style="background-color: green;"> I am still happy!</div>
      </div>
            
          
!
            
              .myContainer {
         position: static; /* standard default flow, hoses z-index */
         width: 50%; /* w and h establish the viewport */
         height:100%; 
         /* centers container on browser page */
         margin: 0 auto;
         /* get rid of superfluous junk */
         padding: 0;
         border: 0;
		 font-family:'Roboto';
         /* make text supereasy to see */
         font-size: 150%;
         /* makes viewport visible */
         background-color: #fff8ca;
         }
         /* base class Div */
         .divBaseClass > div {	/* > forces hxw inheritance on all contained divs */
         width: 300px;
         height: 300px;
		 color:white;
         }
         /* derived classes */
         .myDiv { 
         background-color: red; 	
         }
         .myDiv45 {    
         position: relative; /* allows "left" positioning attribute to work */
         left: 300px;
         background-color: 	#cc99ff;
         transform: rotate(45deg);
         }
         .myDiv45MovedUp {   
         /* now back to static positioning */
         background-color: #FF00FF;
         transform: rotate(45deg);
		 /* rotate at the next virtual 0,0 position in the div cascade */
         transform-origin: 0px 0px;
         }
		 /* !Important is necessary to change color */
         .myDiv90 {
         background-color: yellow;
         transform: rotate(90deg);
		 color: grey !important;
         }
         .myDiv180 {
         background-color: green;
         transform: rotate(180deg);
         }
         .myDiv270 {
         background-color: pink;
         transform: rotate(270deg);
         }
         .myDivMinus90 {
         background-color: brown;
         transform: rotate(-90deg);
         }
         .myDivMinus180 {
         background-color: grey;
         transform: rotate(-180deg);
         }
         .myDivMinus270 {
         background-color: skyblue;
         transform: rotate(-270deg);
         }
         .myXDiv {
		 display: inline-block;
         background-color: black;
         transform: rotateX(30deg);
         }
         .myNormalDiv {
		 display: inline-block;
         background-color: black;
         }
         .mySquishedXDiv {
		 display: inline-block;
         background-color: black;
         transform: rotateX(70deg);
         }
         .myVanishedXDiv {
		 display: inline-block;
         background-color: black;
         transform: rotateX(90deg);
         }
         .my180XDiv {
		 display: inline-block;
         background-color: black;
         transform: rotateX(180deg);
         }
         .myWeirderXDiv {
         background-color: orange;
         transform: rotateX(-30deg);
         }
         .mySquashedXDiv {
         background-color: pink;
         transform: rotateY(45deg);
         }
         .Plus90YDiv {
         background-color:  #00ff33;
         transform: rotateY(90deg);
         }
         .Plus180YDiv {
         background-color:  red;
         transform: rotateY(180deg);
         }
		.centerImg { 
	
			display: flex;
			justify-content: center;
			align-items: center;
			margin: 0 auto;
		}
		.Image_1 {
			transform: rotateX(0deg);
		}
		.Image_2 {
			transform: rotateX(145deg);
		}
		.Image_3 {
			transform: rotateX(-45deg);
		}
		.Image_4 {
			transform: rotateY(45deg);
		}
		.Image_5 {
			transform: rotateY(145deg);
		}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console