Test Answer
Test Answer
It is used to create a
design webpages.It structures web content such as text images and link using a
system of tags and elements
Hypertext- Hypertext that contains link to other text or document
Markup- This refer to marking up symbols with special Characters
Ans 2- The Basic Structure of an Html element is-
!DOCTYPE html>
<html lang="en">
<head>
</head>
</body>
</html>
Ans 3- Semantic HTML refers to the use of HTML elements that clearly
describe their meaning in a way that both the browser and developers can
understand. Semantic tags help improve accessibility, SEO, and the overall
readability of the code by providing more meaningful structure to a
webpage.
Examples of semantic HTML elements:
<header>: Represents the header section of a page, typically containing
navigational links, logo, or title.
<nav>: Defines a section containing navigation links.
<article>: Represents an independent piece of content, such as a blog post or
news article.
<section>: Defines a section of related content.
<footer>: Represents the footer section of a page, usually containing
copyright information or contact details.
<aside>: Represents content that is tangentially related to the main content,
such as sidebars
Example of semantic HTML:<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
Ans -4 In HTML, Block-level elements and Inline elements define how an element is displayed on a
web page and how it interacts with other elements.
1. Block-level Element:
A block-level element takes up the full width available, and it starts on a new line. These elements
create larger blocks that typically structure the page's layout.
2. Inline Element:
An inline element only takes up as much width as necessary and does not start on a new line. These
elements are typically used to format small pieces of content within a block.
Example:
<p>This is a paragraph with <a href="#">an inline link</a> and some <strong>inline strong
text</strong>.</p>
Key Differences:
Block-level elements are typically used for creating larger sections of a webpage, such as headers,
footers, and paragraphs.
Inline elements are used for styling or interacting with smaller pieces of content within block
elements, such as links or emphasized text
Ans-5
Absolute URL: A complete web address that includes the protocol (e.g., https://), domain name, and
the full path to the resource. It can be used to link to resources on external websites.
Example: https://www.google.com/page1.html
Relative URL: A partial web address that is relative to the current page or domain. It only includes
the path to the resource within the same website, not the full domain or protocol.
Example: /images/pic.jpg (relative to the current domain) or page1.html (relative to the current
directory).
Ans 6- CSS (Cascading Style Sheets) is a stylesheet language used to control the presentation, layout,
and visual formatting of HTML documents. It allows developers to style web pages by defining rules
for how elements should be displayed, such as colors, fonts, margins, and positions.
2. Internal CSS: Styles defined in the <style> tag within the <head>.
3. External CSS: Styles stored in a separate CSS file and linked to the HTML document.
Ans 7- A CSS selector is a pattern used to select and target HTML elements that you want to style. It
allows you to apply styles to specific elements in an HTML document based on their attributes, such
as their tag name, class, ID, or other properties.
h1 {
color: blue;
2. Class Selector: Selects elements with a specific class attribute. It is denoted by a period (.) followed
by the class name.
.my-class {
font-size: 18px;
3. ID Selector: Selects an element with a specific ID attribute. It is denoted by a hash (#) followed by
the ID name.
#my-id {
background-color: yellow;}
This applies to the element with the ID my-id.
input[type="text"]
*{
margin: 0;
padding: 0;
Ans 9-T he universal selector (*) in CSS is a selector that applies to all elements in the document. It
matches every element on the page, and can be used to apply a common style for all elements.
Ans 10- The differences between CSS inline, inline-block, and block elements
1. Inline
Inline elements do not start on a new line and only take up as much width as their content requires.
They sit next to other inline elements, in the same line, like text.
2. Inline-Block
Inline-block elements are similar to inline elements in that they do not break onto a new line and
can sit next to each other. However, they behave like block elements when it comes to width and
height.
3. Block
Block elements always start on a new line and take up the full width available by default. Other
elements are pushed below them.
center
end
base line
flex-end etc
b)-Align-items
Center
End
Start
C)-
Align content
Center
End
Start etc.
d) flex-direction
row
column
row-reverse
column reverse