- What is HTML?
- HTML stands for Hypertext Markup Language. It is the standard markup language used for creating and structuring web pages and web applications.
- What are the basic components of an HTML document?
- An HTML document consists of elements such as tags, attributes, and content. Tags define the structure of the document, attributes provide additional information about elements, and content is the text or multimedia displayed on the webpage.
- What is the purpose of HTML tags?
- HTML tags are used to define the structure and content of a web page. They enclose different parts of the content to indicate how it should be displayed or processed by the browser.
- How do you create a hyperlink in HTML?
- To create a hyperlink in HTML, use the
<a>
tag followed by thehref
attribute, which specifies the URL of the link. For example:<a href="https://www.example.com">Visit Example</a>
.
- What is the difference between HTML and CSS?
- HTML is used for structuring the content of a webpage, while CSS (Cascading Style Sheets) is used for styling and formatting the appearance of HTML elements.
- What is the purpose of HTML headings?
- HTML headings (
<h1>
to<h6>
) are used to define the headings or titles of sections within a document. They represent hierarchical importance, with<h1>
being the most important and<h6>
being the least.
- How do you add an image to an HTML document?
- To add an image to an HTML document, use the
<img>
tag with thesrc
attribute specifying the URL of the image file. For example:<img src="image.jpg" alt="Description">
.
- What is the role of HTML comments?
- HTML comments (
<!-- comment -->
) are used to add notes or annotations within the HTML code. They are not displayed on the webpage but can provide useful information for developers or anyone reading the code.
- What is semantic HTML?
- Semantic HTML refers to using HTML elements that convey meaning about the content they contain. Examples include
<header>
,<nav>
,<article>
,<section>
,<footer>
, which help improve accessibility and search engine optimization.
- How do you create a bulleted list in HTML?
- To create a bulleted list in HTML, use the
<ul>
(unordered list) tag to define the list container and<li>
(list item) tags to define each item in the list. For example:html ¨K1K
- To create a bulleted list in HTML, use the