Tea Cozy Project CSS

Hello guys,

I have just completed the project listed in the title. But I can’t help but get the feeling I just botched my way through it. I used any trick I could think of to get everything into position and looking how it should but I have no idea how to tweak the position of various flex box containers accurately or measure the amount of pixels as needed between each container.

I have included the spec-sheet for the project and my sloppy code (both html and css). I am open to all the criticism you have.

Thanks!

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta lang="eng">
    <meta name="description" content="Tea Cozy. Free range, fair trade and organic tea.">
    <meta name="keywords" content="Tea, Cozy, Free Range, Fair Trade, Organic, Steeping, Donut">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tea Cozy</title>
    <link href="style.css" type="text/css" rel="stylesheet">
</head>

<body>
<!---------------------------------------------------------------------------------->


<header class="header">
    <div class="tealogo">
        <img src="resources/images/img-tea-cozy-logo.png" alt="Tea Cozy Logo">
    </div>

    <div class="headerlist">
       <h4>Mission</h4>
       <h4>Featured Tea</h4>
       <h4>Locations</h4>
    </div>
</header>


<!---------------------------------------------------------------------------------->


<main>
    
    <div class="missioncontainer">
        <div class="missiontext">
            <h2>Our Mission</h2>
            <h4>Handpicked, Artisanally Curated, Free Range, Sustainable, Small Batch, Fair Trade, Organic Tea</h4>
        </div>
    </div>

    

    <div class="teamonth">
        <div class="teamonthtext">
        <h2>Tea of the Month</h2>
        <h4>What's Steeping at The Tea Cozy?</h4>
        </div>

        <div class="teamonthcontainer">
            <div class="imgcontainer1"><img src="resources/images/img-berryblitz.jpg" alt="Image of Fall Berry Blitz Tea"></div>
            <div class="imgcontainer2"><img src="resources/images/img-spiced-rum.jpg" alt="Image of Spiced Rum Tea"></div>
            <div class="imgcontainer3"><img src="resources/images/img-donut.jpg" alt="Image of Seasonal Donut"></div>
            <div class="imgcontainer4"><img src="resources/images/img-myrtle-ave.jpg" alt="Image of Myrtle Ave Tea"></div>
            <div class="imgcontainer5"><img src="resources/images/img-bedford-bizarre.jpg" alt="Image of Bedford Bizarre Tea"></div>
        </div>
    </div>

    <div class="locations">

        <div class="locationstext">
          <h2>Locations</h2>  
        </div>

        <div class="locationscontainer">
        <div class="downtowncontainer">
          <h3>Downtown</h3>
          <p>384 West 4th St</p>
          <p>Suite 108</p>
          <p>Portland, Maine</p>  
        </div>

        <div class="baysidecontainer">
            <h3>East Bayside</h3>
            <p>3433 Phisherman's Avenue</p>
            <p>(Northwest Corner)</p>
            <p>Portland, Maine</p>  
          </div>

          <div class="oakdalecontainer">
            <h3>Oakdale</h3>
            <p>515 Crescent Avenue</p>
            <p>Second Floor</p>
            <p>Portland, Maine</p>  
          </div>
    </div>

    <div class="teacozycontact">
        <h2>The Tea Cozy</h2>
        <h5>[email protected]</h5>
        <h5>917-555-8904</h5>  
      </div>
      </div>

</main>


<!---------------------------------------------------------------------------------->


<footer class="footer">
    <div class="copyright">
        <h5>copyright The Tea Cozy 2017</h5>
    </div>
</footer>


<!---------------------------------------------------------------------------------->
</body>
</html>
html {
    font-size: 18px;
}

* {
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 22px;
    color: seashell;
    background-color: black;
    opacity: 0.9;
    text-align: center;
}

.header {
    display: flex;
    position: fixed;
    padding-top: 9px;
    padding-bottom: 9px;
    background: black;
    width: 100%;
    height: 69px;
    z-index: 2;
    border-bottom: 1px solid seashell;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.35em;
}

.tealogo img {
    display: flex;
    position: relative;
    padding-top: 9px;
    padding-left: 10px;
    height: 50px;
    width: 167px;
    
}


.headerlist {
    display: flex;
    width: 450px;
    height: 69px;
    flex-flow: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 9px;
    padding-right: 10px;
    text-decoration: underline;
    font-weight: lighter;
    padding-right: 1.5rem;
}

.missioncontainer {
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    background-image: url(resources/images/img-mission-background.jpg);
    background-repeat: no-repeat;
    background-position-x: center;
    background-size: 1200px 700px;
    height: 700px;
    width: 100%;
}

.missiontext {
    background: black;
    display: flex;
    flex-flow: column;
    padding: 5px 5px;
    position: absolute;
    width: 1200px;
    height: 140px;
    align-content: center;
    justify-content: space-around;
    margin: 0 auto;
}


.teamonth {
 display: flex;
 position: relative;
 flex-direction: column;
 width: 100%;
 height: 700px;
 top: 100px;
 align-items: center;
 justify-content: space-evenly;
}


.teamonthtext {
    background: black;
    display: flex;
    flex-flow: column;
    padding: 5px 5px;
    position: relative;
    justify-content: space-around;
    align-content: center;
    width: 1000px;
    height: 140px;
    
}

.teamonthcontainer {
    display: flex;
    position: relative;
    align-content: center;
    justify-content: space-evenly;
    width: 1000px;
    height: 600px;
}

.imgcontainer1 {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
    
}

.imgcontainer1 img {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
    left: 150px;
}

.imgcontainer2 {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
    
}

.imgcontainer2 img {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
    left: 200px;
}

.imgcontainer3 {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
    
}

.imgcontainer3 img {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
    left: 250px;
}

.imgcontainer4 {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
    top: 300px;
    right: 300px;
}

.imgcontainer4 img {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
}

