diff --git a/3-terrarium/1-intro-to-html/README.md b/3-terrarium/1-intro-to-html/README.md index f5900ce8..5e1faf3f 100644 --- a/3-terrarium/1-intro-to-html/README.md +++ b/3-terrarium/1-intro-to-html/README.md @@ -3,74 +3,87 @@  > Sketchnote by [Tomomi Imura](https://twitter.com/girlie_mac) -## Pre-Lecture Quiz - -[Pre-lecture quiz](https://ff-quizzes.netlify.app/web/quiz/15) +HTML, or HyperText Markup Language, is the foundation of every website you've ever visited. Think of HTML as the skeleton that gives structure to web pages β it defines where content goes, how it's organized, and what each piece represents. While CSS will later "dress up" your HTML with colors and layouts, and JavaScript will bring it to life with interactivity, HTML provides the essential structure that makes everything else possible. +In this exciting lesson, you'll create the HTML structure for a beautiful virtual terrarium interface. This hands-on project will teach you fundamental HTML concepts while building something visually engaging. You'll learn how to organize content using semantic elements, work with images, and create the foundation for an interactive web application. -> Check out video +By the end of this lesson, you'll have a working HTML page displaying plant images in organized columns, ready for styling in the next lesson. Don't worry if it looks basic at first β that's exactly what HTML should do before CSS adds the visual polish. Let's dive in and start building your first web project! -> -> [](https://www.youtube.com/watch?v=1TvxJKBzhyQ) +## Pre-Lecture Quiz -### Introduction +[Pre-lecture quiz](https://ff-quizzes.netlify.app/web/quiz/15) -HTML, or HyperText Markup Language, is the 'skeleton' of the web. If CSS 'dresses up' your HTML and JavaScript brings it to life, HTML is the body of your web application. HTML's syntax even reflects that idea, as it includes "head", "body", and "footer" tags. +> πΊ **Watch and Learn**: Check out this helpful video overview +> +> [](https://www.youtube.com/watch?v=1TvxJKBzhyQ) -In this lesson, we're going to use HTML to layout the 'skeleton' of our virtual terrarium's interface. It will have a title and three columns: a right and a left column where the draggable plants live, and a center area that will be the actual glass-looking terrarium. By the end of this lesson, you will be able to see the plants in the columns, but the interface will look a little strange; don't worry, in the next section you will add CSS styles to the interface to make it look better. +## Setting Up Your Project -### Task +Before we dive into HTML code, let's set up a proper workspace for your terrarium project. Creating an organized file structure from the beginning is a crucial habit that will serve you well throughout your web development journey. -On your computer, create a folder called 'terrarium' and inside it, a file called 'index.html'. You can do this in Visual Studio Code after you create your terrarium folder by opening a new VS Code window, clicking 'open folder', and navigating to your new folder. Click the small 'file' button in the Explorer pane and create the new file: +### Task: Create Your Project Structure - +You'll create a dedicated folder for your terrarium project and add your first HTML file. Here are two approaches you can use: -Or +**Option 1: Using Visual Studio Code** +1. Open Visual Studio Code +2. Click "File" β "Open Folder" or use `Ctrl+K, Ctrl+O` (Windows/Linux) or `Cmd+K, Cmd+O` (Mac) +3. Create a new folder called `terrarium` and select it +4. In the Explorer pane, click the "New File" icon +5. Name your file `index.html` -Use these commands on your git bash: -* `mkdir terrarium` -* `cd terrarium` -* `touch index.html` -* `code index.html` or `nano index.html` + -> index.html files indicate to a browser that it is the default file in a folder; URLs such as `https://anysite.com/test` might be built using a folder structure including a folder called `test` with `index.html` inside it; `index.html` doesn't have to show in a URL. +**Option 2: Using Terminal Commands** +```bash +mkdir terrarium +cd terrarium +touch index.html +code index.html +``` ---- +**Here's what these commands accomplish:** +- **Creates** a new directory called `terrarium` for your project +- **Navigates** into the terrarium directory +- **Creates** an empty `index.html` file +- **Opens** the file in Visual Studio Code for editing -## The DocType and html tags +> π‘ **Pro Tip**: The filename `index.html` is special in web development. When someone visits a website, browsers automatically look for `index.html` as the default page to display. This means a URL like `https://mysite.com/projects/` will automatically serve the `index.html` file from the `projects` folder without needing to specify the filename in the URL. -The first line of an HTML file is its doctype. It's a little surprising that you need to have this line at the very top of the file, but it tells older browsers that the browser needs to render the page in a standard mode, following the current html specification. +## Understanding HTML Document Structure -> Tip: in VS Code, you can hover over a tag and get information about its use from the MDN Reference guides. +Every HTML document follows a specific structure that browsers need to understand and display correctly. Think of this structure like a formal letter β it has required elements in a particular order that help the recipient (in this case, the browser) process the content properly. -The second line should be the `` tag's opening tag, followed right now by its closing tag ``. These tags are the root elements of your interface. +Let's start by adding the essential foundation that every HTML document needs. -### Task +### The DOCTYPE Declaration and Root Element -Add these lines at the top of your `index.html` file: +The first two lines of any HTML file serve as the document's "introduction" to the browser: -```HTML +```html ``` -β There are a few different modes that can be determined by setting the DocType with a query string: [Quirks Mode and Standards Mode](https://developer.mozilla.org/docs/Web/HTML/Quirks_Mode_and_Standards_Mode). These modes used to support really old browsers that aren't normally used nowadays (Netscape Navigator 4 and Internet Explorer 5). You can stick to the standard doctype declaration. +**Understanding what this code does:** +- **Declares** the document type as HTML5 using `` +- **Creates** the root `` element that will contain all page content +- **Establishes** modern web standards for proper browser rendering +- **Ensures** consistent display across different browsers and devices ---- +> π‘ **VS Code Tip**: Hover over any HTML tag in VS Code to see helpful information from MDN Web Docs, including usage examples and browser compatibility details. -## The document's 'head' +> π **Learn More**: The DOCTYPE declaration prevents browsers from entering "quirks mode," which was used to support very old websites. Modern web development uses the simple `` declaration to ensure [standards-compliant rendering](https://developer.mozilla.org/docs/Web/HTML/Quirks_Mode_and_Standards_Mode). -The 'head' area of the HTML document includes crucial information about your web page, also known as [metadata](https://developer.mozilla.org/docs/Web/HTML/Element/meta). In our case, we tell the web server to which this page will be sent to be rendered, these four things: +## Adding Essential Document Metadata -- the page's title -- page metadata including: - - the 'character set', telling about what character encoding is used in the page - - browser information, including `x-ua-compatible` which indicates that the IE=edge browser is supported - - information about how the viewport should behave when it is loaded. Setting the viewport to have an initial scale of 1 controls the zoom level when the page is first loaded. +The `
` section of an HTML document contains crucial information that browsers and search engines need, but that visitors don't see directly on the page. Think of it as the "behind-the-scenes" information that helps your webpage work properly and appear correctly across different devices and platforms. -### Task +This metadata tells browsers how to display your page, what character encoding to use, and how to handle different screen sizes β all essential for creating professional, accessible web pages. -Add a 'head' block to your document in between the opening and closing `` tags. +### Task: Add the Document Head + +Insert this `` section between your opening and closing `` tags: ```html @@ -81,17 +94,28 @@ Add a 'head' block to your document in between the opening and closing `` ``` -β What would happen if you set a viewport meta tag like this: ``? Read more about the [viewport](https://developer.mozilla.org/docs/Web/HTML/Viewport_meta_tag). +**Breaking down what each element accomplishes:** +- **Sets** the page title that appears in browser tabs and search results +- **Specifies** UTF-8 character encoding for proper text display worldwide +- **Ensures** compatibility with modern versions of Internet Explorer +- **Configures** responsive design by setting the viewport to match device width +- **Controls** initial zoom level to display content at natural size ---- +> π€ **Think About This**: What would happen if you set a viewport meta tag like this: ``? This would force the page to always be 600 pixels wide, breaking responsive design! Learn more about [proper viewport configuration](https://developer.mozilla.org/docs/Web/HTML/Viewport_meta_tag). -## The document's `body` +## Building the Document Body -### HTML Tags +The `` element contains all the visible content of your webpage β everything users will see and interact with. While the `` section provided instructions to the browser, the `` section contains the actual content: text, images, buttons, and other elements that create your user interface. -In HTML, you add tags to your .html file to create elements of a web page. Each tag usually has an opening and closing tag, like this: `hello
` to indicate a paragraph. Create your interface's body by adding a set of `` tags inside the `` tag pair; your markup now looks like this: +Let's add the body structure and understand how HTML tags work together to create meaningful content. -### Task +### Understanding HTML Tag Structure + +HTML uses paired tags to define elements. Most tags have an opening tag like `` and a closing tag like `
`, with content in between: `Hello, world!
`. This creates a paragraph element containing the text "Hello, world!". + +### Task: Add the Body Element + +Update your HTML file to include the `` element: ```html @@ -106,17 +130,28 @@ In HTML, you add tags to your .html file to create elements of a web page. Each ``` -Now, you can start building out your page. Normally, you use `` to structure the content appropriately. -## πChallenge +## π Explore HTML History Challenge + +**Learning About Web Evolution** -There are some wild 'older' tags in HTML that are still fun to play with, though you shouldn't use deprecated tags such as [these tags](https://developer.mozilla.org/docs/Web/HTML/Element#Obsolete_and_deprecated_elements) in your markup. Still, can you use the old `