What is context API and its purpose?

The Context API is a React Structure and by using it we can pass data to any child component without prop-drilling.In a typical react Application we pass data from a parent component to a child component via props. In a complex react application where we need to pass data to many nested components, this props drilling becomes very cumbersome so to overcome this problem react introduced an API called context API and by using it we can pass data to the nested components directly without the trouble of props drilling.

What are semantic HTML tags?

Semantic HTML is a kind of HTML that focuses on labeling code in a way that is useful and relevant to both the developer and the browser. for example a <div> tells nothing about the content it contains whereas <header> tells us that it contains the heading of the webpage. Semantic tags are easy to read and they provide greater accessibility.Search engines, screen readers and other technologies can easily understand the context of the website which improves user experience very much. Some Semantic tags: <article> , <main> , <header> , <footer> , <section> , <aside> , <nav>, <summary> etc.

What are the differences among inline,inline-block and block elements?

There are many differences among inline,inline-block and block elements.Some differences are shown below:

  • Block elements starts on a new line but inline and inline-block elements don't start on a new line.
  • Block Elements generally occupies the full width of the parent container but inline and inline-block elements occupies just the required width with respect to the content inside them.
  • We can set height and width in block and inline-block elements but we can't set height and width in inline elements.
  • Margin can be set in all sides of block and inline-block elements but inline elements don't allow margin-top and margin-bottom.
  • <div>,<h1> to <h6>,<p>,<li>,<section> etc are block elements.<button>,<input>,<select>,<textarea> etc are inline-block elements.<span>,<img>,<a>,<i>,<small> etc are inline elements.