.imgcontainer5 {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
    top: 300px;
    right: 250px;
   
}

.imgcontainer5 img {
    display: flex;
    position: relative;
    width: 200px;
    height: 200px;
}

.locations {
    display: flex;
    position: relative;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    background-image: url(resources/images/img-locations-background.jpg);
    background-position-y: 10em; 
    background-repeat: no-repeat;
    background-position-x: center;
    background-size: 1200px 800px;
    height: 800px;
    width: 100%;
    top: 200px;
}

.locationstext {
    display: flex;
    position: relative;
    top: 6em;  
}

.locationscontainer {
    display: flex;
    position: relative;
    flex-flow: row;
    justify-content: space-evenly;
    align-items: center;
    height: 300px;
    width: 1000px;
    top: 8em;
}

.downtowncontainer {
    display: flex;
    flex-direction: column;
    background: black;
    width: 300px;
    height: 300px;
    align-items: center;
    justify-content: space-evenly;
}

.baysidecontainer {
    display: flex;
    flex-direction: column;
    background: black;
    width: 300px;
    height: 300px;
    align-items: center;
    justify-content: space-evenly;
}


.oakdalecontainer {
    display: flex;
    flex-direction: column;
    background: black;
    width: 300px;
    height: 300px;
    align-items: center;
    justify-content: space-evenly;
}

.teacozycontact {
    background: black;
    display: flex;
    flex-flow: column;
    position: relative;
    width: 100%;
    height: 200px;
    justify-content: space-between;
    align-items: center;
    top: 19em;
}

.footer {
    display: flex;
    position: relative;
    height: 50px;
    width: 1000px;
    top: 25em;
    left: 20px;
}
2 Likes

Hi,

I just completed mine as well (apart from the media queries which still need adjusting). I can share my code with you. By the way, when I tried to open your code all the images crashed as you included the relative paths for the images.

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="styles.css" />
    <title>Tea cozy</title>
  </head>
  <body>
    <!-- NAVIGATION -->
    <nav>
      <ul>
        <li id="logo">
          <a href="#"
            ><img
              src="https://content.codecademy.com/courses/freelance-1/unit-4/img-tea-cozy-logo.png"
              alt="logo"
          /></a>
        </li>
        <li><a href="#">Mission</a></li>
        <li><a href="#">Featured Tea</a></li>
        <li><a href="#">Locations</a></li>
      </ul>
    </nav>

    <!-- HERO SECTION -->

    <div class="hero">
      <div class="banner">
        <h2>Our Mission</h2>
        <h4>
          Handpicked, Artisanally Curated, Free Range, Sustainable, Small Batch,
          Fair Trade, Organic Tea
        </h4>
      </div>
    </div>

    <!-- TEA OF THE MONTH SECTION -->

    <section>
      <h2>Tea of the Month</h2>
      <h4>What's Steeping at The Tea Cozy?</h4>
      <div class="tea-container">
        <div class="item">
          <img
            src="https://content.codecademy.com/courses/freelance-1/unit-4/img-berryblitz.jpg"
            alt=""
          />
          <h4>Fall Berry Blitz Tea</h4>
        </div>

        <div class="item">
          <img
            src="https://content.codecademy.com/courses/freelance-1/unit-4/img-spiced-rum.jpg"
            alt=""
          />
          <h4>Spice Rum Tea</h4>
        </div>

        <div class="item">
          <img
            src="https://content.codecademy.com/courses/freelance-1/unit-4/img-donut.jpg"
            alt=""
          />
          <h4>Seasonal Donuts</h4>
        </div>

        <div class="item">
          <img
            src="https://content.codecademy.com/courses/freelance-1/unit-4/img-myrtle-ave.jpg"
            alt=""
          />
          <h4>Myrtle Ave Tea</h4>
        </div>

        <div class="item">
          <img
            src="https://content.codecademy.com/courses/freelance-1/unit-4/img-bedford-bizarre.jpg"
            alt=""
          />
          <h4>Bedford Bizarre Tea</h4>
        </div>
      </div>
    </section>

    <!-- LOCATIONS -->

    <div class="locations">
      
      <h2>Locations</h2>

      <div class="locations-container">
        <div class="locations-item">
          <h3>Downtown</h3>
          <p>384 West 4th St</p>
          <p>Suite 108</p>
          <p>Portland, Maine</p>
        </div>

        <div class="locations-item">
          <h3>East Bayside</h3>
          <p>3433 Phisherman's Avenue</p>
          <p>(Northwest Corner)</p>
          <p>Portland, Maine</p>
        </div>

        <div class="locations-item">
          <h3>Oakdale</h3>
          <p>515 Crescent Avenue</p>
          <p>Second Floor</p>
          <p>Portland, Maine</p>
        </div>
      </div>
    </div>

    <!-- FOOTER -->

    <footer>
      <div class="mid-container">
        <h2>The Tea Cozy</h2>
        <h5>[email protected]</h5>
        <h5>999-9999-9999</h5>
      </div>
      <div class="copyright">
        <h5>copyright the Tea cozy 2022</h5>
      </div>
    </footer>

    <!-- DUMMY DIV TO ALLOW FOR POSITIONING -->
    <div class="dummy-div"></div>
  </body>
</html>

AND CSS

body {
  margin: 0;
  background-color: black;
  color: white !important;
  font-family: Helvetica;
}

nav {
  margin: 0;
  width: 100%;
  height: 69px;
  position: fixed;
  border-bottom: 1px solid white;
  z-index: 1;
  background-color: black;
}

nav ul {
  margin-right: 5px;
  padding-top: 5px;
}

nav ul li {
  display: inline;
  float: right;
}

nav ul li a {
  margin-left: 10px;
  color: white;
}

#logo {
  position: absolute;
  left: 0px;
  top: 8px;
}

#logo img {
  height: 50px;
}

