HTML CSS examples for CSS Layout:3 Column
Three column layout with fixed width center and fluid side columns
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> html {<!-- w w w. j a va 2 s . co m--> background: darkgreen; } body:before { content: ''; display: block; background: rgba(0, 0, 0, .5); position: absolute; top: 0; left: 0; height: 100px; width: 100px; } body:after { content: ''; display: block; background: rgba(0, 0, 0, .5); position: absolute; top: 0; right: 0; height: 100px; width: 100px; } span:before { content: ''; display: block; background: rgba(0, 0, 0, .5); position: absolute; bottom: 0; left: 0; height: 100px; width: 100px; } span:after { content: ''; display: block; background: rgba(0, 0, 0, .5); position: absolute; bottom: 0; right: 0; height: 100px; width: 100px; } div { width: 300px; height: 200px; background: gray; margin: 50% auto; position: relative; z-index: 100; top: -150px; } </style> </head> <body> <div> Picture </div> <span> <!-- any other random element on the page --> </span> </body> </html>