Questions & Answers
Q1. What is Semantic Tags?
Semantic tags are meaningful tags. We can provide more information about a webpage by using the semantic tags. Semantic elements clearly define its content. The semantic HTML tags help the search engines and other user devices to determine the importance and context of web pages.The pages made with semantic elements are much easier to read. It has greater accessibility. It offers a better user experience.If we use semantic tag browser can easily understand the webpage content and semantic tag are also SEO friendly.
Some semantic tags example:
- header: It defines a header for a web page.
- nav: It defines a container for navigation links.
- section: This defines a section in a web page.
- article: This element contains the main part, containing information about the web page.
- aside: The aside content is often placed as a sidebar in a document.
- footer: It defines a footer for a document or a section.
Q2. What is the difference between inline & block element?
Block elements: - A block-level element always starts on a new line, and the browsers automatically add some space (a margin) before and after the element.
- A block-level element always takes up the full width available
- A block-level have top and bottom margins
- Block-level element does not contain any other elements next to it.
Inline Element: - An inline element does not start on a new line.
- An inline element only takes up as much width as necessary.
- Inline dont have top and bottom margins as block elements have.
- A inline element contain elements next to it.