Advertisement
Guest User

saintseiya

a guest
Feb 20th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4. <head>
  5. <title> Flexbox CSS html </title>
  6.  
  7. <style>
  8. *{ box-sizing : border-box;}
  9. body {font-family : Arial, Helvetica, sans-serif;}
  10.  
  11. header {
  12. background-color : #666;
  13. padding : 30px;
  14. text-align : center;
  15. font-size : 35px;
  16. color : white;
  17. }
  18.  
  19. section { display : -webkit-flex; }
  20.  
  21. nav {
  22. -webkit-flex : 1;
  23. -ms-flex : 1;
  24. flex : 1;
  25. background : #ccc;
  26. padding : 20px;
  27. }
  28.  
  29. nav ul {
  30. list-style-type : none;
  31. padding : 0;
  32. }
  33.  
  34. article {
  35. -webkit:flex : 3;
  36. -ms-flex : 3;
  37. flex : 3;
  38. background-color : #f1f1f1;
  39. padding : 10px;
  40. }
  41.  
  42. footer {
  43. background-color #777;
  44. padding : 10px;
  45. text-align : center;
  46. color : white;
  47. }
  48.  
  49. @media (max-width : 600px)
  50. {
  51. section {
  52. -webkit-flex-direction : column;
  53. flex-direction : column;
  54. }
  55. }
  56.  
  57. </style>
  58. </head>
  59.  
  60.  
  61. <body>
  62. <h2> CSS layout flexbox </h2>
  63. <p> In this example, we have created a header, two columns/boxes and a footer. On smaller screens, the columns will stack on top of each other. </p>
  64. <p> Resize the browser window to see the responsive effect. </p>
  65. <p><strong> Note : </strong> Flexbox is not supported in Internet Explorer 10 and earlier versions. </p>
  66.  
  67. <header>
  68. <h2> Cities </h2>
  69. </header>
  70.  
  71. <section>
  72. <nav>
  73. <ul>
  74. <li><a href ="#"> London </a></li>
  75. <li><a href ="#"> Paris </a></li>
  76. <li><a href ="#"> Tokyo </a></li>
  77. </ul>
  78. </nav>
  79. <article>
  80. <h1> London </h1>
  81. <p> London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants. </p>
  82. <p> Standong of the River Thames, London has been a major settlement for two millennia, its history going back to its founding by the Roman, who named it Londinium </p>
  83. </article>
  84. </section>
  85. </body>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement