Skip to content

Instantly share code, notes, and snippets.

@jensgro
Created September 8, 2011 10:01
Show Gist options
  • Save jensgro/1203058 to your computer and use it in GitHub Desktop.
Save jensgro/1203058 to your computer and use it in GitHub Desktop.
Rechnen in CSS soll mittels calc() möglich sein.
/* Die Box würde so breiter als 100% werden. */
#main {
width: 100%;
padding: 20px;
}
/* Ein weiteres DIV - #main_inner - übernimmt die Abstände. */
#main {
width: 100%;
}
#main_inner {
margin: 20px;
}
/* Die CSS3-Version - bisher nur im Firefox und IE9 + 10 (ohne vendor-prefix) */
#main {
width: -moz-calc(100% - 2*20px);
width: calc(100% - 2*20px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment