Unit 8: Web Development with HTML, CSS and JavaScript — Short Questions
9th Class Computer Science · Unit 8: Web Development with HTML, CSS and JavaScript
Web Development & Its Components
Web development is the process of creating websites and web applications. It involves using various programming languages and tools to design, build, and maintain websites.
Front-end Development focuses on what users see and interact with on a website.
Back-end Development manages the behind-the-scenes part of a website, like servers, databases, and application logic.
HTML stands for Hyper Text Markup Language. It is the standard language used to create web pages. Think of HTML as the building blocks of a website.
Content in HTML is the main information on a web page that users read and interact with.
Headings in HTML, ranging from <h1> to <h6>, are used to define the structure and hierarchy of content on a web page.
Paragraphs in HTML are used to organize and separate text into readable sections. Links in HTML are used to connect one web page to another. They allow you click on words or images to go to different parts of the same page or to other pages on the internet.
In HTML, comments are used to insert notes or explanations within the code.
CSS & JavaScript
Styling with CSS (Cascading Style Sheets) is essential for enhancing the visual appearance of web pages and improving user experience.
JavaScript is a programming language that is used to make websites interactive and engaging.
Debugging is the process of finding and fixing issues in your code.
HTML
Ordered List In an ordered list all the items of the list start with a number and the numbers are in ascending order. The <ol></ol> tags are used for creating an ordered list and each item of the list is surrounded with <li></li> tags.
Unordered List In an unordered list each item of the list generally starts with a bullet. Unordered means the list items are not having a number. The <ul></ul> tags are used for creating an unordered lists and each item of the list is surrounded with <li></li> tags.
Hyperlink is such an icon, graphic, or text in a webpage, when clicked takes you to some other webpage. Hyperlink allow you to go from one page to another page.
There are two important terms that you need to understand in the name HTML.
- Hypertext
- Markup Language
Markup is what HTML tags do to the text inside them. A webpage consists of a series of elements which are represented by tags.
Example: <p> I am 9th class student </p>
Here <p> shows marking of paragraph opening tag and </p> means marking of paragraph closing tag.
The term Hypertext is used due to the special text in a webpage called hyperlinks. By clicking on these links you can move from one webpage to another. Hyperlinks are used to navigate on the World Wide Web (WWW).
HTML tags are commands or codes that specifies how a Web page is formatted.
HTML tells the browser how the contents are structured inside a webpage. When you send request to a web server through a web browser to access a webpage, you get HTML as a response from there. The web browser understands the HTML and displays contents of the webpage.
These are the following types of lists in HTML:
1: Unordered list
2: Ordered list
Hyperlinks are used to navigate on the World Wide Web (WWW). Hyperlink is such an icon, graphic, or text in a webpage, that when clicked takes you to some other webpage. The term Hypertext is used due to the special text in a webpage called hyperlinks.
HTML elements HTML documents consist of text files that contain HTML elements. HTML elements are defined using HTML tags. HTML tags are surrounded by the two characters < and > and generally they come in pairs, such as <head> </head>. Some HTML have no content are called empty elements. Empty element do not have an end tag, such as <br> element.
Element content The text between these two tags is known as element content.
HTML Tags
To create a webpage, you need a text editor, a software to edit text in a file. You can use Notepad and in Mac you use Text Edit. You can follow these four steps to create your first webpage.
1. Open text editor like Notepad or WordPad
2. Write some HTML content.
3. Save the HTML Page with extension .htm or .html
4. In order to view your first webpage, just double click the HTML file web browser is automatically opened to show your webpage.
There are two types of tags in an HTML document.
1. Paired Tags
2. Unpaired Tags
Paired Tags
Most of the tags in HTML are paired tags. They consist of a start tag, an end tag and contents between them.
Syntax: <tagname> Contents </tagname>
Example: For example, tag p to create a paragraph in HTML document is a paired tag.
Unpaired Tags
Some tags do not have closing tags and they are called unpaired tags or empty tags. They are simply written as <tagname>.
Example: For example, <br> for line break. <hr> to insert a horizontal line.
HTML & Different Attributes
Attributes are the properties associated with tags. They provide some information with respect to a specific tag. Each attribute is given a value.
Generally, a tag with attributes is written as: <tagname attribute1="value" attribute2="value" ....attribute="value">
Example: For example, <p align = "center"> Content </p> shows the content of a paragraph at center with respect to left and right margins.
HTML
The first tag in the html document is <html> that indicates the start of the HTML document. The last tag is </html> indicates that is the end of the HTML document.
Syntax: <html> </html>
Body Section Anything typed inside the body tags will be displayed in the browser window. The visible part of the HTML document is between <body> and </body>.
Syntax: <body> </body>
Head section typically defines the document title, styles and other information about the whole document. Head section starts with <head> tag and ends with </head>
Syntax: <head> </head>
To specify title of the webpage, you use <title> tag inside <head> </head> tags. The text between these tags is used to set the title to the page. It is displayed on the title bar of the Web browser.
Syntax <title> </title>
Example <title>First HTML Document</title> will display First HTML Document, on the title bar of the Web browser.
Creating a Paragraph
The <p> tag marks starting of a paragraph, and </p> tag marks closing of the paragraph. The text inside <p> </p> tags is actual contents of the paragraph.
Syntax: <p> </p>
Inserting Line Breaks
The <br> element inserts a line break without starting a new paragraph.
Syntax: <br>
Example
<p> This is <br> a paragraph</p> displays text in two lines, as following:
This is
a paragraph
Inserting Spaces
If the user wants to have many spaces in a HTML document then the   character entity must be used.
Syntax:  
Example
For example, <p> I study in 9th class. </p> generates the following output.
I study in 9th class.
Add Headings/Sub-headings There are six headings tags, <h1></h1> to <h6></h6>. The <h1></h1> tags are used to specify the largest heading and <h6></h6> tags specify the smallest.
Text formatting tags are used to format the text in HTML document. Some commonly used text formatting tags are described below.
Bold the text
These tags will make the text bold that is within the tags.
Syntax: <b></b>
Example <b> I LOVE PAKISTAN</b>
Underlining the text
These tags will underline the text that is within the tags.
Syntax: <u></u>
Example <u> I LOVE PAKISTAN </u>
Italic the text
These tags are used to make the text italic that is within the tags.
Syntax: <i></i>
Example <i> I LOVE PAKISTAN </i>
Font Size <font size= "?"></font> tags are used to change the font size. Replace the ? Symbol with a number in the range 1 to 7. 1 is the smallest and 7 is the largest font size.
Example <font size= "7"> WORLD WIDE WEB </font>
Font Color <front color="?"></front> tags are used to change the color of text that is within the tags. Replace the ? symbol with color such as black, blue brown, gray, green, maroon, orange, pink, red white, yellow, etc.
Example <font color= "blue"> WORLD WIDE WEB </font>
Font Face <font face= "?"></font> tags are used to change the font face of text that is within the tags. Replace the ? symbol with font face such as arial, courier, calibri,Times new times roman, etc.
Example <font face= "arial"> WORLD WIDE WEB </font>
If for some reason the browser cannot display an image, the user can insert the alt attribute in the <img> tag to tell the reader what image is missing in the page. The value of the alt attribute provides alternative text in place of image in the Web page.
An image can be set as background of a page using the background attribute in the <body> tag.
Example <body background = "image.jpg">
The bgcolor attribute of <body> tag specifies the background color of a document and text attribute specifies the foreground text color of the webpage.
Example
<body bgcolor="#E6E6FA" text="red">
<h1>Hello world!</h1>
</body>
<table></table> tags are used for table.
Metadata is data(information) about data. Metadata will not be displayed on the page, but will be machine parsable.