DEV Community

Narmatha
Narmatha

Posted on

HTML INTERVIEW QUESTION

1.WHAT IS HTML ?
HTML (HyperText Markup Language) is the standard language used to structure content on the web. It tells the browser how to display text, images, and other elements on a webpage.

1.HTML is a markup language, not a programming language.
2.It defines the structure of a webpage using tags and elements.
3.HTML is static; CSS styles it and JavaScript adds interactivity.
4.It forms the foundation of almost every website today.

2. 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.

<h1>Hello!</h1> <!-- This makes a big **heading** -->
<p>A **paragraph** goes here.</p>

Enter fullscreen mode Exit fullscreen mode

3. 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)   <audio>, <video>
Graphics     No native support   <canvas>, <svg>
Forms            Basic inputs            New inputs: email, date, etc.

Enter fullscreen mode Exit fullscreen mode

4. 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.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Cool **Website**</title>
</head>
<body>
  <h1>Hey There!</h1>
  <p>Welcome to my **page**.</p>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

5. 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.

**Attribute         Purpose                     Example**
  id           Gives a unique ID              <p id="intro">
 class         Assigns a class                    <p class="text">
 href          Specifies a link                   <a href="page.html">
 src           Specifies a file/source            <img src="photo.jpg">
 alt           Alternative text for image     <img alt="Photo">
 style         Adds CSS styling                   <p style="color:red">
 title         Shows tooltip information      <p title="Hello">
 disabled       Disables an element           <button disabled>

Enter fullscreen mode Exit fullscreen mode

Top comments (0)