HTML CSS examples for CSS Layout:Responsive Layout
Make an arrow shape with responsive width
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body {<!-- w w w. j a va2s. co m--> text-align:center; padding-top:51px; } .metric { display:inline-block; position:relative; height:151px; width:51%; background:lawngreen; } .metric:before, .metric:after { position:absolute; top:-26px; content:''; width:51%; height:26px; } .metric:before { left:0px; background:linear-gradient(to right bottom, transparent 51%, lawngreen 51%); } .metric:after { right:0px; background:linear-gradient(to left bottom, transparent 51%, lawngreen 51%); } </style> </head> <body> <div class="metric good"></div> </body> </html>