123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Grid layout using the auto algorithm and explicit order</title>
- <!-- the base styles and "housekeeping" styles are in here: -->
- <link rel="stylesheet" href="css/grid-base.css">
- <!-- the HTML5 shiv, to help older browsers understand styling
- on newer HTML5 elements: -->
- <script src="js/html5shiv.min.js"></script>
- <style>
- /* content styling */
- .grid-a {
- display: -webkit-grid;
- display: grid;
- -webkit-grid-template-rows: auto auto auto;
- grid-template-rows: auto auto auto;
- -webkit-grid-template-columns: repeat(5, 1fr);
- grid-template-columns: repeat(5, 1fr);
- margin: 0 -.6875em;
- }
- .subcategory {
- margin-top: 1.5em;
- border-bottom: 1px solid #8e3339;
- }
- .subcategory-header {
- padding: .6875em;
- -webkit-grid-row: 1/-1;
- grid-row: 1/-1;
- }
- .story:nth-of-type(2),
- .story:nth-of-type(3) {
- -webkit-order: -2;
- order: -2;
- }
- .story-featured {
- -webkit-order: -1;
- order: -1;
- -webkit-grid-column: span 2;
- grid-column: span 2;
- }
- .story {
- padding: .6875em;
- margin: 0 .6875em 1.375em;
- background-color: #eee;
- }
- .story img {
- /* width: 100%; */
- max-width: 100%;
- }
- </style>
- </head>
- <body>
- <header class="masthead">
- <div class="wrapper">
- <h1>Important News</h1>
- </div>
- </header>
- <nav role="navigation" class="navbar">
- <div class="wrapper">
- <ul class="navlist">
- <li><a href="#">Home</a></li>
- <li><a href="#">World</a></li>
- <li><a href="#">Local</a></li>
- <li><a href="#">Sports</a></li>
- </ul>
- </div>
- </nav>
-
- <main class="wrapper">
- <section class="subcategory subcategory-a">
- <div class="grid-a">
- <header class="subcategory-header">
- <h2>Lorem ipsum</h2>
- </header>
- <article class="story story-featured">
- <img src="http://placehold.it/600x300" alt="Dummy image">
- <h3><a href="#">Cras suscipit nec leo id.</a></h3>
- <p>Autem repudiandae aliquid tempora quos reprehenderit architecto, sequi repellat.</p>
- </article>
- <article class="story">
- <img src="http://placehold.it/600x300" alt="Dummy image">
- <h3><a href="#">Perferendis, ipsam!</a></h3>
- <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
- </article>
- <article class="story">
- <img src="http://placehold.it/600x300" alt="Dummy image">
- <h3><a href="#">Curabitur mattis purus nec velit.</a></h3>
- <p>Neque magnam vero obcaecati facere nobis sint dolore accusamus vitae consequuntur ad necessitatibus, laborum molestiae.</p>
- </article>
- <article class="story">
- <h3><a href="#">Perferendis, ipsam!</a></h3>
- </article>
- <article class="story">
- <h3><a href="#">Aliquam mattis eros id posuere.</a></h3>
- </article>
- <article class="story">
- <h3><a href="#">Proin leo felis, semper nec</a></h3>
- </article>
- <article class="story">
- <h3><a href="#">Aliquam vitae risus tortor. Sed!</a></h3>
- </article>
- <article class="story">
- <h3><a href="#">Perferendis, ipsam!</a></h3>
- </article>
- <article class="story">
- <h3><a href="#">Aliquam mattis eros id posuere.</a></h3>
- </article>
- <article class="story">
- <h3><a href="#">Proin leo felis, semper nec</a></h3>
- </article>
- <article class="story">
- <h3><a href="#">Aliquam vitae risus tortor. Sed!</a></h3>
- </article>
- </div>
- </section>
- </main>
- </body>
- </html>
|