DEV Community

ASHWINTH
ASHWINTH

Posted on

HTML INTERVIEW QUESTIONS :)

  1. What is HTML?

HTML (HyperText Markup Language) is the standard markup language used to create and structure web pages. It defines the layout and content of a webpage using elements such as headings, paragraphs, images, links, tables, and forms.

  1. What is HTML5?

HTML5 is the latest version of HTML. It introduces semantic elements built-in support for audio and video, improved form controls local storage and better support for modern web applications.

  1. What are HTML tags?

HTML tags are predefined keywords enclosed in angle brackets (< >) that define how content is displayed and structured on a webpage. Most HTML tags have an opening tag and a closing tag.

  1. What are HTML attributes?

HTML attributes provide additional information about HTML elements. They are specified inside the opening tag and help define properties such as the source of an image, the destination of a link or the identifier of an element.

  1. What is the difference between HTML and HTML5?

HTML5 is an improved version of HTML that supports multimedia without plugins, introduces semantic elements, provides better form validation includes new APIs and Local Storage, and improves performance and accessibility.

  1. What is the difference between id and class?

The id attribute uniquely identifies a single HTML element, while the class attribute can be assigned to multiple elements. IDs should be unique within a webpage, whereas classes are used to group similar elements.

  1. What are block-level elements?

Block-level elements occupy the full width and always starts with a new line. They are mainly used to create the structure and layout of a webpage.

  1. What are inline elements?

Inline elements only occupy the space required by their content and do not start on a new line. They are mainly used for formatting text or small portions of content within block-level elements.

  1. What are HTML lists?

HTML lists are used to organize related items in a structured format. HTML supports ordered lists, unordered lists, and description lists for displaying information clearly.

10.Name some HTML5 input types?

  • email
  • number
  • date
  • file
  • range
  • tel
  • url
  • text
  • password
  • time

11.what is main axis and cross axis?
Main Axis:
The main axis is the primary direction in which Flexbox arranges items. It depends on the flex-direction property, and justify-content is used to align items along this axis.

Cross Axis:
The cross axis is the direction perpendicular to the main axis. It is also determined by the flex-direction property, and align-items is used to align items along this axis.

Easy Example

  • flex-direction: row
  • Main Axis → Horizontal
  • Cross Axis → Vertical

  • flex-direction: column

  • Main Axis → Vertical

  • Cross Axis → Horizontal

Memory

Main Axis → justify-content
Cross Axis → align-items

12.what is flexbox?

lexbox (Flexible Box Layout) is a one-dimensional CSS layout model used to arrange, align, and distribute space between items inside a container.Flexbox can arrange items either horizontally (row) or vertically (column), and it provides easy control over spacing, alignment, and the order of elements.

13? what is css?

Css stands for Cascading Style Sheets its used to style a HTML web pages. It is used to add colors, fonts, spacing, borders, animations, and responsive designs to make websites visually attractive and we use three typely in our html page inline and internal and externaal css.

14.What is the difference between id and class?

An id uniquely identifies a single HTML element, while a class can be shared by multiple elements. IDs have higher specificity than classes.

15.What is the difference between Margin and Padding?

Margin is the space outside an element's border, while padding is the space between the content and the border.

16.what is grid?

CSS Grid is a two-dimensional layout system that allows developers to design web pages using rows and columns.

17.what is z-index?

The z-index property controls the stacking order of overlapping elements. Elements with a higher z-index appear above those with a lower value.

  1. define css seletors?

CSS selectors are patterns used to select HTML elements and apply styles to them. They allow developers to target elements based on tag name, class, ID

  1. what is input tag and why we use it?

The input tag is an HTML form element used to collect user input. It supports different input types such as text, password, email, number, date, checkbox, radio button, and file upload, its creating interactive web forms.

20.what is placeholder and why we use it?

The placeholder attribute is used to display a temporary hint or example inside an input or textarea field. It helps users understand what type of information should be entered and disappears when the user starts typing.

21.what is html table?

An HTML table is used to organize and display data in rows and columns. It is created using the table element along with tr, th and td tags, making it easy to present structured information in a clear and readable format.

22.what is bootstrap?

Bootstrap is a free, open-source CSS framework used to create responsive, mobile-first websites quickly. It provides pre-built CSS classes, a responsive grid system, and reusable UI components, making web development faster and easier.

Top comments (0)