0

I've been all over the internet trying to get this one fixed with no luck! I have done several of the CSS grid concepts ie. grid-template-areas and relying on the auto row function. Now I have tried to lay out the columns and the rows as simply as possible and my grid is simply moving in a clockwise direction instead of layering on each other properly!

<header>
    <h1>
        <a href="CauldronHtml.html">Cauldron Luxury Bath</a>
  </h1>
</header>
<nav>
  <ul id="banner">
    <li class="btn"><a href="#">Products</a></li>
  </ul>
</nav>
<div id="prodImage">
  <img src="PictureDefault.png" alt="Image 1" id="prodImage1" />
  <img src="PictureDefault.png" alt="Image 2" id="prodImage2" />
</div>
<div id="prodInfo">
  <p id="prodInfo1">Here is the information about product numero uno. It is quite the heck of the product, eh? Buy buy buy!</p>
  <p id="prodInfo2">Here is the information about product numero uno. It is quite the heck of the product, eh? Buy buy buy!</p>
</div>
<footer>
  <ul class="footer">
    <li><a href="#">Contact</a></li>
  </ul>
  <ul class="footer">
    <li><a href="#">Twitter</a></li>
    <li><a href="#">Instagram</a></li>
    <li><a href="#">Facebook</a></li>
  </ul>
</footer>


/* CSS */

body {
  display: grid;
  grid-template-columns: auto auto auto;
  grid-column-gap: 10px;
}
h1 {
  grid-column: 1 / span 3;
  grid-row: 1 / span 1;
}
#banner {
  grid-column: 1 / span 3;
  grid-row: 2 / span 1;
}
#prodImage1 {
  grid-column: 1 / 2;
  grid-row: 3 / span 1;
}
#prodImage2 {
  grid-column: 2 / 3;
  grid-row: 3 / span 1;
}
#prodInfo1 {
  grid-column: 1 / span 1;
  grid-row: 4 / span 1;
}
#prodInfo2 {
  grid-column: 2 / span 1;
  grid-row: 4 / span 1;
}
footer {
  grid-column: 1 / span 3;
  grid-row: 5 / span 1;
}
Meg
  • 49
  • 1
  • 7
  • At least it's not because of the [hemisphere you are on](https://www.loc.gov/rr/scitech/mysteries/coriolis.html) :p. Hope you don't mind a bit of humor around your question :) – LMC Jun 27 '18 at 02:17
  • 2
    Hi, please include your HTML in the question, thanks – sol Jun 27 '18 at 02:18
  • 1
    Welcome to Stack Overflow! Questions seeking code help must include the shortest code necessary to reproduce it **in the question itself** preferably in a [**Stack Snippet**](https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/). See [**How to create a Minimal, Complete, and Verifiable example**](http://stackoverflow.com/help/mcve) – Paulie_D Jun 27 '18 at 10:12
  • Can you post an image of the outcome you're expecting? I'm not sure what you mean by "layering on each other properly". Also, with the code you've provided, the `

    ` does show --> https://jsfiddle.net/vbowu458/

    – sol Jun 27 '18 at 22:56
  • Unfortunately I'm too new to post images! However it is supposed to have the heading spanning the page, then the nav spanning the page right below it. Below that I'm trying to have the two images side by side, then below each image the paragraphs side by side. Finishing off with the footer spanning the bottom. – Meg Jun 27 '18 at 23:44
  • You're trying to apply grid properties to elements that are descendants, but not children, of a grid container. Those elements are outside the scope of grid layout. https://stackoverflow.com/q/46800525/3597276 – Michael Benjamin Jun 28 '18 at 11:52
  • https://stackoverflow.com/q/46800525/3597276 – Michael Benjamin Jun 28 '18 at 11:52
  • Got it, thanks! Couldn't find that anywhere! – Meg Jun 28 '18 at 13:35

0 Answers0