.hero {
  background-image: url("https://content.codecademy.com/courses/freelance-1/unit-4/img-mission-background.jpg");
  height: 700px;
  width: 1200px;
  background-size: cover;
  position: relative;
  top: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.banner {
  background-color: black;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  opacity: 0.8;
}

h2,
h4 {
  text-align: center;
}

.tea-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}

.item img {
  width: 300px;
  height: 200px;
}

.item h4 {
  text-align: center;
}

section {
  width: 1000px;
  position: relative;
  top: 70px;
  margin: 0 auto;
}

.locations {
  background-image: url(https://content.codecademy.com/courses/freelance-1/unit-4/img-locations-background.jpg);
  background-size: cover;
  background-position: center;
  height: 500px;
  width: 1200px;
  margin: 0 auto;
  position: relative;
  top: 70px;
}

.locations > h2 {
  padding: 30px;
}

.locations-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.locations-item {
  background-color: black;
  opacity: 0.8;
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-content: center;
  align-items: center;
  flex-direction: column;
}

.dummy-div {
  height: 200px;
}

footer {
  position: relative;
  top: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mid-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-content: center;
  margin-bottom: 30px;
  height: 200px;
}

.copyright {
  position: absolute;
  bottom: 0;
  left: 20px;
}

@media only screen and (max-width: 480px) {
  
  body {
    font-size: smaller;
    width: 480px;
  }

  .hero {
    width: auto;
    height: auto;
    background-size: cover;
    background-repeat: no-repeat;
    display: block;
    padding: 70px 0;
    border: 1px solid red;
  }

  .banner {
    width: 100%;
    height: auto;
    flex-shrink: 1;
  }

  .nav {
    width: 100%;
  }

  section {
    width: auto;
    position: static;
  }

  .locations {
    width: 100%;
    height: auto;
    background-size: contain;
    background-repeat: no-repeat;
  }

  footer {
    width: auto;
  }

  #logo img {
    height: 30px;
  }

  .locations-item {
      width: auto;
      height: auto;
      margin: 5px;
  }
}

I hope this helps!

1 Like

Hey i compared yours to mine- i think we went about the navs differently and I liked that you made yours change for mobile view- I tried to focus on using more relative measurements to make the look adjust to the veiw. But I remembered how actually for flex you should use more absaloute measurements as I think relative is more for grid layouts! But either way looks good- only thing I struggled with for yours is that your CSS could do with some more structure like how you labeled your HTML- funnily enough I’ve gone the opposite way!
Heres my code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="Resources/index.css" rel="stylesheet" type="text/css">
    <title>Tea Cozy</title>
</head>
<header>
    <nav>
        <img src="Resources/assets/img-tea-cozy-logo.png" alt="Tea Cosy logo">
        <ul class="nav">
            <li><a href="#">Mission</a></li>
            <li><a href="#">Featured Tea</a></li>
            <li><a href="#">Locations</a></li>
        </ul>
    </nav>
</header>
<body>
    <section class="mission">
        <div>
            <h2>Our Mission</h2>
            <h4>Handpicked, Artisanlly Curated, Free Range, Sustainable, Small Batch, Fair Trade, Organic Tea</h4>
        </div>
    </section>
    <section class="tea-o-month">
        <h2>Tea of the Month</h2>
        <h4>Whats Steeping at The Tea Cozy?</h4>
        <div class="tea-pics">
            <figure>
                <img src="https://content.codecademy.com/courses/freelance-1/unit-4/img-berryblitz.jpg" alt="Fall berry blitz tea in a cup">
                <figcaption>Fall Berry Blitz Tea</figcaption>
            </figure>
            <figure>
                <img src="https://content.codecademy.com/courses/freelance-1/unit-4/img-spiced-rum.jpg" alt="Spiced Rum Tea box with tea scattered around">
                <figcaption>Spiced Rum Tea</figcaption>
            </figure>
            <figure>
                <img src="https://content.codecademy.com/courses/freelance-1/unit-4/img-donut.jpg" alt="Doughnut on plate">
                <figcaption>Seasonal Donuts</figcaption>
            </figure>
            <figure>
                <img src="https://content.codecademy.com/courses/freelance-1/unit-4/img-myrtle-ave.jpg" alt="Myrtle Ave Tea">
                <figcaption>Myrtle Ave Tea</figcaption>
            </figure>
            <figure>
                <img src="https://content.codecademy.com/courses/freelance-1/unit-4/img-bedford-bizarre.jpg" alt="Bedford Bizzare Tea">
                <figcaption>Bedford Bizarre Tea</figcaption>
            </figure>
        </div>
    </section>
    <section class="Locations">
            <h2 id="special">Locations</h2>
            <div class="locations-container">
                <div class="locations-info">
                    <h3>Downtown</h3>
                    <p>384 West 4th St</p>
                    <p>Suite 108</p>
                    <p>Portland, Maine</p>
                </div>
                <div class="locations-info">
                    <h3>East Bayside</h3>
                    <p>384 West 4th St</p>
                    <p>Suite 108</p>
                    <p>Portland, Maine</p>
                </div>
                <div class="locations-info">
                    <h3>Downtown</h3>
                    <p>384 West 4th St</p>
                    <p>Suite 108</p>
                    <p>Portland, Maine</p>
                </div>
            </div>
    </section>
</body>
<footer>
    <div>
        <h2>The Tea Cozy</h2>
        <h5>[email protected]</h5>
        <h5>917-555-8904</h5>
    </div>
    <h5 id="copyright" >copyright The Tea Cozy 2017</h5>
</footer>
</html>
* {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px; 
    color: seashell;
    background-color: black;
    text-align: center;
    align-items:center;
    margin: 0;
}

h2 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1 rem;
}


