HTML is a markup language used to create static web pages and web applications. CSS is a style sheet language responsible for the presentation of documents written in a markup language.
Html Css intrview quections
Web applications and websites are increasing in every industry, and CSS is essential to build attractive websites. Currently, there is a tremendous demand for web developers who have a good knowledge of HTML and CSS. To build a career in web designing, candidates need to crack interviews where they ask CSS interview questions.
1. What is HTML?
Answar 1 HTML stands for HyperText Markup Language. It is the standard markup language for creating web pages and web applications.
2. What are the main components of an HTML document?
Answar 2 The main components of an HTML document are the HTML tags, which define the structure and content of the page, and the content enclosed within those tags.
3. What is the purpose of the declaration?
Answar 3 The declaration specifies the document type and version of HTML being used. It helps browsers to render the page correctly.
4. What is the difference between HTML and XHTML?
Answar 4 XHTML is stricter than HTML and follows XML syntax rules. XHTML documents must be well-formed, meaning all elements must be properly nested and closed.
5. Explain the difference between
and tags.
Answar 5
is a block-level element used to group HTML elements and apply styles to them as a whole. is an inline element used to apply styles to smaller parts of the text or inline elements.
6. What is the purpose of the tag?
Answar 6 The tag provides metadata about the HTML document, such as character set, author, description, and keywords.
7. What is semantic HTML?
Answar 7 Semantic HTML is using HTML tags that convey meaning beyond just formatting to both the browser and developer, making the structure of the webpage moreunderstandable
9. Explain the difference between GET and POST methods in HTML forms.
Answar 9 GET method sends data through the URL, while POST method sends data in the HTTP request body. GET is used for retrieving data, while POST is used for submitting data.
10. What is the purpose of the alt attribute in tags?
Answar 10
The alt attribute specifies alternative text for an image if the image cannot be displayed. It is important for accessibility and SEO.
11. What is the difference between the tag and the tag?
Answar 11
tag is used for bold formatting, while tag is used to convey importance, typically rendered as bold but carries semantic meaning.
12. Explain the difference between the and tags.
Answar 12
The tag contains meta-information about the document, such as title, links to stylesheets, and scripts. The tag contains the content that is visible on the webpage.
13. What is the purpose of the href attribute in the tag?
Answar 13
The href attribute specifies the URL of the page the link goes to. It is used to create hyperlinks.
14. What is the purpose of the target attribute in the tag?
Answar 14
The target attribute specifies where to open the linked document. For example, "_blank" opens the link in a new window or tab.
15. What is the difference between a local and a session storage in HTML5?
Answar 15
Local storage stores data with no expiration date, while session storage stores data only for the duration of the page session.
16. What is the purpose of the tabindex attribute?
Answar 16
The tabindex attribute specifies the order in which elements are focused when using the keyboard to navigate through a webpage.
17. What is a self-closing tag? Give an example.
Answar 17
A self-closing tag is an HTML tag that doesn't require a separate closing tag. Example:
18. Explain the purpose of the
Answar 18
The
19. What is the purpose of the
Answar 19
The
20. Explain the difference between absolute and relative URLs.
Answar 20
Absolute URLs specify the full web address of a resource, including the protocol (http/https). Relative URLs specify the path to a resource relative to the current page
21. What is CSS?
css===
Answar 21
CSS stands for Cascading Style Sheets. It is a stylesheet language used to describe the presentation of a document written in HTML.
22. What are the different ways to include CSS in an HTML document?
Answar 22
CSS can be included in an HTML document using inline styles, internal stylesheets (using the