Guest User

Untitled

a guest
Aug 14th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. CSS center page with left and right columns
  2. <div id="page"></div>
  3. <div id="left-column"></div>
  4. <div id="right-column"></div>
  5.  
  6. <div id="wrapper">
  7. <div id="left-column">left column</div>
  8. <div id="page">page</div>
  9. <div id="right-column">right clomumn</div>
  10. </div>
  11.  
  12. #wrapper
  13. {
  14. width: 100%;
  15. display: table;
  16. }
  17.  
  18. #right-column {
  19. width: 15%;
  20. height: 500px;
  21. }
  22. #page{
  23. width: 70%;
  24. height: 500px;
  25. }
  26. #left-colum {
  27. width: 15%;
  28. height: 500px;
  29. }
  30.  
  31. #right-column,
  32. #left-column,
  33. #page
  34. {
  35. display: table-cell;
  36. }
  37.  
  38. #wrapper {
  39. display: table;
  40. }
  41. #right-coloumn {
  42. width: 15%;
  43. height: 500px;
  44. }
  45. #page{
  46. width: 70%;
  47. height: 500px;
  48. }
  49. #left-coloum {
  50. width: 15%;
  51. height: 500px;
  52. }
  53.  
  54. body {position:relative;margin:0;padding:0;}
  55. #page {margin:0 200px;;background:red;}
  56. #left-column {width:200px;position:absolute;top:0;left:0;background:green;}
  57. #right-column {width:200px;position:absolute;top:0;right:0;background:blue;}
Add Comment
Please, Sign In to add comment