What You'll Learn

Today, we will learn about the heart of the web: HTML. It's the language that powers every website on the internet today. We'll start with a very simple site to teach you the basics. Warning: it will be ugly. But we'll learn how to make it look more beautiful soon.

Lecture Notes

The lecture notes can be found here: 📔 Slides

Preview of the Final Product

day1-final

  1. Sign up for an account with repl.it (choose Student account type asked; but it doesn't matter which account type you have)
  2. Click new repl on the top right of screen and create a new HTML/JS/CSS project. Name your repl as Hello World (or any name you like) repl-1
  3. Add <div>Hello World</div> inside the <body> element.
  4. Click "Run" in top center.

Final Step

You should see something like this:

hello-world

View the screenshot below and practice typing the neccessary HTML code to achieve a similar page.

Basic Step

  1. Place the cursor inside the <body>...</body> tags.
  2. Insert <h1>I am a Heading 1</h1> and hit Run. Hint: faster if you use keyboard shortcuts. Press Cmd+Enter on Mac or Ctrl+Enter on Windows.
  3. Repeat inserting other HTML elements, one at a time: h2, div, a and img.
  4. Notice that for links, you need an extra attribute href="..." to set the destination.
  5. Notice that for images, you need an extra attribute to set the image URL.

Now, let's create a new project. (You can keep the previous the old one around, just for reference.)

new-repl

  <h1>
    My Wonderful CV
  </h1>
  .text-center {
    text-align: center;
  }
  <h1 class="text-center">
      My Wonderful CV
  </h1>

Now, you can see that your text should be centered! header-centered

  .cv-title {
    font-size: 50px;
  }
  <h1 class="text-center cv-title">
      My Wonderful CV
  </h1>

Final Result

header-centered-large

about-me

To make a simple About Me section, we have the following elements (you'll start thinking in terms of elements soon):

You should know the tags for each. You'll want to wrap everything in a div.

<div>
    <img src="./image/bitna.JPG"/>
    <h3>Full Stack Development Instructor</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod aliquid, mollitia odio veniam sit iste esse
            assumenda amet aperiam exercitationem, ea animi blanditiis recusandae! Ratione voluptatum molestiae
            adipisci, beatae obcaecati.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod aliquid, mollitia odio veniam sit iste esse
            assumenda amet aperiam exercitationem, ea animi blanditiis recusandae! Ratione voluptatum molestiae
            adipisci, beatae obcaecati.</p>
</div>

Now, jump back to style.css to style your code.

  .main-section {
    background-color: pink;
  }

  .text-center {
    text-align: center;
  }
  .p-2 {
    padding: 2rem;
  }

Apply these 3 styles into that opening div.

<div class="main-section text-center p-2">

Let's create a section for portfolio cards. We'll start by creating just one, that looks like this:

portfolio-card

Let's break down the elements in our portfolio card.

Steps

  <div>
    <h1 class="text-center">
        Portfolio
    </h1>
    <h3 class="text-center">
        This is Bitna's portfolio from 3 years work experience
    </h3>
  </div>

portfolio-title

  <div>
      <img src=" ... image url here ..."/>
      <h3>Window</h3>
      <h5>photography</h5>
      <button>Check it Now</button>
  </div>
  .card {
    width: 18rem;
    border: 3px solid black;
  }
  <div class="card">
      <img src=" ... image url here ..."/>
      <h3>Window</h3>
      <h5>photography</h5>
      <button>Check it Now</button>
  </div>

Your image might be bursting out of the box. Let's constrain the image to fit within the box.

.img-style {
  width: 100%;
}

Now if you add this class to your img tag, your image will be constrained to 100% size of the parent's width, which is card width (18rem). Now finish making your card beautiful by adjusting font-size and text-align.

Here's the solution below.

<div class="card text-center">
    <img src="https://bitna-cv.netlify.app/asset/image/01-full.jpg" class="img-style" />
    <h3 class="title">Window</h3>
    <h5 class="sub-title">photography</h5>
    <button class="check-button">Check it Now</button>
</div>

.check-button {
  color: white;
  background-color: pink;
  width: 200px;
  height: 50px;
  border-radius: 30px;
  margin-bottom: 10px;
}
.title {
  font-size: 32px;
}
.sub-title {
  font-size: 15px;
}

For this section, we'll want to show four of those cards in a row. To do this, we'll have to dive into some more advanced concepts of CSS Layout. We'll cover them more in-depth later in the course, so don't worry. For now, we'll have you just try to follow along.

Feel free to change the title and subtitle for each card. 😇

  <div class="card text-center">
      <img src="... your image here ..." class="img-style" />
      <h3 class="title">Window</h3>
      <h5 class="sub-title">photography</h5>
      <button class="check-button">Check it Now</button>
  </div>
  <div class="card text-center">
      <img src="... your image here ..." class="img-style" />
      <h3 class="title">Window</h3>
      <h5 class="sub-title">photography</h5>
      <button class="check-button">Check it Now</button>
  </div>
  <div class="card text-center">
      <img src="... your image here ..." class="img-style" />
      <h3 class="title">Window</h3>
      <h5 class="sub-title">photography</h5>
      <button class="check-button">Check it Now</button>
  </div>
  <div class="card text-center">
      <img src="... your image here ..." class="img-style" />
      <h3 class="title">Window</h3>
      <h5 class="sub-title">photography</h5>
      <button class="check-button">Check it Now</button>
  </div>

But now, you'll see that our cards are stacked up vertically, one on top of another, not horizontally.

portfolio-vertical

  <div class="cards-container">
    <!-- stuff from previous step, the 4 cards -->
  </div>

  .cards-container {
    display: flex;
    justify-content: space-between;
  }

Negative : ⚠️ This display: flex is a larger topic. You can read about it now on A Complete Guide to Flexbox but there's a lot to take in. In the full course, we'll go over it in more detail. For now, it's just a very quick introduction.

display: flex; by default activates something called flexbox, which aligns items horizontally by default (or, to be specific, sets flex-direction: row by default.

Now you will see your card is in horizontal alignment.

portfolio-horizontal

Final Product

https://bitna-cv.netlify.app/

Solution for Milestone 3

https://repl.it/@legobitna/FearlessLightyellowError

Solution for Milestone 4

https://repl.it/@legobitna/SuspiciousMemorableExams

Solution for Bonus 1

https://repl.it/@legobitna/FinishedSvelteModes

Solution for Bonus 2 & All Solution Link

https://repl.it/@legobitna/TerribleEmotionalRepo

Credits

Thanks to Bitna Kim for ideating and creating this exercise and accompanying solutions.

Thanks to Charles Lee for porting it to Codelabs format.