Top HTML Interview Questions for freshers

  • By
  • June 15, 2019
  • UI/UX DesigningWeb Development
Top HTML Interview Questions for freshers

HTML Interview Questions

HTML4
1) What is HTML ?
Ans- HTML stands for HyperText Markup Language. It is used for creating web-pages. We can create static web-page with use of HTML.

2) Is it necessary to specify HTML tags has in pair ?
Ans- No. There are few tags which doesn’t require any closing tag.
Ex-


3) What do you mean by image mag ?
Ans- You can link to many different web-pages with the use of image map

4) How to create links to specific sections within the same page ?
Ans- We have to use # symbol to give referance of specific content.
Ex- Top

For Free Demo classes Call: 8237077325

Registration Link: Click Here!

5) What do you mean by stylesheets ?
Ans- Stylesheets are used to make a web-page more responsive and attractive.

6) State difference between Canvas and SVG ?
Ans- SVG and Canvas both are used for drawing shapes on browser. The difference between SVG and Canvas is that we can view, save and edit the contents in SVG but not in Canvas.Because in Canvas everything is consider ed as one image. Another difference is in resolution. Resolution remains intact across different platform but not for the Canvas.

7) Mention difference between div and span ?
Ans- The difference between div and span is that div is used to display data in block and span is used to display data in-line.
Span is used to display small set of information inside any element.

8) What is the role of web-workers ?
Ans- With the use of web-workers we can handle multi-thread application.Through web-worker page does not have to wait for any action to complete.User can interact to the web-page while the web-worker runs in the background.

9) What is the role of web storage ?
Ans- Web-storage is used to store data locally on client’s browser.Before web-storage comes in a picture,data storage is done with the use of cookies. Now HTML5 has given two ways to store your data on client side namely localStorage and sessionStorage.

10) State difference between localStorage and sessionStorage.
Ans- The difference between localStorage and sessionStorage is in scope and life of the storage of data.
Data stored with the use of localStorage is permanent.It remains on client’s machin until someone deletes that data manually. And data stored with the use of sessionStorage is dependent on browser’s tab. When you close the tab, all the data stored in sessionStorage is deleted.
Scope of the sessionStorage is as per the window basis. If a user has two browser tabs displaying documents from the same web-page and you are storing data with the use of sessionStorage. Then it is going to create two seperate session storage for two different tabs.But this is not with the use of localStorage.

11) What do you mean by geolocation API in HTML5?
Ans- Geolocation API is used to share your physical location. Javascript captures a user’s latitude and longitude and send it to the web-server. Most of the browsers and mobile devices support the Geolocation API.

12) Explain CSS ?
Ans- It is referred as cascading StyleSheet.It is used to control the layout the HTML web-pages.In other words, it describes how the HTML content will be shown on screen.

13) Is there any difference between CSS and CSS3 ? Explain.
Ans- Yes. There are several features of CSS3.
• CSS3 has given graphics related properties like border-radius,box-shadow etc.
• CSS3 modules are supported on every browser.
• User can set multiple background images on a web-page by using background-image,background-position,background-repeat style.
• CSS3 is divided into various sections which are known as modules where as CSS 2 puts everything in a sinle document.

14) How many types of CSS. state them.
Ans-
• Inline- These are written in the tags only.
• Internal – These are written at the top of the web-page
• External- These are written in the separate file.

15) Is it necessary to include external CSS.Why ?
Ans- If we are writing styles in a single file. It can be used anywhere by just referencing the link of that external style sheet file. If we do any changes in external file, then it reflects the changes in the web-page. It is very useful and it makes your work easy while working on larger files.

16) Advantages of embedded style sheet?
Ans- Embedded style sheet gives us the privilege to define styles at one place in an HTML document.

17) What is Tweening.
Ans- Tweening is used for creating animation. It is the process in which we create intermediate frames between two images to get the appearance of the first image which develops into the second image.

18) What exactly Responsive web design is?
Ans- To make our web-page responsive we design and develop a web page according to the various components like the size of the screen, portability of the web page on different device etc. It is done by using different flexible layouts and grids.

For Free Demo classes Call: 8237077325

Registration Link: Click Here!

19)Explain CSS counters?
Ans- CSS counters are variables which are incremented by CSS that inspector track how many times the variable has been used.

20)What do you mean by gradients in CSS?
Ans- Gradient effects allows you to display a smooth transformation between two or more than two specified colors.

21)Explain CSS flexbox ?
Ans- It allows you to design a flexible responsive layout without using any float or positioning property of CSS. For using CSS flexbox you need to define a flex container first.

22)State the difference between padding and margin?
Ans- The margin is used for creating space around elements. Whereas , padding is used to generate space around an element’s content as well as inside any known border.

23)Elaborate the use of the Box Model in CSS?
Ans- The box model binds all the HTML elements and it includes features like margins, border, padding, and the actual content.

24)Explain the way to add icons to the web page?
Ans- If we want to add icons to the HTML webpage, we have to add the library like font-awesome.

