HTML stands for HyperText Markup language. It is a standard text formatting language used for developing web pages. HTML is a language that is interpreted by the browser and it tells the browser what to display and how to display.
It is the standard text formatting language used for creating and displaying pages on the Web.
HTML alone is not sufficient for a web developer because HTML only defines the structure of the data that will be rendered on the browser in a webpage, to make it visually appealing and to make it functional, we will need to use CSS and Javascript respectively.
The latest version of HTML is HTML5. There are two main components in HTML language, Tags and Attributes.
Q2. Please explain how to indicate the character set being used by a document in HTML
The character set is defined in tag insideelement.
Q3. Are the HTML tags and elements the same thing?
No. HTML elements are defined by a starting tag, may contain some content and a closing tag
Ex:
<h1>Heading 1</h1> is a HTML element but just <h1> is a starting tag and </h1> is a closing tag.
Q4. What are Tags?
HTML tags are composed of three things, an opening tag, content and ending tag. Some tags are unclosed tags.
HTML documents contain two things:
content
tags
When a web browser reads an HTML document, the browser reads it from top to bottom and left to right. HTML tags are used to create HTML documents and render their properties. Each HTML tags have different properties.
Q5. What is the key difference between HTML Elements and Tags?
HTML Elements
The sections of the web page, such as a paragraph, an image, or a link is an element, and an element has a certain way of execution. For example, the link is used to be clicked, and the text boxes can be used to input text.
HTML Tags
HTML elements communicate with the browser how to represent the text and become HTML tags when enclosed within angular brackets <>.
Q6. What are void elements in HTML?
HTML elements which do not have closing tags or do not need to be closed are Void elements.
Ex:
<br />, <img />, <hr />, etc.
Q7. Do all HTML tags have an end tag?
No. There are some HTML tags that don't need a closing tag.
Ex:
<image> tag, <br> tag.
Q8. If you want to display some HTML data in a table in tabular format, which HTML tags will you use?
The HTML has a specific tag.
The table tag to display data in tabular form. Below is the list of the HTML tags used to display data in tabular form in HTML.
<table>
For defining a table.
<caption>
For mentioning a caption to the table.
<tr>
For defining a row in a table.
<td>
For defining a cell in a table.
<th>
For defining a header cell in a table.
<tbody>
For grouping the body’s content in a table.
<col>
For specifying the column properties for each column of the table.
Q9. What is the advantage of collapsing white space?
A blank sequence of whitespace characters is treated as a single space character, Because the browser collapses multiple spaces into a single space character and this helps a developer to indent lines of text without worrying about multiple spaces and maintain readability and understandability of HTML codes.
Q10. What is formatting in HTML?
The HTML formatting is a process of format the text for a better look and feel. It uses different tags to make text bold, italicized, underlined.
Q11. What are HTML Entities?
In HTML some characters are reserved like ‘<’, ‘>’, ‘/’, etc. To use these characters in our webpage we need to use the character entities called HTML Entities.
Q12. What is the ‘class’ attribute in HTML?
The class attribute is used to specify the class name for an HTML element. Multiple elements in HTML can have the same class value. Also, it is mainly used to associate the styles written in the stylesheet with the HTML elements.
Q13. How many types of heading does an HTML contain?
An attribute is given to each tag to alter the behavior of the tag. Attributes are defined directly after the tag name, inside the angular brackets.
They appear in opening tags and can never appear in closing tags.
You can define an attribute for the <input> tag, such as a text field, checkbox, radio , file button, etc ...
Q15. What is the difference between the ‘id’ attribute and the ‘class’ attribute of HTML elements?
Multiple elements in HTML can have the same class value, whereas a value of id attribute of one element cannot be associated with another HTML element.
Q16. Define multipart form data?
Multipart form data is one of the values of the enctype attribute. It is used to send the file data to the server-side for processing.
The other valid values of the enctype attribute are text/plain and application/x-www-form-urlencoded.
Q17. How to create a hyperlink in HTML?
The HTML provides an anchor tag to create a hyperlink that links one page to another page.
Unvisited link - It is displayed, underlined and blue.
Visited link - It is displayed, underlined and purple.
Active link - It is displayed, underlined and red.
Q18. Describe HTML layout structure?
<header>: Stores the starting information about the web page.
<footer>: Represents the last section of the page.
<nav>: The navigation menu of the HTML page.
<article>: It is a set of information.
<section>: It is used inside the article block to define the basic structure of a page.
<aside>: Sidebar content of the page.
Q19. How to optimize website assets loading?
To optimize website load time we need to optimize its asset loading...
CDN hosting - A CDN or content delivery network is geographically distributed servers to help reduce latency.
File compression - This is a method that helps to reduce the size of an asset to reduce the data transfer
File concatenation - This reduces the number of HTTP calls
Minify scripts - This reduces the overall file size of js and CSS files
Lazy Loading - Instead of loading all the assets at once, the non-critical assets can be loaded on a need basis.
Q20. What are Lists in HTML?
HTML lists are used to group a set of related items in lists. It is defined with an <li> tag.
Q21. What is the difference between <strong>, <b> tags and <em>, <i> tags?
The effect on a normal webpage of the tags <strong>, <b> and <em>, <i> is the same. <b> and <i> tags stands for bold and italic. These two tags only apply font styling and bold tag <b>, just adds more ink to the text, these tags don't say anything about the text.
Whereas, <strong> and <em> tags represent that the span of text is of strong importance or more importance and emphatic stress respectively than the rest of the text. These tags have semantic meaning
Q22. What are Forms in HTML?
Forms are used to collect the user information when they are filled, and details are provided to save into the database.
Q23. Can we display a web page inside a web page or Is nesting of webpages possible?
Yes, we can display a web page inside another HTML web page. HTML provides a tag <iframe> using which we can achieve this functionality.
<iframe src="url of the web page" />
Q24. What is an image map?
Image map facilitates you to link many different web pages using a single image. It is represented by <map> tag. You can define shapes in images that you want to make part of an image mapping.
Q25. How can we use comments in HTML?
<!-- ‘Comment’ -->
Q26. How to insert a copyright symbol on a browser page?
Q27. How is Cell Padding different from Cell Spacing?
Cell Spacing is the space or gap between two consecutive cells. Whereas, Cell Padding is the space or gap between the text/content of the cell and the edge/border of the cell.
Q28. Does a hyperlink only apply to text?
No, you can use hyperlinks on text and images both.
Q29. What is HTML5?
HTML5 was first released in a public-facing form on 22 January 2008, with a major update and "W3C Recommendation" status in October 2014.
Its goals were to improve the language with support for the latest multimedia and other new features, to keep the language both easily readable by humans and consistently understood by computers and devices such as web browsers, parsers, etc.
Q30. What is Semantic HTML?
A semantic element clearly describes its meaning to both the browser and the developer.
Ex: non-semantic elements: <div> and <span> - Tells nothing about its content.
Ex: semantic elements: <form>, <table>, and <article> - Clearly defines its content.
Q31. How can we club two or more rows or columns into a single row or column in an HTML table?
With "rowspan" and "colspan" to make a cell span to multiple rows and columns respectively
Q32. What is the difference between “display: none” and “visibility: hidden”?
When we use the attribute "visibility: hidden" for an HTML element then that element will be hidden from the webpage but still takes up space.
Whereas, if we use the "display: none" attribute for an HTML element then the element will be hidden, and also it won’t take up any space on the webpage.
Q33. What is a ‘Marquee’ Tag in HTML?
You can put scrolling text with a Marquee tag. With the help of this tag, an image or text can be scrolled up, down, left, or right.
<marquee> Your text will be here </marquee>
Q34. What is a style sheet?
A style sheet is used to build a consistent, transportable, and well-designed style template.
Q35. What is the purpose of using alternative texts in images?
The purpose of using alternative texts is to define what the image is about. During an image mapping, it can be confusing and difficult to understand what hotspots correspond to a particular link.
These alternative texts come in action here and put a description at each link which makes it easy for users to understand the hotspot links easily.
Q36. What is the use of an iframe tag?
An iframe is used to display a web page within a web page.
<iframe src="URL"></iframe>
Q37. Can you create a multi-colored text on a web page?
Yes, for this we can use <font color =”color”> </font>
Q38. How to make a picture of a background image of a web page?
You should use the below tag code after the </head> tag.
<body background = "image.gif">
Q39. In how many ways can we specify the CSS styles for the HTML element?
There are three ways:
Inline: Here we use the ‘style’ attribute inside the HTML element.
Internal: Here we use the <style> tag inside the <head> tag. To apply the style we bind the elements using ‘id’ or ‘class’ attributes.
External: Here we use the <link> tag inside <head> tag to reference the CSS file into our HTML code. Again the binding between elements and styles is done using ‘id’ or ‘class’ attributes.
Q40. What is the use of a span tag?
For adding color on text
To add background on text
Highlight any color text
Q41. How many tags can be used to separate a section of texts?
Three tags are used to separate the texts
<br>
<p>
<blockquote>
Q42. How do you send an email when clicked?
You need to use the mailto command
<a href="mailto:emailaddress">text to be clicked</a>
Q43. How to include javascript code in HTML?
HTML provides a <script> tag using which we can run the javascript code.
Q44. Difference between link tag <link> and anchor tag <a>?
The anchor tag <a> is used to create a hyperlink to another webpage or to a certain part of the webpage and these links are clickable.
Link tag <link> defines a link between a document and an external resource and these are not clickable.
Q45. What are empty elements?
HTML elements with no content are called empty elements. For example: <br>, <hr> etc.
Q46. What are the limits of the text field size?
The default size for a text field is around 13 characters.
Q47. How can we include audio or video in a webpage?
HTML5 provides two tags, <audio> and <video> tags using which we can add the audio or video directly in the webpage.
Q48. What is the difference between <figure> tag and <img> tag?
The <figure> tag specifies the self-contained content, like diagrams, images, code snippets, etc. <figure> tag is used to semantically organize the contents of an image like image, image caption, etc.
The <img> tag is used to embed the picture in the HTML5 document.
Q49. How to specify the metadata in HTML5?
To specify we can use <meta> tag which is a void tag.
This website uses cookie or similar technologies, to enhance your browsing experience and provide personalised recommendations. By continuing to use our website, you agree to our Cookie Policy.