This topic matters because its important to know not only how to do something (build a site), but also why the site is being built.
Links to various tutorials, such as:
Plannning the layout of a website -
It’s important to have a vision or goal of how you want the website to look, so you have something to strive for as you build it.
Adding the Content -
How to use HTML to add structure as you incorporate elements and add content.
Styling -
How to use CSS to add flair, color, and design elements to the structure (HTML).
Interactive elements -
For the user to be able to engage with the site, create input, and receive output; we use JavaScript.
Publishing -
Like a book, once you polish the content, its format, and are ready to share with others; you make it public and allow others to find it if you are looking for.
Restaurant analogy, uses similar terms although used differently.
DNS - Domain Name System
Packets - Layer 3
HTTP - HyperText Transfer Protocol; GET, HTTP/2 200
Make a plan before starting to build.
Pen and paper are a combo that has been tested through time and can come in handy here. Sketch a rough idea for how you’d like the layout of the site to be.
Choose a background color/theme palette. Choose some images. Choose a font.
JavaScript essentially uses values/elements already on the page, does some sort of operation with those values, then returns an output depending on what the operation was, and that result itself can also be used later on if needed in another operation.
Compose a short poem describing how HTTP sends data between computers.
“Clients pick up the phone to make a call,
“Hey Server, send your page and all!”
Through a Network Connection, off it goes,
Riding on TCP/IP boats.A stop by DNS to say,
“Where does that Server live today?”
Then Packets, small and neat,
Carry data down the street.The HTTP message replies, polite and plain,
“Please send index.html again.”
The Server smiles, “Here you are!”
And sends it back from afar.So every page you click to see,
Travels the world, digitally.”
HTML is the structure, the skeletal frame of a website. Through the use of semantics, you know what use the content is for and where it should go.
An HTML element consists of an opening tag, attribute(s) (if needed), content, closing tag (if called for). HTML offers a basic outline, it is up to the developer how intricate and detailed the site should be; as it pertains to the goal/mission/purpose of the site.
Elements can be placed within each other (nested).
Elements that don’t follow the basic outline of opening tag, content, closing tag are referred to as void elements and “close” within the opening tag, with or without the closing forward slash / (varies per html to xml compatibility).
Attributes are compounded onto elements and modify the contents of the element.
<header> - Thin section across the top of the page with logo and or heading. Can also be used within <article> or <section>.
<nav> - Links to additional pages, also remains atop of the page.
<main> - contains most of the important content of the page. Should be used once per page and within the <body>.
<article> - section of content that’s related to the main content, but can stand on its’s own.
<section> - groups together a single part of a website, in relation to its contents.
<footer> - Thin section across the bottom of the page, known to contain copyright, notices, contact info, and the sort.
non-semantic elements exist for when you as the developer want to group items together that fall into other semantic elements.
<div> - block level
<span> - inline
Line break <br>, can be used nested within <p> elements to maintain a firm structure.
Horizontal rule <hr> adds a dividing line; used outside elements.
Past planning the layout and structure of a single webpage, is to consider how one would approach structuring a website with multiple pages.
Metadata is information located in the <head> of the HTML file and contains information that is not displayed on the main content are of the browser when the page is loaded.
Elements found in the <head> range from the page <title>, <meta> for adding context, linking to CSS <link> or JavaScript <script> (although standard practice to put JS link in the footer or with defer attribute to allow HTML to load before JS.), or setting the language of the site.
<article> and <section> element tags?
<article> can stand on its own, but stiil related to main content ;<section> groups together parts of a site per relevance.<html>, <head>, <body>, <main>, <header>, <footer>, plus a few others<meta> HTML tag used when specifying metadata?
<h1> element over a <span> element to display a top level heading?
<h1> tag will format the content as a top level heading, where as a <span> is catered for more general use.<script> element