The Internet is the global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to link devices worldwide. (Wikipedia)
The World Wide Web (WWW), commonly known as the Web, is an information system where documents and other web resources are identified by Uniform Resource Locators (URLs, such as https://www.example.com/), which may be interlinked by hypertext, and are accessible over the Internet. (Wikipedia)
A web browser (commonly referred to as a browser) is a software application for accessing information on the World Wide Web. (Wikipedia)
Web development is the work involved in developing a website for the Internet (World Wide Web) or an intranet (a private network). (Wikipedia)
Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. (Wikipedia)
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language like HTML. (Wikipedia)
HTML describes the structure and content of a web page.
<!DOCTYPE html>
<html>
<head>
<title>Title of the page</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
An HTML element usually consists of an opening tag and a closing tag, with content in between.
<tagname>some content</tagname>
If you right click anywhere on a page in Google Chrome, you can then click Inspect to open Chrome DevTools. All the elements of the page will be visible in the Elements panel in an interactive fashion.
CSS describes the styles of the elements on a web page.
body {
background: gray;
}
h1 {
font-family: sans-serif;
}
p {
color: red;
}
Once you are in Chrome DevTools, if you click on any element in the Elements panel, the relevant CSS code will show up in the Styles panel.
View the source code | View the page
<DOCTYPE! html>
defines the document type to be HTML5.
<html></html>
defines an HTML document, all HTML elements except for <DOCTYPE html>
go in here.
<head></head>
defines the information about the document, and elements in here do not show up on the page.
<title></title>
defines the tile of the page, and shows up in the browser tab of the page.
<body></body>
defines the body of the page. The elements in the body show up on the page.
<h1></h1>
defines a heading.
<p></p>
defines a paragraph.
View the source code | View the page
<!-- this is a comment in HTML -->
View the source code | View the page
<img src="path/to/image" alt="alternative text">
View the source code | View the page
<ul>
<li>Unordered Item 1</li>
<li>Unordered Item 2</li>
<li>Unordered Item 3</li>
</ul>
<ol>
<li>Ordered Item 1</li>
<li>Ordered Item 2</li>
<li>Ordered Item 3</li>
</ol>
HTML Lists: https://www.w3schools.com/html/html_lists.asp
View the source code | View the page
<a href="relative/or/absolute/url">This is a link</a>
HTML a tag: https://www.w3schools.com/tags/tag_a.asp
View the source code | View the page
<div>
<h1>Section 1</h1>
<p>Paragraph of section 1.</p>
</div>
<div>
<h1>Section 2</h1>
<p>Paragraph of section 2.</p>
</div>
View the source code | View the page
A simple website that combines all of the above.
View the source code | View the page
<p style="color: red;">This paragraph will be in red.</p>
<!DOCTYPE html>
<html>
<head>
<style>
p {
color: red;
}
</style>
</head>
<body>
<p>This paragraph will be in red.</p>
</body>
</html>
<!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<p>This paragraph will be in red.</p>
</body>
</html>
/* style.css */
p {
color: red;
}
View the source code | View the page
/* this is a comment in CSS */
View the source code | View the page
body {
background-color: lightgray;
}
h1 {
color: rgb(255,0,0);
}
p {
color: #0000ff;
}
View the source code | View the page
h1 {
font-size: 8em;
}
p {
font-size: 10px;
}
img {
width: 50%;
}
View the source code | View the page
body {
margin: 0;
padding: 10vw;
border-width: 1em;
border-style: solid;
border-color: gray;
}
h1 {
padding: 2em;
margin-bottom: 50px;
border: 2px solid green;
}
p {
margin: 15px;
padding: 10px 0 0 10px;
border: 1px dashed blue;
}
img {
padding-top: 10px;
border-top: 5px dotted red;
}
View the source code | View the page
<div class="caption">
<h1>Section 2</h1>
<p>Paragraph of section 2.</p>
</div>
.caption {
font-family: sans-serif;
font-size: 0.8em;
font-style: italic;
color: darkgray;
}
View the source code | View the page
A simple styled website that combines all of the above.
There are many ways to publish your website, but one of the easiest way is with GitHub Pages. And it’s completely free!
Go to github.com. Once logged in, click on the + icon and then New repository.
Enter Repository name and Description, then click Create repository.
Note that the repository name is going to be a part of the URL of the website you are going to publish, so lowercase words joined by hyphens is generally a good format.
Once the repository is created, click uploading an existing file.
The easiest way to upload your website is to select all the files (including .html files, .css files, and the image files, etc.) and drag them to the area as indicated below.
Wait until all your file names appear on this page, then click Commit changes to confirm the upload.
Optionally, you can add some comments to this upload so it will be easy for you to track this upload in future.
It may take a few minutes for the files to be uploaded depending on your file sizes and your internet connection.
Your files are ready when you see something similar to the page below, and then you can go to Settings.
On the Settings page, scroll all the way down, you will see the section GitHub Pages. Click on None and select main (the default branch where you have uploaded all your files to) as the source.
Click Save to confirm your source selection.
Once saved, if you scroll down to the section GitHub Pages again, you will see a link that will take you to your published website.
Note that the URL of your website should look like this: your-username.github.io/your-repository-name.
Woohoo, you just published your first website and you can share this with anyone that has internet access!