Giter VIP home page Giter VIP logo

workshop-html-css-basics's Introduction

HTML/CSS Basics workshop

Rules for this workshop: build and design a web page only with a semantic HTML structure (no class, no id in CSS). {: .alert-warning }

Initialisation

  • In a new folder, create an index.html file.
  • Open the file with your favorite IDE and add the HTML5 basic tags (DOCTYPE, html, head, body).
  • Create a style.css file.
  • In the <head>, first add some mandatory tags as <meta> or <title>:
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>CSS Workshop</title>
    </head>
  • Then add a <link> tag with the link to style.css.
  • In index.html, in the <body>, add a <h1> tag with the text Hello world !!!.
  • In style.css, add the code:
    h1 {
      color: #a306b6; 
    }
  • Open index.html in your browser, and check that you can read the message: 'Hello world !!!' in WCS purple.

Good job !

Layout of your website

You will have to create a basic home page following the layout below (do not try to be pixel perfect, this image is just a guide, pink color is now replaced by purple).

Open in new tab Layout to reproduce

Browsers have default size for each HTML elements (margin, font-size, etc.). It is useful but sometimes you will prefer to reset some default behaviour. In this workshop, it could be interesting to remove margin on <body>. Furthermore, use box-sizing: border-box on each element will help you to deal element sizing (more info about box-sizing). {: .alert-info }

* {
  box-sizing: border-box;
}
body {
  margin:0;
}

Navbar

  • Try to reproduce the navbar. Start to create a <nav> tag and add the background color #a306b6.
  • Then, analyse the navbar structure. You have a brand name "Workshop" at the top left and a group of menu items below.
  • Using an unordered list can be a good idea for the menu group, but don't forget to display it horizontally and without the bullets.

Header

  • Wrap your <h1> in a <header> tag and add a 250px min-height.
  • Add a background image (e.g a ramdon one on Loremflicker or Picsum).
  • Center your main title and change font size / color if necessary.

Hint: Manage background size

"About us" Section

  • Good practice is to wrap sections in a <main> tag.
  • Add a first <section> and a <h2> according to the template.
  • Add some fake text in a paragraph. Change line-height (1.5) and font-family (Verdana) to improve readability. This can be done in the body properties.
  • Limit the max-width to 65ch. This will ensure you have a text width that does not exceed 85 characters making reading more comfortable.

A little explanation: in css, the unit ch is a unit relative to the width of character 0 (the widest character in most fonts). Specifying 65ch allows us to ensure a column width of between 65 and about 85 characters for all signs combined, a text block width that is highly recommended by numerous studies on digital accessibility and our reading behaviour. More explanation on this article or this one if you are interested in the subject.

  • Finally, you can use the margin property to center the block horizontally.

Centering in CSS: A complete guide {: .alert-info }

Featured posts Section

  • Add a new section.
  • Give it a <h2> with the appropriated text content.
  • Add 4 <article> children below.
  • Each article might have <h3> containing his name.
  • Adjust the layout to get 2 items per line with the display and width properties. Rounding and drop shadow effects can be achieved with border-radius and box-shadow.

Footer

Because you have a <header>, you need a <footer>. This should not be a problem for you 😉.

workshop-html-css-basics's People

Contributors

jfm-wcs avatar rocambille avatar sblondeau avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workshop-html-css-basics's Issues

Corrections mineures

Bonjour.
Voici des petites modifications à apporter.

Dans la partie
"Navbar
Try to reproduce the navbar. Start to create a

tag and add the background color #f76c6c."

Le code color indiqué est l'ancien sans doute, il convient de le remplacer par le nouveau #a306b6

Dans le footer, il est écrit "2022" et non "2023":)

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.