Web Development
For beginners
Chapter 1: Websites
Today, the internet is accessible in almost every part of the world. In the last two decades, the internet and web have grown rapidly, so the websites. If you go two decades back, the websites were very different. They were not at all attractive, of course, and most importantly, they were static. By static, I mean, everything on a web page was fixed. But nowadays, websites are dynamic, generated by web applications.
Static and dynamic websites
In a static website, everything is fixed until someone changes it manually from behind. Such websites are created using HTML and are the most straightforward part of website development. All the users visiting a static website have the same view. But the content on a dynamic website can be different for every user. For example, amazon's homepage is a bit different for a signed-in user and a non-signed in user. If you are not signed in, you cannot see your account information, order history, and other stuff. It appears only when you sign in with your credentials.
A dynamic website is linked with at least one database where all the dynamic information is stored. There is no such database in the case of static websites. User-interaction is another essential part of a dynamic website.
The main focus of this book is on the development part. There are many differences. As I mentioned earlier, HTML is used to create a static website. HTML is one of the core technologies of the World Wide Web(WWW). The other two technologies are CSS and JavaScript. You can also use CSS and JavaScript on a static website to make it more attractive and a bit intractable. But the central concept, i.e. data is fixed and does not change. But using these three technologies more effectively, especially, JavaScript can create beautiful and high performing dynamic websites.
Don't worry; We will discuss all these three technologies in depth after this chapter. But before moving further, let's talk HTML, CSS, and JavaScript in brief so you can have an idea of what you are going to learn.
HTML
HTML stands for Hypertext Markup Language. It does not matter how big or complicated your website is going to be; you will always start with HTML. It is the standard language to create structures for the web. While CSS and Javascript have changed a lot over the years, HTML of the 1990s and 2010s is not much different.
The basic structure of a web page is created using HTML. There are several HTML elements, and they are the building block of these pages. HTML elements are used in the form of tags. The tags are angular brackets with HTML names written inside them. For example, the HTML tag for image is . Most of these tags have a closing tag like
and
. However, some tags, such as does not require a closing tag. CSS and JavaScript are further applied to HTML to change its appearance and to make it dynamic, respectively.
CSS
Cascading Style Sheets or commonly known as CSS is the presentation part of a web page. HTML creates a structure, and CSS converts it into an attractive and more readable version. No website is complete without CSS today. Users expect a website to be appealing, engaging, and above all, properly readable.
With CSS, you can change the font, color, size, positions, layouts, and many more things. There are multiple ways of using CSS in an HTML file, each having its own advantage.
JavaScript
JavaScript is considered the most crucial part of a website. It is the most popular language of the year 2019 according to StackOverflow insights. Well, most of the websites you visit are created using javascript.
It is a scripting language that is used on client-side as well as server-side. Earlier, javascript can only run in a browser, but with the introduction of node.js, it can run outside too. Web frameworks and libraries such as Angular, React, Vue are built using javascript. As node.js, it is also used to create backend services.
Summary
There are two types of websites - static and dynamic.
Static websites have fixed content that does not change.
Content in a dynamic website can change, either by users or automatically for different users.
HTML, CSS, and JavaScript are the three core technologies of the World Wide Web(WWW).
HTML elements are accessed using angular brackets, or commonly known as tags. These tags are used to create the structure for a web page.
CSS is used to enhance the appearance of a web page.
JavaScript is a scripting language that plays a vital role in developing dynamic websites. It is used for user interaction, content management, manipulating databases, and many more.
Chapter 2: Understanding HTML elements, tags, and attributes
As discussed in the last chapter, HTML elements are the building blocks of a web page. These elements are enclosed in angular brackets. Many HTML tags have corresponding closing tags. There are also a few tags that do not require such closing tags. We will discuss all these tags in the upcoming chapter, but first, you need to understand how HTML tags work.
Basic HTML tags
Let's start with the most basic tag, i.e. tag. Every HTML document starts with tag and ends with its corresponding closing tag, tag. Other HTML tags are nested inside this tag only.
Other two basic HTML tags are and tags.
HTML files can render in a browser. The visible part in the browser window is written inside the tag. It can contain several elements, such as paragraphs, headings, images, videos, sections, divisions, etc.
Another basic tag is the tag. All the information regarding the document is listed in the tag. It include HTML tags such as,,, etc. In the early versions, the tag was mandatory but in HTML 5, It can be omitted.
This is how usually an HTML document is structured, the tag first, followed by the tag.
HTML attributes
All the HTML tags are built for a specific purpose. For example, the
is used to for paragraphs and is used for images. Most of the HTML tags have additional properties or characteristics that are defined by attributes. A tag may or may not have mandatory attributes. The tag, for example, must contain src and alt attributes. Further, you can place height and width attributes, but they are not mandatory. Have a look at the below HTML code.
A tag is defined with two attributes - src and alt. Value for an attribute is written inside the double-quotes. As of now, these two attributes do not have any values.Closing and opening tagsAs I have mentioned above, Many tags have corresponding closing tags. The difference between the opening and clo