Created
March 27, 2021 01:06
-
-
Save thiago-vieira/2a8253b65d9fd26741c4edd7faa2ab15 to your computer and use it in GitHub Desktop.
HTML e CSS - criando div na diagonal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
div.container { | |
background:black; | |
width:500px; | |
height: 100px; | |
padding-top: 90px; | |
padding-bottom: 4px; | |
} | |
.container div { | |
display: inline-block; | |
margin-left:-150px; | |
position: relative; | |
} | |
.container div.first { | |
margin:0; | |
} | |
div.item { | |
width: 200px; | |
height: auto; | |
background-color: yellow; | |
/* Rotate div */ | |
-ms-transform: rotate(-60deg); /* IE 9 */ | |
-webkit-transform: rotate(-60deg); /* Chrome, Safari, Opera */ | |
transform: rotate(-60deg); | |
} | |
</style> | |
</head> | |
<body> | |
<div class='container'> | |
<div class='item first'>Hello</div> | |
<div class='item'>Other!</div> | |
<div class='item'>Another</div> | |
<div class='item'>and other</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment