DEV Community

Anandhi P
Anandhi P

Posted on

HTML interview question.

  1. What are HTML tags? HTML tags are special keywords enclosed in angle brackets (< >) that tell a web browser how to structure and display content on a webpage.
  2. What’s the difference between HTML and HTML5? HTML is the general name for HyperText Markup Language, and HTML5 is the latest launched version in 2014. HTML5 added awesome features like:

Aspect HTML HTML5
Doctype Long & complex Simple: <!DOCTYPE html>
Multimedia Needs plugins (Flash) ,

mostly , ,
APIs None Geolocation, Web Storage, etc
  1. What’s the basic structure of an HTML document? Every HTML document needs a specific setup so browsers know how to read it. It’s like the blueprint for your web page. Here’s what goes in it:

<!DOCTYPE html>: Tells the browser this is an HTML5 page.
: The main container for everything else.
: Holds behind-the-scenes info like the page title or links to CSS and JavaScript.
: Where all the visible stuff goes, like text, images, or links.

  1. What’s the difference between a tag and an element? A tag is just the code you write, like

    or

    , inside angle brackets. An element is the whole package: the opening tag, the content inside, and the closing tag. Some tags, like , are self-closing and don’t need a closing partner. So, tags are the tools, and elements are what you build with them.

Tag:

or , just the code.
Element: Hi there!, the tag plus content.
  1. What are attributes in HTML?
    Attributes are extra details you add to an opening tag to give it more powers. They look like name="value". For example, they can tell a link where to go or an image what picture to show. Common ones are href for links, src for images, and id to give something a unique name.

  2. What kinds of lists can you make in HTML?
    HTML lets you create three types of lists:

Ordered List (

    ): Shows items with numbers or letters (like 1, 2, 3). Unordered List (

Top comments (0)