/* Nav */
nav {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 69px;
    border: 1px solid seashell;
    justify-content: space-between;
    align-items: center;
}
nav ul { 
    display: flex;
    justify-content: flex-end;
    text-decoration: underline;
    list-style-type: none;
    padding: 0 10px;
}

nav li {
    padding: 0 10px;
}

nav img {
    margin: 10px;
    height: 50px;
}

/* mission*/
 
.mission {
    background-image: url("https://content.codecademy.com/courses/freelance-1/unit-4/img-mission-background.jpg");
    background-repeat: no-repeat;
    background-position: center;
    width: auto;
    max-width: 1200px;
    height: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding-top: 69px;
} 

.mission div {
    width: 100%;
    padding: 10px;
    opacity: 0.8;
}

/* Tea of the Month */

.tea-o-month {
    width: auto;
    max-width: 1000px;
    display:flex;
    flex-direction: column;
    margin: 0 auto;
    padding: 15px 0;

}

.tea-pics {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: row;
}

.tea-pics img {
    width: 300px;
    height: 200px;
    padding:10px;
}

/*locations*/ 

.Locations {
    margin: 20px auto;
    background-image: url("https://content.codecademy.com/courses/freelance-1/unit-4/img-locations-background.jpg");
    background-repeat: no-repeat;
    background-position: center;
    width:auto;
    display: flex;
    justify-content:center;
    align-items: center;
    flex-direction: column;
    max-width: 1200px;
    height: 500px;
}

#special {
    background-color: transparent;
    margin: 20px auto;
    padding-bottom: 15px;
}

.locations-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    background-color: transparent;

}

.locations-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: column;
    width: auto;
    max-width: 300px;
    min-height: 100%;
    margin: 15px 20px;
    padding: 15px 40px;
    background-color: black;
    opacity: 0.8;
}

.locations-info p,
.locations-info h3 {
    margin: 10px auto;
}

/* Footer */

footer div {
    height: 200px;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}

#copyright {
    text-align: left;
    padding: 20px;
}
1 Like

Hi! I have not made mine responsive for smaller screens yet.
I am having some trouble with a few things & will come back in the morning with fresh eyes.

  • In the “Tea of the Month” section, making the items closer together.
  • in “Locations” section, making the title “Locations” be 15px higher than the content
  • Setting a height for the background images seems to make it behave oddly when resizing the screen.

As I said I am coming back tomorrow with fresh eyes, so maybe these are silly issues haha!
Will post my current code here!

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="/style.css">
  <title>Tea Cozy</title>
</head>

<body>

<header>
  <img class="logo" src="/resources/img-tea-cozy-logo.webp" alt="Tea Cozy in cursive font">
<nav>
  <ul>
    <li>Mission</li>
    <li>Featured Tea</li>
    <li>Locations</li>
  </ul>
</nav>
</header>

<div class="mission">
  <div class="mission-text">
  <h2>Our mission</h2>
  <h4>Handpicked, Artisanally Curated, Free Range, Sustainable, Small Batch, Fair Trade, Organic Tea</h4>
  </div>
</div>

<div class="main">
  <h2>Tea of the Month</h2>
  <h4>What's Steeping at The Tea Cozy?</h4>

  <div class="tea">
    <figure >
      <img src="/resources/img-berryblitz.webp" alt="">
      <figcaption>Fall Berry Blitz Tea</figcaption>
    </figure>
    <figure>
      <img src="/resources/img-spiced-rum.webp" alt="">
      <figcaption>Spiced Rum Tea</figcaption>
    </figure>
    <figure>
      <img src="/resources/donut.webp" alt="">
      <figcaption>Seasonal Donuts</figcaption>
    </figure>
    <figure>
      <img src="/resources/donut.webp" alt="">
      <figcaption>Myrtle Ave Tea</figcaption>
    </figure>
    <figure>
      <img src="/resources/img-bedford-bizarre.webp" alt="">
      <figcaption>Bedford Bizarre Tea</figcaption>
    </figure>
  </div>
</div>


<section class="locations">
  <h2>Locations</h2>
  <div class="location-list">
    <div class="address">
      <h3>Downtown</h3>
      <h4>384 West 4th St</h4>
      <h4>Suite 108</h4>
      <h4>Portland, Maine</h4>
    </div>
    <div class="address">
      <h3>East Bayside</h3>
      <h4>3433 Phisherman's Avenue</h4>
      <h4>(Northwest Corner)</h4>
      <h4>Portland, Maine</h4>
    </div>
    <div class="address">
      <h3>Oakdale</h3>
      <h4>515 Crescent Avenue</h4>
      <h4>Second Floor</h4>
      <h4>Portland, Maine</h4>
    </div>
  </div>
</section>

<footer>
  <h2>The Tea Cozy</h2>
  <h5>[email protected]</h5>
  <h5>917-555-8904</h5>
  
  <h5 class="copyright">copyright The Tea Cozy 2017</h5>

</footer>

</body>
</html>
* {
  box-sizing: border-box;
}

body {
  font-family: Helvetica, sans-serif;
  font-size: 22px;
  color: seashell;
  background-color: black;
  opacity: 0.9;
}

/* Header */

header {
  display: flex;
  position: fixed;
  border-bottom: 1px solid seashell;
  height: 69px;
  width: 100%;
  background-color: black;
  z-index: 1;
  top: 0;
}

.logo {
  height: 50px;
  margin-left: 10px;
  align-self: center;
}

/* Navigation */

nav {
  width: 100%;
}

nav ul {
  display: flex;
  justify-content: flex-end;
}

nav li {
  list-style: none;
  text-decoration: underline;
  margin: 0 20px;
}

/* Hero */

