Tuesday, 02 January 2024 12:17 GMT

30 Basic HTML Interview Questions and Answers | PHP Gurukul


(MENAFN- PHP Gurukul) 1. What is HTML?

HTML stands for Hypertext Markup Language. It is the standard markup language used for creating web pages and applications on the internet. HTML uses various tags to structure the content and define the elements within a web page

2. What are the basic tags in HTML?

Some of the basic tags in HTML include:

: Defines the root element of an HTML page.
: Contains meta-information about the HTML document.
: Sets the title of the HTML document.
: Defines the main content of the HTML document.
, , , etc.: Heading tags used to define different levels of headings.
: Defines a paragraph.
: Creates a hyperlink.
: Defines a division or a container for other HTML elements.
3. What is the difference between HTML and CSS?

HTML (Hypertext Markup Language) is used for structuring the content of a web page, while CSS (Cascading Style Sheets) is used for styling the HTML elements. HTML defines the elements and their semantic meaning, whereas CSS determines how those elements should be visually presented on the page.

4. What is the purpose of the alt attribute in the img tag?

The alt attribute in the
5.What are the new features in HTML5?

HTML5 introduced several new features, including:

Semantic elements like , , , , etc.
Video and audio elements and for embedding multimedia content.
for drawing graphics and animations.
Local storage and session storage to store data on the client-side.
New form input types like , , , , etc.
Geolocation API for obtaining the user’s location.
Web workers for running scripts in the background to improve performance.
6. What is the purpose of the doctype declaration in HTML?

The doctype declaration () specifies the version of HTML being used in the document. It helps the web browser understand and render the page correctly by switching to the appropriate rendering mode. It is typically placed at the beginning of an HTML document.

7. What is the difference between inline and block elements in HTML?

Inline elements are displayed within a line of text and do not start on a new line. Examples of inline elements include , , , etc. Block elements, on the other hand, start on a new line and occupy the full width available. Examples of block elements include , , to , etc.

MENAFN21052023006798014672ID1106284145



PHP Gurukul

Legal Disclaimer:
MENAFN provides the information “as is” without warranty of any kind. We do not accept any responsibility or liability for the accuracy, content, images, videos, licenses, completeness, legality, or reliability of the information contained in this article. If you have any complaints or copyright issues related to this article, kindly contact the provider above.

Search