HTML Interview Questions & Answers

Showing 10 of 37 questions | Page 2

Technical interview questions and answers are essential when preparing for an HTML Interview because HTML forms the foundation of every web page. Recruiters want to evaluate your understanding of tags, attributes, forms, semantic elements, HTML5 features, media integration, and best coding practices. This topic is extremely common in frontend developer interviews, UI/UX roles, and full-stack development placements. Companies such as TCS, Infosys, Wipro, Cognizant, and Accenture frequently ask HTML questions to check whether candidates have strong web development fundamentals. This guide includes the most commonly asked HTML interview questions with explanations designed to help freshers and job seekers prepare effectively. Mastering these questions will help you perform confidently during coding tests, web design discussions, and campus placements.

Showing 10 of 37 questions

11. Can I have two or more actions in the same form?

No. A form must have exactly one action. However, the server-side (e.g., CGI) program that processes your form submissions can perform any number of tasks (e.g., updating a database, sending email, logging a transaction) in response to a single form submission.

12. How can I use forms for pull-down navigation menus?

There is no way to do this in HTML only; something else must process the form. JavaScript processing will work only for readers with JavaScript-enabled browsers. CGI and other server-side processing is reliable for human readers, but search engines have problems following any form-based navigation.

13. Why doesn't use the full browser width?
Graphical browsers leave a narrow margin between the edge of the display area and the content. Also note that Navigator always leaves room for a scrollbar on the right, but draws the scrollbar only when the document is long enough to require scrolling. If the document does not require scrolling, then this leaves a right "margin" that cannot be removed.

14. How do I create a link that sends me email?

Use a mailto link, for example

15. How can I show HTML examples without them being interpreted as part of my document?

Within the HTML example, first replace the "&" character with "&" everywhere it occurs. Then replace the "<" character with "<" and the ">" character with ">" in the same way. Note that it may be appropriate to use the CODE and/or PRE elements when displaying HTML examples.

16. How do I eliminate the blue border around linked images?

In your HTML, you can specify the BORDER attribute for the image: ... However, note that removing the border that indicates an image is a link makes it harder for users to distinguish quickly and easily which images on a web page are clickable.

17. How do I change the title of a framed document?

The title displayed is the title of the frameset document rather than the titles of any of the pages within frames. To change the title displayed, link to a new frameset document using TARGET="_top" (replacing the entire frameset).

18. How do I link an image to something?

Just use the image as the link content, like this: ...

19. How do I specify a specific combination of frames instead of the default document?

This is unfortunately not possible. When you navigate through a site using frames, the URL will not change as the documents in the individual frames change. This means that there is no way to indicate the combination of documents that make up the current state of the frameset. The author can provide multiple frameset documents, one for each combination of frame content. These frameset documents can be generated automatically, perhaps being created on the fly by a CGI program. Rather than linki

20. How do I create a link?

Use an anchor element. The HREF attribute specifies the URL of the document that you want to link to. The following example links the text "Web Authoring FAQ" to : Web Authoring FAQ
Questions and Answers for Competitive Exams Various Entrance Test