.mission {
  background-image: url("/resources/img-mission-background.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  height: 700px;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mission-text {
  background-color: black;
  width: 100%;
  text-align: center;
}

/* Images */

.main {
  max-width: 100%;
  text-align: center;
}

.tea {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.tea img {
  width: 300px;
  height: 200px;
}

/* Locations */

.locations {
  background-image: url("/resources/img-locations-background.webp");
  position: static;
  background-repeat: no-repeat;
  background-size: cover;
  text-align: center;
}

.locations h2 {
  position: relative;
  top: 100px;
}

.location-list {
  display: flex;
  height: 600px;
  align-items: center;
  justify-content: space-evenly;
}

.address {
  background-color: black;
  width: 300px;
  height: 300px;
  margin: 0 20px;
  text-align: center;
}

/* Footer */

footer {
  background-color: black;
  text-align: center;
  width: 100%;
  height: 200px;
  bottom: 100px;
}

.copyright {
  text-align: left;
  margin-left: 20px;
}
5 Likes

Very helpful - thank you!! :pray:

1 Like

This Tea Cozy project has taken me a couple days to complete! I loved the challenge of creating the entire website only from a photo. Please check out my code and website.

Code:

website:
https://tea-cozy-one.vercel.app/#mission

5 Likes

Hey there!

I’m having some issue with this project. While creating it on VSCode on my system the file path was local hence the background images were showing up but when I moved it to gihub they aren’t showing. Tried to change the path to give code academy’s path but it’s still not showing up. Can someone take a look and tell me where im going wrong? Thanks!

<title>Tea Cozy</title>
<link rel="stylesheet" href="./resources/css/index.css" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Kanit:wght@100;400;700&display=swap" rel="stylesheet">
<!-- Header here -->
 <div class="header">
     <h1 id="logo">Tea Cozy</h1>
         <nav>
            <ul class="navigation">
                <li>
                    <a href="#mission">Mission</a>
                </li>
                <li>
                    <a href="#featuredteas">Featured Tea</a>
                </li>
                <li>
                    <a href="#location">Location</a>
                </li>
             </ul>
        </nav>
 </div>

Our Mission

Handpicked, Artisanally Curated, Free Range, Sustainable, Small Batch, Fair Trade, Organic Tea

<!-- TOTM here -->
  <div class="totmsection">  
            <div class="totm-text"> 
              <h2>Tea of the Month</h2>
              <h4>What's Steeping at The Tea Cozy?</h4>
            </div>
            <div class="spacer">
                <div class='cards'>
                        <div class='teas'>
                            <img src='resources/images/img-berryblitz.jpeg'>
                            <h4>Fall Berry Blitz Tea</h4>
                        </div>
                        <div class='teas'>
                            <img src='resources/images/img-spiced-rum.jpeg'>
                            <h4>Spiced Rum Tea</h4>
                        </div>
                        <div class='teas'>
                            <img src='resources/images/img-donut.jpeg'>
                            <h4>Seasonal Donuts</h4>
                        </div> 
                        <div class="row">
                            <div class='teas'>
                                <img src='resources/images/img-myrtle-ave.jpeg'>
                                <h4>Myrtle Ave Tea</h4>
                            </div>
                            <div class='teas'>
                                <img src='resources/images/img-bedford-bizarre.jpeg'>
                                <h4>Bedford Bizarre Tea</h4>
                            </div>
                        </div>
                </div>
            </div>
   </div>
   
<!-- Locations here -->
    <div class="locationsection">
        <div class="locationbanner">
        <div class="location-text">
            <h2>Locations</h2>
            <div class="container">
                <div class="boxes">
                    <h3>Downtown</h3>
                    <p>384 West 4th St</p>
                    <p>Suite 108</p>
                    <p>Portland, Maine</p>
                </div>
                <div class="boxes">
                      <h3>East Bayside</h3>
                      <p>3433 Phisherman's Avenue</p>
                      <p>(Northwest Corner)</p>
                      <p>Portland, Maine</p>
                </div>
                <div class="boxes">
                      <h3>Oakdale</h3>
                      <p>515 Cresent Avenue</p>
                      <p>Second floor</p>
                      <p>Portland, Maine</p>
                </div>  
            </div>      
        </div>
        </div>
    </div>


    <!-- Footer here -->

The Tea Cozy

[email protected]
917-555-8904
copyright The Tea Cozy 2017
  • {
    box-sizing: border-box;
    font-family: Helvetica, sans-serif;
    color: seashell;
    }
    html,
    body {
    width: 100%;
    height: 100%;
    margin: 0%;
    padding: 0%;
    overflow-x: hidden;
    font-style: normal;

}
.header {
display: flex;
background-color: black;
position: fixed;
align-items: center;
font-size: 22px;
opacity: 0.9;
text-align: center;
height: 69px;
border-bottom: 1px solid seashell;
overflow-y: auto;
width: 100%;
margin: 0 auto;
z-index: 999;
justify-content: space-between;
}

#logo {
font-weight: 400;
height: 50px;
letter-spacing: 2px;
word-spacing: 4px;
position: relative;
left: 10px;
}
ul {
margin: 0px;
padding: 0px;
position: relative;

}
li {
display: inline;
margin: 20px;
}
li>a {
text-decoration: underline;
font-weight: 400;
color: seashell;
letter-spacing: 2px;
word-spacing: 5px;
transition: color 0.3s;
}
li a:hover {
cursor: pointer;
color: #e48789;
}

li a:active {
text-decoration: underline;
}

.bannersection {
background-color: black;
text-align: center;
margin: 0px;
padding: 0px;
height: 700px;
width: 100%;
top: 69px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.banner {
background-image: url(‘https://content.codecademy.com/courses/freelance-1/unit-4/img-mission-background.jpg’);
background-repeat: no-repeat;
background-position: center;
height: 700px;
width: 1200px;
display: flex;
align-items: center;
justify-content: center;
margin: 0px;
padding: 0px;
border: 0px;
}
.banner-text {
color: seashell;
font-family: Helvetica, sans-serif;
width: 1200px;
text-align: center;
vertical-align: middle;
word-spacing: 5px;
background-color: black;
margin: 0px;
padding: 0px;
}

.totmsection {
background-color: black;
text-align: center;
margin: 0px auto;
padding-top: 5px;
height: 700px;
width: 100%;
top: 0;
position: relative;
align-items: center;
justify-content: center;
}
.totm-text{
color: seashell;
font-family: Helvetica, sans-serif;
width: 1200px;
text-align: center;
vertical-align: middle;
word-spacing: 5px;
background-color: black;
margin: auto;
padding-top: 20px;
gap: 5px;
}
.cards {
background-color: black;
color: seashell;
display: flex;
justify-content: space-evenly;
flex-wrap: wrap;
width: 1000px;
margin: auto;
}
.teas {
display: flex;
justify-content: space-evenly;
flex-direction: column;

}
img {
max-width: 300px;
max-height: 200px;
}
.teas h4{
padding-top: 10px;
padding-bottom: 15px;
margin: auto;
border: auto;
}

.row {
display: flex;
gap: 25px;
}

.locationsection {
background-color: black;
text-align: center;
margin: auto;
height: 500px;
width: 100%;
top: 0;
position: relative;
align-items: center;
justify-content: center;

}

.locationbanner {
background-image: url(‘https://content.codecademy.com/courses/freelance-1/unit-4/img-locations-background.jpg’);
background-repeat: no-repeat;
background-position: center;
height: 500px;
width: 1200px;
display: flex;
align-items: center;
justify-content: center;
margin: auto;
padding: 0px;
border: 0px;
}

.location-text h2{
padding-bottom: 15px;
margin: 0;
border: 0;
}

.container {
display: flex;
justify-content: space-evenly;
flex-wrap: wrap;
margin: 0;
padding: 0;
border: 0;
}

.boxes {
width: 330px;
margin: 20px;
padding: 0;
border: 0px;
display: inline-block;
background-color: black;
opacity: 1;
justify-content: center;
}

.footersection {
background-color: black;
text-align: center;
margin: 0px auto;
padding-top: 5px;
height: 200px;
width: 100%;
top: 0;
position: relative;
align-items: center;
justify-content: center;
}
.copyright {
background-color: black;
text-align: center;
margin: 0px auto;
padding-top: 5px;
padding-left: 20px;
height: 50px;
width: 100%;
top: 0;
position: relative;
text-align: left;
justify-content: center;
}

Hey there!

I’m having some issue with this project. While creating it on VSCode on my system the file path was local hence the background images were showing up but when I moved it to gihub they aren’t showing. Tried to change the path to give code academy’s path but it’s still not showing up. Can someone take a look and tell me where im going wrong? Thanks!

<!DOCTYPE html>
<html lang="en">
<head>
    
    <title>Tea Cozy</title>
    <link rel="stylesheet" href="./resources/css/index.css" type="text/css">
    <link href="https://fonts.googleapis.com/css2?family=Kanit:wght@100;400;700&display=swap" rel="stylesheet">
</head>
<body>

    <!-- Header here -->
     <div class="header">
         <h1 id="logo">Tea Cozy</h1>
             <nav>
                <ul class="navigation">
                    <li>
                        <a href="#mission">Mission</a>
                    </li>
                    <li>
                        <a href="#featuredteas">Featured Tea</a>
                    </li>
                    <li>
                        <a href="#location">Location</a>
                    </li>
                 </ul>
            </nav>
     </div>

   <!-- Mission here -->
  <div class="bannersection">
    <div class="banner">
       <div class="banner-text">
         <h2>Our Mission</h2>
         <h4>Handpicked, Artisanally Curated, Free Range, Sustainable, Small Batch, Fair Trade, Organic Tea</h4>
       </div>
    </div>
  </div>

    <!-- TOTM here -->
      <div class="totmsection">  
                <div class="totm-text"> 
                  <h2>Tea of the Month</h2>
                  <h4>What's Steeping at The Tea Cozy?</h4>
                </div>
                <div class="spacer">
                    <div class='cards'>
                            <div class='teas'>
                                <img src='resources/images/img-berryblitz.jpeg'>
                                <h4>Fall Berry Blitz Tea</h4>
                            </div>
                            <div class='teas'>
                                <img src='resources/images/img-spiced-rum.jpeg'>
                                <h4>Spiced Rum Tea</h4>
                            </div>
                            <div class='teas'>
                                <img src='resources/images/img-donut.jpeg'>
                                <h4>Seasonal Donuts</h4>
                            </div> 
                            <div class="row">
                                <div class='teas'>
                                    <img src='resources/images/img-myrtle-ave.jpeg'>
                                    <h4>Myrtle Ave Tea</h4>
                                </div>
                                <div class='teas'>
                                    <img src='resources/images/img-bedford-bizarre.jpeg'>
                                    <h4>Bedford Bizarre Tea</h4>
                                </div>
                            </div>
                    </div>
                </div>
       </div>
       
    <!-- Locations here -->
        <div class="locationsection">
            <div class="locationbanner">
            <div class="location-text">
                <h2>Locations</h2>
                <div class="container">
                    <div class="boxes">
                        <h3>Downtown</h3>
                        <p>384 West 4th St</p>
                        <p>Suite 108</p>
                        <p>Portland, Maine</p>
                    </div>
                    <div class="boxes">
                          <h3>East Bayside</h3>
                          <p>3433 Phisherman's Avenue</p>
                          <p>(Northwest Corner)</p>
                          <p>Portland, Maine</p>
                    </div>
                    <div class="boxes">
                          <h3>Oakdale</h3>
                          <p>515 Cresent Avenue</p>
                          <p>Second floor</p>
                          <p>Portland, Maine</p>
                    </div>  
                </div>      
            </div>
            </div>
        </div>


        <!-- Footer here -->
  <div class="footersection">
       <div class="contact">
         <h2>The Tea Cozy</h2>
         <h5>[email protected]</h5>
         <h5>917-555-8904</h5>
       </div>
  </div>
  <div class="copyright">
            <h5>copyright The Tea Cozy 2017</h5>
</div>

</body>
</html>
* {
    box-sizing: border-box;
    font-family: Helvetica, sans-serif;
    color: seashell;
  }
html,
body {
    width: 100%;
    height: 100%;
    margin: 0%;
    padding: 0%;
    overflow-x: hidden;
    font-style: normal;
   
} 
.header {
    display: flex;
    background-color: black;
    position: fixed;
    align-items: center;
    font-size: 22px;
    opacity: 0.9;
    text-align: center;
    height: 69px;
    border-bottom: 1px solid seashell;
    overflow-y: auto;
    width: 100%; 
    margin: 0 auto;
    z-index: 999;
    justify-content: space-between;
  }


#logo {
    font-weight: 400;
    height: 50px;
    letter-spacing: 2px;
    word-spacing: 4px;
    position: relative;
    left: 10px;
}
ul {
    margin: 0px;
    padding: 0px;
    position: relative;

}
li {
    display: inline;
    margin: 20px;
}
li>a {
    text-decoration: underline;
    font-weight: 400;
    color: seashell;
    letter-spacing: 2px;
    word-spacing: 5px;
    transition: color 0.3s;
}
li a:hover {
    cursor: pointer;
    color: #e48789;
  }
  
  li a:active {
    text-decoration: underline;
  }

  .bannersection {
    background-color: black;
    text-align: center;
    margin: 0px;
    padding: 0px;
    height: 700px;
    width: 100%;
    top: 69px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
.banner {
    background-image: url('https://content.codecademy.com/courses/freelance-1/unit-4/img-mission-background.jpg'); 
    background-repeat: no-repeat;
    background-position: center;
    height: 700px;
    width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0px;
    padding: 0px;
    border: 0px;
  }
.banner-text {
    color: seashell;
    font-family: Helvetica, sans-serif;
    width: 1200px;
    text-align: center;
    vertical-align: middle;
    word-spacing: 5px;
    background-color: black;
    margin: 0px;
    padding: 0px;    
 }

 
.totmsection {
  background-color: black;
  text-align: center;
  margin: 0px auto;
  padding-top: 5px;
  height: 700px;
  width: 100%;
  top: 0;
  position: relative;
  align-items: center;
  justify-content: center;
}
.totm-text{
  color: seashell;
  font-family: Helvetica, sans-serif;
  width: 1200px;
  text-align: center;
  vertical-align: middle;
  word-spacing: 5px;
  background-color: black;
  margin: auto;
  padding-top: 20px;
  gap: 5px;
}
.cards {
  background-color: black;
  color: seashell;
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  width: 1000px;
  margin: auto;
}
.teas {
    display: flex;
    justify-content: space-evenly;
    flex-direction: column;
    
}
img {
  max-width: 300px;
  max-height: 200px;
  }
.teas h4{
  padding-top: 10px;
  padding-bottom: 15px;
  margin: auto;
  border: auto;
}

.row { 
  display: flex;
  gap: 25px;
}
  
.locationsection {
  background-color: black;
  text-align: center;
  margin: auto;
  height: 500px;
  width: 100%;
  top: 0;
  position: relative;
  align-items: center;
  justify-content: center;
  
}

.locationbanner {
  background-image: url('https://content.codecademy.com/courses/freelance-1/unit-4/img-locations-background.jpg'); 
    background-repeat: no-repeat;
    background-position: center;
  height: 500px;
  width: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  padding: 0px;
  border: 0px;
}

.location-text h2{
  padding-bottom: 15px;
  margin: 0;
  border: 0;
}

.container {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  border: 0;
}

.boxes {
  width: 330px;
  margin: 20px;
  padding: 0;
  border: 0px;
  display: inline-block;
  background-color: black;
  opacity: 1;
  justify-content: center; 
}

.footersection {
  background-color: black;
  text-align: center;
  margin: 0px auto;
  padding-top: 5px;
  height: 200px;
  width: 100%;
  top: 0;
  position: relative;
  align-items: center;
  justify-content: center;
}
.copyright {
  background-color: black;
  text-align: center;
  margin: 0px auto;
  padding-top: 5px;
  padding-left: 20px;
  height: 50px;
  width: 100%;
  top: 0;
  position: relative;
  text-align: left;
  justify-content: center;
}
1 Like

hi everyone, i have done my tea cozy project- hope this does help to anyone whom struggling-

1 Like

Hi everybody,

I’ve finished the project but I definitely feel that there are many things that I could improve in my code so please any feedback or tip are absolutely welcomed.

Here is the gist if you want to have a look:

Hi Discordfonts, I was not able to see your Tea Cozy site/code via the link. (maybe since I am new to the discussion board) I’d be glad to look at it if you link it in. I just finished mine, but need to clean it up a bit. I feel my code is a bit bulky compared to other examples posted. It was definitely a good challenge! It’s good to know someone else is at roughly the same stage of the program as I am in.

1 Like

Hello friends,

I’m stuck on the Team of the Month section- the images show up in a column instead of a wrapped row. I’ve tried changing lex-direction to no avail. Any suggestions?

Please see code below:

Thanks!

2 Likes

Hello There!
Here is my finished project, it took me a few days to complete it.
Live: Tea Cozy
Github: GitHub - soniavargas/Tea-Cozy-Shop

1 Like

Took me a full day, and a couple of rewrites, but its done, a lot of trial and error,
live Tea Cozy
code GitHub - thatbeefy/teacozy

looks pretty similar to the few others i checked out,
any code suggestions are welcome.

thanks

1 Like

both code and result are pretty similar to what i ended up with, looks good!

Hello everyone,just completed my Tea Cozy Project.
I’ll really appreciate your criticism and feedbacks

Hey! I’m new to the forum and want to share the result of my Tea Cozy project.
This is the GitHub repository https://github.com/AdrianBarco/TeaCozyProject
and this is the live page https://adrianbarco.github.io/TeaCozyProject/

1 Like

Hi all!

Here are my results for the Tea Cozy project. I found this to be trickier than it looked. Would love feedback, if anyone has any!
Git hub
Live link

Hello all! This took some time but I’m happy with it. If someone could review my Locations section I’d appreciate it. The height of the div is giving negative space before the copyright at the very end.

<!DOCTYPE html>

<html>

    <head>
        <link rel="stylesheet" type="text/css" href="index.css">
        <title>Tea Cozy</title>
    </head>

    <body>

        <header>
            <img class="logo" src="/images/img-tea-cozy-logo.png">
            <div class="nav">
                <p>Mission</p>
                <p>Featured Tea</p>
                <p>Locations</p>
            </div>
        </header>

        <div class="mission-container">
            <img class="mission" src="/images/img-mission-background.jpg">
            <div class="mission-text">
                <h2 class="mission-1">Our Mission</h2>
                <h4 class="mission-1">Handpicked, Artisanly Curated, Free Range, Sustainable, Small Batch, Fair Trade, Organic Tea</h4>
            </div>
        </div>

        <h2 class="steep1">Tea of the Month</h2>
        <h4 class="steep1">What's Steeping at The Tea Cozy?</h4>

        <div class="tea-month">
            <div class="berryblitz">
                <img class="tea-pic" src="/images/img-berryblitz.jpg">
                <h4>Fall Berry Blitz</h4>
            </div>
            <div class="spicedrum">
                <img class="tea-pic" src="/images/img-spiced-rum.jpg">
                <h4>Spiced Rum Tea</h4>
            </div>
            <div class="donut">
                <img class="tea-pic" src="/images/img-donut.jpg">
                <h4>Seasonal Donuts</h4>
            </div>
            <div class="Myrtle">
                <img class="tea-pic" src="/images/img-myrtle-ave.jpg">
                <h4>Myrtle Ave Tea</h4>
            </div>
            <div class="Bedford">
                <img class="tea-pic" src="/images/img-bedford-bizarre.jpg">
                <h4>Bedford Bizarre Tea</h4>
            </div>
        </div>


        <div class="TeaLocation">

            <div class="LocationTitle">

                <img class="LocImage" src="/images/img-locations-background.jpg">
            </div>

            <div class="LocationContainer">
                <h2>Locations</h2>

                <div class="LocationCard">
                    <h3>Downtown</h3>
                    <h4>384 West 4th St</h4>
                    <h4>Suite 108</h4>
                    <h4>Portland, Maine</h4>
                </div>

                <div class="LocationCard">
                    <h3>East Bayside</h3>
                    <h4>3433 Phisherman's Avenue</h4>
                    <h4>(Northwest Corner)</h4>
                    <h4>Portland, Maine</h4>
                </div>

                <div class="LocationCard">
                    <h3>Oakdale</h3>
                    <h4>515 Crescent Avenue</h4>
                    <h4>Second Floor</h4>
                    <h4>Portland, Maine</h4>
                </div>

            </div>

        </div>

        <div class="Contact">
            <h2>The Tea Cozy</h2>
            <h5>[email protected]</h5>
            <h5>917-555-8904</h5>
        </div>

    </body>

    <footer>
      <h5>copyright The Tea Cozy 2022</h5>
    </footer>

</html>

html {
    font-family: Helvetica;
    font-size: 22px;
    color: seashell;
    background-color: black;
    opacity: 0.9;
    text-align: center;
}

header {
    max-height: 69px;
    border-bottom: 1px solid seashell;
    display: fixed;
}

.logo {
    display: flex;
    height: 50px;
    padding: 10px;
}

div.nav {
    color: seashell;
    display: flex;
    align-items: center;
    position: absolute;
    top: 0;
    right: 0;
    height: 50px;
    padding: 10px;
    text-decoration: underline;
}

p {
    padding: 10px;
}


.mission {
    position: relative;
    width: 1200px;
    height: 700px;
    opacity: 0.9;
}

div.mission-container {
    position: relative;

}

.mission-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: black;
    background-repeat: repeat;
    width: 100%;

}

h2.mission-1, h4.mission-1 {
    padding: 1px;
    margin: 1px;
}

.tea-month {
    display: flex;
    width: 1000px;
    margin: auto;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-evenly;
    text-align: center;
}

.tea-pic {
    height: 200px;
    width: 300px;
    padding: 10px;
}

.berryblitz h4, .spicedrum h4, .donut h4, .Myrtle h4, .Bedford h4 {
    margin-top: 10px;
}

.TeaLocation {
    width: 1000px;
    height: auto;
    display: flex;
    margin: auto;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-evenly;
    text-align: center;
}

.LocImage {
    position: relative;
  
}

.LocationCard {
    width: 300px;
    background-color: black;
    display: inline-block;
    opacity: 1;
    margin-right: 20px;
    padding-top: 15px;
    
}

.LocationContainer {
    position: relative;
    bottom: 600px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;

}

.Contact {
    position: relative;
    height: 200px;
    width: auto;
    bottom: 380px;
}

footer {
    display: flex;
    padding-left: 20px;
}

Really struggled with this one and am still not particularly happy with it.

Any feedback would be greatly appreciated:

https://charlieh94.github.io/TeaCozy/

It seems generally ok on computer browser - though not as responsive as I’d hoped (some sections not shrinking etc and I can’t work out how to get this consistently),

On mobile it’s not very good - some sections aligning left and I don’t understand why - also similar issue with responsiveness as the pc browser.