Skip to content

Instantly share code, notes, and snippets.

@sorie
Created January 22, 2019 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sorie/0c3c0d67abc49501e60445fae28fa7ba to your computer and use it in GitHub Desktop.
Save sorie/0c3c0d67abc49501e60445fae28fa7ba to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/pewuken
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.box1 {
width: 100%;
height: 90px;
background:rgb(255,0,255);
}
.box2 {
width: calc(100% - 25%);
height: 90px;
background: rgb(0,0,255);
}
.box3 {
width: calc(100% - 100px);
height: 90px;
background: rgb(255,0,0);
}
.box4 {
width: calc(100% / 3);
height: 90px;
background: rgb(0,155,0);
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
<script id="jsbin-source-css" type="text/css">.box1 {
width: 100%;
height: 90px;
background:rgb(255,0,255);
}
.box2 {
width: calc(100% - 25%);
height: 90px;
background: rgb(0,0,255);
}
.box3 {
width: calc(100% - 100px);
height: 90px;
background: rgb(255,0,0);
}
.box4 {
width: calc(100% / 3);
height: 90px;
background: rgb(0,155,0);
}
</script>
</body>
</html>
.box1 {
width: 100%;
height: 90px;
background:rgb(255,0,255);
}
.box2 {
width: calc(100% - 25%);
height: 90px;
background: rgb(0,0,255);
}
.box3 {
width: calc(100% - 100px);
height: 90px;
background: rgb(255,0,0);
}
.box4 {
width: calc(100% / 3);
height: 90px;
background: rgb(0,155,0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment