HTML Questions Flashcards

1
Q

What is the relationship between HTTP and HTML?

A

HTTP (Hypertext Transfer Protocol) and HTML (Hypertext Markup Language) are both fundamental components of the World Wide Web. HTML is used to structure and present content on web pages, while HTTP is the protocol used for communication between web servers and web browsers. When you visit a website, your browser sends HTTP requests to the server, which responds with HTML code that the browser then interprets and displays as a web page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does our computer understand the HTML codes we write in code editors?

A

Computers understand HTML codes because web browsers, such as Chrome or Firefox, are designed to interpret and render HTML documents. Browsers read the HTML tags and elements in the code and use them to determine the structure and formatting of the content. They then display the content accordingly, applying styles, rendering images, and executing any scripts embedded in the HTML.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Is HTTP protocol involved when we search for files locally (in our computer)?

A

No, the HTTP protocol is not involved when you search for files locally on your computer. The HTTP protocol is specifically used for communication between web browsers and web servers over the internet. When you search for files on your computer, the operating system and file system handle the search operation locally without the need for any network communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why do we get error message “ 404 Page Not Found”?

A

The “404 Page Not Found” error message indicates that the web server could not find the requested resource or webpage. It typically occurs when you try to access a URL that doesn’t exist or has been removed. The server responds with the 404 status code to inform the browser that the requested page cannot be found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Is everything the browser displays HTML?

A

Not everything displayed in a web browser is HTML. While HTML is responsible for structuring the main content of a web page, other web technologies like CSS (Cascading Style Sheets) and JavaScript can be used to enhance the appearance and functionality of the page. CSS is used for styling and layout, while JavaScript allows for dynamic interactions and behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why do we need a folder when we can simply create an HTML file on VSC and see our HTML in browser?

A

Folders are used to organize and manage files in a structured manner. When working on web development projects, having a folder structure helps keep related files together, such as HTML, CSS, and JavaScript files. It also makes it easier to navigate and locate specific files within the project. While you can create an HTML file directly in a code editor like Visual Studio Code (VSC), it is still beneficial to organize your files within folders for better project management.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Can the format feature on VSC correct our codes if we forget opening or closing tags?

A

Visual Studio Code’s format feature can help improve the readability and consistency of your code by automatically formatting it according to predefined rules. While it can help with indentation and spacing, it won’t correct missing or mismatched opening/closing tags. It’s important to ensure proper tag structure manually to avoid issues with the interpretation of your HTML code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When we have an existing VSC window running, can we open a new VSC window?

A

Yes, you can open multiple instances of Visual Studio Code simultaneously. You can either open a new window from the File menu or by using keyboard shortcuts (e.g., Ctrl+Shift+N on Windows or Command+Shift+N on macOS). Each VSC window operates independently, allowing you to work on different projects or files simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Does including space or a new line affect our HTML codes?

A

In general, spaces and new lines within HTML code do not affect how the web browser interprets and displays the content. HTML ignores extra spaces and new lines and collapses them into a single space. However, there are exceptions where spaces and new lines can impact the visual layout, such as when using the <pre> tag, which preserves whitespace formatting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How come the header tag in our HTML shows as bold when viewed in browser without applying any CSS?

A

By default, web browsers apply some basic styling to HTML elements, even without any additional CSS. The <header> tag is one of the semantic elements in HTML, and certain browsers may apply a default style to make it visually distinct, such as displaying it in bold. However, the specific default styles can vary between browsers, and it’s generally recommended to define your own styles using CSS to ensure consistent appearance across different platforms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why don’t certain HTML tags, such as, img or br tags need closing tags?

A

Certain HTML tags, such as <img> (for images) and <br> (for line breaks), are classified as self-closing or void elements. These elements don’t require explicit closing tags because they don’t have any content that needs to be enclosed. Instead, they are written in a specific format, such as <img src="image.jpg" alt="Description"> or <br>, and the browser understands that they are complete on their own.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does the browser display texts we write without following the HTML boilerplate standard?

A

Browsers are designed to be forgiving and lenient when it comes to interpreting HTML code. If you write plain text without following the standard HTML structure (including the <html>, <head>, and <body> tags), the browser will still attempt to display it as best as it can. However, it’s considered good practice to adhere to the HTML boilerplatestandard to ensure proper structure, compatibility, and future-proofing of your web pages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can we create our folders in VSC or do we have to create them on other parts of our computer?

A

Visual Studio Code allows you to create folders within the workspace you’re currently working in. You can right-click on the sidebar or use the “New Folder” option from the File menu to create a new folder directly within VSC. These folders will be reflected in the file system of your computer, allowing you to organize your project files effectively.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do we mean by HTML element?

A

In HTML, an element is a building block of a web page. It consists of tags that define the structure and content of specific parts of the page. For example, the <p> element represents a paragraph, the <h1> element represents a heading, and the <img> element represents an image. HTML elements can have attributes that provide additional information or modify their behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How are title and heading tags (such as h1) different?

A

The title tag <title> is a specific HTML element used to define the title of a web page. It appears in the browser’s title bar or tabs and is also used by search engines when displaying search results. On the other hand, heading tags (such as <h1>, <h2>, etc.) are used to define different levels of headings within the content of a web page, indicating hierarchy and structure. Headings are typically displayed in larger and bolder text, providing visual prominence to the headings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the alt attribute do in our html tag?

A

The alt attribute is used in HTML tags like <img> (for images) and <a> (for links) to provide alternative text or descriptions for the content. It serves as a fallback in case the image or link cannot be loaded or accessed by the browser. Additionally, it is essential for accessibility purposes, as screen readers can read the alt text aloud, helping visually impaired users understand the content of the image or link.

17
Q

What are the information examples metadata contains?

A

Metadata in HTML provides additional information about the web page, its content, and its presentation. Some examples of metadata include:

  • <meta charset="UTF-8">: Specifies the character encoding used on the page.
  • <meta name="description" content="A brief description of the page">: Provides a concise description of the page’s content.
  • <meta name="keywords" content="keyword1, keyword2, keyword3">: Specifies keywords relevant to the page’s content for search engine optimization (SEO).
  • <meta name="author" content="John Doe">: Indicates the author of the page.
  • <link rel="stylesheet" href="styles.css">: Links an external CSS file to style the page
18
Q

Can web developers add or remove comments or reviews from their website?

A

As a web developer, you have control over the content of your website, including comments or reviews. You can add or remove them by modifying the HTML, CSS, or JavaScript code of your website. Typically, comments or reviews are stored in a database or a backend system, and you would need to implement appropriate functionality to allow users to add or remove comments through forms or other interactive elements on your site.

19
Q

How does our computer understand the HTML codes we write in code editors?

A

Code editors, like Visual Studio Code, are text editing tools that provide features specifically tailored for writing and editing code. When you write HTML code in a code editor, it doesn’t have inherent understanding or intelligence to interpret the code on its own. However, code editors often provide syntax highlighting, auto-completion, and error checking features to assist you in writing valid HTML code. These features help identify potential errors or suggest appropriate tags and attributes based on the context, making it easier to write and edit HTML effectively.