Code Monkey home page Code Monkey logo

exercises-html-layout-i's Introduction

HTML Layout I - Basic Blog Post

This exercise meant to teach you the basics of page layout using HTML and CSS.

Contents

Getting Started

  1. Fork this repository to your own account (or one specific teammate's account if you're working in a group)
  2. Add any teammates as collaborators
  3. Use git clone to create a local copy of the repository
  4. Deploy using the surge command

Note: The code for the site lives in the site/ directory and that's what you want to deploy.

Also Note: When referring to a directory like site, it generally doesn't matter if we say site or site/. Programs are designed to handle either. We type out site/ here because the trailing / makes it clear we're talking about a directory.

From the project directory, you can deploy everything in site/ using the following command:

surge site

(Yes, surge site/ will also work.)

There's nothing special about the directory name site/, but if we don't keep the files for the site itself separate then running surge from inside the project directory will publish everything in this repository (like this README).

Instructions

These exercises are all about using CSS to control the design of your website.

We've marked up a simple blog post design in HTML. Your goal is to change the layout to something that more closely resembles a blog and improve the overall design.

The site/ directory contains two files you need to care about:

  1. site/index.html — The HTML for the blog post
  2. site/stylesheets/main.css — A stylesheet referenced via a link tag that you will fill out

Your goal is to improve the layout and design of the website by editing only main.css. That's right: you shouldn't really need to touch index.html.

You can edit index.html to add new class and/or id attributes to pre-existing elements, but no adding new tags or re-arranging existing tags.

Exercises

Fix The Layout

Open up sites/index.html. Using CSS grid for layout, change the page so that...

  • The header + navigation span across the top of the page
  • The sidebar and main content are side by side
  • The footer spans across the bottom of the page

Visually, the before and after:

You will feel like this and that's expected:

CSS oh boy

Grid Resources

The following resources are not meant to be exhaustive, but we like them!

Add Some Style

Make the page your own. Change the fonts, colors, etc. Add some of your own content. Keep the design looking good, though.

Depending on what you do, you might need to change index.html to achieve this. But don't break the existing design.

Extra: Basic Typography

Fundamentally, the web is a text-based medium and therefore typography has a lot to do with what makes a website look "nice".

If this sounds interesting to you, one of the first thing you should learn about is vertical rhythm. The default spacing between elements in an HTML document is somewhat random. Related things are spaced the same as unrelated things. Some elements are cramped, some are spaced way out.

Vertical rhythm is a way of creating consistent spacing as you scroll up and down the page. It's one of the easiest things you can do to make your site look nicer.

In CSS this is achieved by making line-height and margin properties multiples of a common value.

Here are some resources. Try to apply the concepts to this design:

Extra: Responsive Design

How do you make your design work on both large desktop monitor, a laptop screen, and a smart phone?

A design that works regardless of screen size is called "responsive". The holy grail is having to only ever write your HTML and CSS once, but do so in a way that adapts dynamically to the screen size.

This is...not easy.

But try to improve the way this site looks when it's in both a big window and a small window. Some resources:

exercises-html-layout-i's People

Contributors

jfarmer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.