07-10-float-columns-grid-fluid-gutters-broken.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Float grid with gutters – broken</title>
  6. <!-- the base styles and "housekeeping" styles are in here: -->
  7. <link rel="stylesheet" href="css/grid-base.css">
  8. <!-- the HTML5 shiv, to help older browsers understand styling
  9. on newer HTML5 elements: -->
  10. <script src="js/html5shiv.min.js"></script>
  11. <style>
  12. /* grid styling */
  13. .row {
  14. margin: 0 -.9%;
  15. padding: 0;
  16. list-style: none;
  17. }
  18. .row:after {
  19. content: '';
  20. display: block;
  21. clear: both;
  22. }
  23. .row-quartet > * {
  24. width: 25%;
  25. }
  26. .row-trio > * {
  27. width: 33.3333%;
  28. }
  29. .col {
  30. float: left;
  31. -moz-box-sizing: border-box;
  32. box-sizing: border-box;
  33. margin: 0 .9% 1.375em;
  34. }
  35. /* content styling */
  36. .subcategory {
  37. margin-top: 1.5em;
  38. border-bottom: 1px solid #8e3339;
  39. }
  40. .subcategory-featured {
  41. width: 50%;
  42. }
  43. .subcategory-content {
  44. width: 80%;
  45. }
  46. .subcategory-header {
  47. width: 20%;
  48. }
  49. .story {
  50. padding: .6875em;
  51. background-color: #eee;
  52. }
  53. .story + .story {
  54. margin-top: 1.375em;
  55. }
  56. .story img {
  57. width: 100%;
  58. }
  59. </style>
  60. </head>
  61. <body>
  62. <header class="masthead">
  63. <div class="wrapper">
  64. <h1>Important News</h1>
  65. </div>
  66. </header>
  67. <nav role="navigation" class="navbar">
  68. <div class="wrapper">
  69. <ul class="navlist">
  70. <li><a href="#">Home</a></li>
  71. <li><a href="#">World</a></li>
  72. <li><a href="#">Local</a></li>
  73. <li><a href="#">Sports</a></li>
  74. </ul>
  75. </div>
  76. </nav>
  77. <main class="wrapper">
  78. <section class="subcategory">
  79. <div class="row">
  80. <header class="col subcategory-header">
  81. <h2>Lorem ipsum</h2>
  82. </header>
  83. <div class="col subcategory-content">
  84. <div class="row row-quartet">
  85. <div class="col subcategory-featured">
  86. <article class="story">
  87. <img src="http://placehold.it/600x300" alt="Dummy image">
  88. <h3><a href="#">Cras suscipit nec leo id.</a></h3>
  89. <p>Autem repudiandae aliquid tempora quos reprehenderit architecto, sequi repellat.</p>
  90. </article>
  91. </div>
  92. <div class="col">
  93. <article class="story">
  94. <img src="http://placehold.it/600x300" alt="Dummy image">
  95. <h3><a href="#">Perferendis, ipsam!</a></h3>
  96. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  97. </article>
  98. </div>
  99. <div class="col">
  100. <article class="story">
  101. <img src="http://placehold.it/600x300" alt="Dummy image">
  102. <h3><a href="#">Curabitur mattis purus nec velit.</a></h3>
  103. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  104. </article>
  105. </div>
  106. </div>
  107. <div class="row row-quartet">
  108. <div class="col">
  109. <article class="story">
  110. <h3><a href="#">Perferendis, ipsam!</a></h3>
  111. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  112. </article>
  113. </div>
  114. <div class="col">
  115. <article class="story">
  116. <h3><a href="#">Aliquam mattis eros id posuere.</a></h3>
  117. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  118. </article>
  119. </div>
  120. <div class="col">
  121. <article class="story">
  122. <h3><a href="#">Proin leo felis, semper nec</a></h3>
  123. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  124. </article>
  125. </div>
  126. <div class="col">
  127. <article class="story">
  128. <h3><a href="#">Aliquam vitae risus tortor. Sed!</a></h3>
  129. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  130. </article>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </section>
  136. <section class="subcategory">
  137. <div class="row">
  138. <header class="col subcategory-header">
  139. <h2>Dolor sit amet</h2>
  140. </header>
  141. <div class="col subcategory-content">
  142. <div class="row row-trio">
  143. <div class="col">
  144. <article class="story">
  145. <img src="http://placehold.it/600x300" alt="Dummy image">
  146. <h3><a href="#">Ut sit amet mi massa</a></h3>
  147. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  148. </article>
  149. </div>
  150. <div class="col">
  151. <article class="story">
  152. <h3><a href="#">Nunc mollis sit amet nunc</a></h3>
  153. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  154. </article>
  155. <article class="story">
  156. <h3><a href="#">Duis sed ante enim. Cras</a></h3>
  157. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  158. </article>
  159. </div>
  160. <div class="col">
  161. <article class="story">
  162. <img src="http://placehold.it/600x300" alt="Dummy image">
  163. <h3><a href="#">Animi, explicabo, ipsum</a></h3>
  164. <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
  165. </article>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </section>
  171. </main>
  172. </body>
  173. </html>