Day 7: Interview Questions of html

 1.  What is HTML?

  • HTML stands for Hyper Text Markup Language.     
  • It is a language of the World Wide Web.   
  • It is a standard text formatting language that can be used to create and show pages on the web.   
  • It can be used to make written text more interactive, and can also turn text into images, tables, etc. 

2. What are Elements?

  • They are composed of 3 main things : A starting tag, its content and an ending tag.     
  • Some elements are unclosed elements.     
  • HTML tags are some text that are used to create elements.     
  • Every HTML element has various properties.
  • Syntax
    <h1> content </h1>
     In the above given example, h1 is the element, whereas <h1> and </h1> tags are used to create the h1 element.

3. How do attributes work? What are they used for?

  • Every tag can have additional attributes that alter how a tag acts or is shown.
  • For instance, an <img> tag has src attribute, which is used to provide the path of source of the image to be added.   
  • A tag's type attribute allows you to indicate whether a field is a text field, checkbox, radio button etc.     
  • They are written after the tag's name, and are written inside the two angular brackets.       
  • Always use opening tags or self-closing tags when applying attributes.           
  • Attribute names and it’s values are case sensitive, but it is recommended that they should be written exclusively in lowercase because they are case-sensitive.
  • Syntax
    <elementName attributeName="attributevalue">content inside the element</elementName>

4) In HTML, how do you divide a group of texts?

Below given tags can be used to divide a group of texts in HTML :

  • <p> tag : This tag is used to divide text into different paragraphs.     
  • <br> tag : This tag creates a new line in an HTML document, and transfers flow of content into a new line.

5) How should list components be aligned in an HTML document?

  • Using indents, we may align the list components in an HTML file.You can readily align and identify the multiple lists and the components they contain if you indent each nested list outwardly more than the parent list.
  • Example code for creating nested lists in HTML :

 

  6) When are HTML comments used?

  • You can add code comments to your HTML documents to make the code easier to read. These do not appear in the browser but assist you in leaving notes for yourself and other developers regarding the purpose of a certain HTML section.       
  • Any text in the midst of the comment, even if it contains proper HTML, will be completely ignored.   
  • Syntax for HTML comment : 

    <!-- HTML Comment is written here --

7) Identify a few typical lists that are used in page design.

  • To construct a page, many common lists are used. Any of the following list kinds, alone or in combination, may be chosen:     
  • A numbered format is used to present elements in an ordered list, whereas an unordered list does not follow a numbered form hence it is known as an unordered list.  
  • Ordered list : Denoted by <ol> tag, they display elements in numbered format.
  • Unordered list : Denoted by <ul> tag, they display elements using bullet format. 

8) How do you make an HTML hyperlink?

  • In HTML, a hyperlink connecting one page to another is made using the anchor tag. Images can also have the links added to them.

9) What does HTML formatting mean? 

  • The method of converting text into HTML results in a more appealing appearance and feel. It utilizes several tags to make text bold, add emphasis, and underline text.

10) Is a hyperlink restricted to text only?

  • No, hyperlinks can be used on both text as well as images. A hyperlink that connects one page to another is defined by the HTML anchor tag. The HTML anchor tag's "href" element is its most crucial component.

11) Is <!DOCTYPE html> an HTML tag?

  • No, the <!DOCTYPE html> declaration isn’t an HTML tag.    The first line of any HTML document must be a declaration.     
  • There is no HTML tag in the declaration. The browser receives "information" from this declaration about the document type to expect.   
  • It tells the browser to run in "Standard mode" and avoids behaviour of old browsers.       
  • The <!DOCTYPE> declaration is case insensitive.

12) What would happen if the HTML tags were not separated by any text?

  • If there was no text in between the tags, there would be nothing to format. Nothing will therefore show up on the screen.           
  • Some tags, such as those that don't have a closing tag, like the <img> , <br> tags, don't need any text in between them.

13) In HTML, how do you make nested web pages?

  • Nested web pages are essentially web pages within web pages. The built-in iframe tag in HTML can be used to construct nested web pages. An inline frame is defined by the HTML <iframe> tag.     
  • For example: The code below will generate an iframe with the specified width and height and show the Wikipedia page (whose URL is added in the value of src attribute)

14) How can buttons be added to HTML?

  • To add buttons to an HTML web page, we can utilise the built-in Button tag.
  • For Example:

15) What does HTML's alt property mean?

  • When an image cannot be loaded due to a technical issue, the alt attribute is used to show text in its place.
  • For Example:

  • For people who are blind or visually challenged, screen readers can read out the text in place of the image. As a result, it is a crucial characteristic for accessibility.

16) Explain meta tag

  • A HTML document's metadata is defined via the <meta> tag. Information related to data is referred to as metadata.   
  • The character set, page description, keywords, author of the document, and viewport settings are among the common information that is included in <meta> tags, which are always contained inside the "head" element.   
  • The page will not display any metadata.

Comments

Popular posts from this blog

else-if condition in if-else statements: Concatenation in JavaScript :

LCM & HCF- Tricks

Day 9: CSS - Font Formate