25)What is a CSS pseudo class?
Ans- When a user looks over a particular element ,pseudo class styles an HTML element when it gets the focus.

26)Explain the concept of pseudo-elements in CSS.
Ans- With the use of pseudo class, we can style the specific part of the element.

27)Explain the term opacity?
Ans- This property gives the transparent effect of an element. For having transparent effect it take the values from 0.0-1.0, if the value is lower then the image is more transparent.

28)Explain relative and absolute in CSS?
Ans- The difference between relative and absolute is that relative is used for the same tag in CSS that means if we write the top:10px then the padding will shift to 10px from the top and in case of absolute is totally relative to the non-static parent. It means if we write top:10px then the result will be 10px far from the top of the parent element.

29)Define ‘important’ declarations used in CSS.
Ans- Important declarations are that declarations which are having more importance than the normal declarations. During Execution, important declarations override the declaration which is having less importance.
Ex-
Body {background: red !important; color: blue}

30)Differentiate between inline and block element.
Ans- If you set Display property to value i.e. Inline, we can’t set the width and height of that element and also it does not have the line break. But in case of Display:block, it gives line break, and also we can apply height and width to that element.

For Free Demo classes Call: 8237077325

Registration Link: Click Here!

31)Differentiate between the ID and class.
Ans-
• Id assigns a name uniquely to a particular element whereas class has an element with a certain set of properties which can be used for the complete block.
•The id used as an element because it uniquely identifies it whereas class is also defined to block the element and applies too many tags wherever it is used.
•Id provides the restriction to use its properties to one specific element whereas in class the inheritance is applied to a specific block or group of the element.

32)What is the origin of CSS?
Ans- SGML is the origin of CSS and SGML stands for Standard Generalized Markup Language. SGML defines markup languages.

33)What is the latest version CSS ?
Ans- The most recent generation of Cascading Style Sheet is DF-5 more commonly known as CSS4.

34)What is the latest frameworks of CSS ?
Ans-
• Bootstrap
• Foundation
• Semantic UI
• Gumby
• Ulkit

35) List the different types of selectors in CSS.
Ans-
• CSS Element Selector
• CSS Id Selector
• CSS Class Selector
• CSS Universal Selector
• CSS Group Selector
36) Explain universal selector.
37) Ans- The universal selector matches the name of any element instead of selecting elements of a specific type.
Ex:

38) Which command is used for the selection of all the elements of a paragraph.
Ans- We have to use p[lang] command for selecting all the elements of a paragraph.

39) What are the benefits of CSS sprites?
Ans-
If a web page has a large number of images which will take a longer time to load because each image is taking separate action for sending out an HTTP request. The main purpose of CSS sprites is to reduce the loading time for a web page because it combines the various small images into one image. It reduces the number of HTTP requests and eventually the loading time will also reduce.

40) What is float property?
Ans-
It is used to move the image to the right or left along with its text. It doesn’t change the. The properties define for the previous tags will be intact.
41) Difference between visibility: hidden and none ?
Ans-
When you set hidden value for the property it hides the element, but it occupies the space of that element and affect the layout of the document. And when we set it to none it hides the element but it doesn’t occupy space. And hence it will not affect to the layout.

42) What is the purpose of z-index and how it is used?
Ans-
The z-index specifies the stack order of positioned elements that may overlap one another. Default value of z-index is zero and can take on either a positive or negative number.
What do you understand by W3C?
Ans- W3C stands for World Wide Web Consortium. The purpose of W3C is to deliver the information of the World Wide Web. It also develops rules and guidelines for the Web.

43) What is the difference between HTML element & tag?
Ans- The difference between HTML element and tag is HTML element communicate to the browser to render text. When elements are enclosed by brackets <>, they form HTML tags.

44) What is semantic HTML?
Ans- It is a coding style. It working of sementic HTML is to reinforce the semantics or meaning of the content. Ex: In semantic HTML tag is not used for bold statement as well as tag is not used for italic. Instead of these we use and tags.

45) How do you keep list elements straight in an HTML file?
Ans- With the use of indents we can achieve displaying of elements in a straight line.

46) What is the use of iframe tag?

Ans- If you want to display nesting of web-pages that time we will use iframe tags. It is nothing but a web page within another web-page.
47) Which type of video formats are supported by HTML5?

Ans- Mp4,WebM,Ogg

48) What is the difference between progress and meter tag?

Ans- This is used to represent the progress of the specified task only but the meter tag is used to measure the data within a specified given range.

49) What is datalist tag? Ans- This tag provides an autocomplete feature on the form element. It gives the facility to choose the predefined options to the users for selecting the data.

50) What is the use of required attribute in HTML5?

Ans- The required attribute forces a user to input the data in the input box before submitting the form. It is used for form validation.

For Free Demo classes Call: 8237077325

Registration Link: Click Here!

Call the Trainer and Book your free demo Class for now!!!

call icon

© Copyright 2019 | Sevenmentor Pvt Ltd.

Submit Comment

Your email address will not be published. Required fields are marked *

*
*