Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save weirdpattern/a11ff7bd49f7e5b5a24d2a2cc48554d3 to your computer and use it in GitHub Desktop.
Save weirdpattern/a11ff7bd49f7e5b5a24d2a2cc48554d3 to your computer and use it in GitHub Desktop.
2019.01.14.calculating-values-in-css-with-calc
<html>
<head>
<style>
.container {
width: calc(100% - 50px);
background-color: #CDEBC4;
color:#6D8B64;
text-align: center;
padding: 25px 0;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="container">
This div has a width of 100% - 50px
</div>
</body>
</html>
calc(<expression>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment