calc-width-block-1.html (879B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>CSS Test: width: calc() on blocks</title> 5 <link rel="author" title="L. David Baron" href="https://dbaron.org/"> 6 <link rel="help" href="http://www.w3.org/TR/css3-values/#calc-notation"> 7 <link rel="match" href="calc-width-block-1-ref.html"> 8 <style type="text/css"> 9 10 body { width: 500px } 11 p { background: green; color: white; margin: 1px 0; font-size: 10px } 12 13 </style> 14 </head> 15 <body> 16 17 <p style="width: calc(50% - 3px)">50% - 3px</p> 18 <p style="width: calc(25% - 3px + 25%)">25% - 3px + 25%</p> 19 <p style="width: calc(25% - 3px + 12.5% * 2)">25% - 3px + 12.5% * 2</p> 20 <p style="width: calc(25% - 3px + 12.5%*2)">25% - 3px + 12.5%*2</p> 21 <p style="width: calc(25% - 3px + 2*12.5%)">25% - 3px + 2*12.5%</p> 22 <p style="width: calc(25% - 3px + 2 * 12.5%)">25% - 3px + 2 * 12.5%</p> 23 <p style="width: calc(30% + 20%)">30% + 20%</p> 24 </body> 25 </html>