0% found this document useful (0 votes)
29 views13 pages

2nd Sem PDF

HTML is a markup language used to structure and present content on the World Wide Web. It consists of elements that tell the browser how to display content. Some key features of HTML include that it is easy to use and learn, platform independent, and allows adding images, video, audio and links to make web pages interactive. The basic structure of an HTML document includes html, head, title and body tags.

Uploaded by

arghajitray
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views13 pages

2nd Sem PDF

HTML is a markup language used to structure and present content on the World Wide Web. It consists of elements that tell the browser how to display content. Some key features of HTML include that it is easy to use and learn, platform independent, and allows adding images, video, audio and links to make web pages interactive. The basic structure of an HTML document includes html, head, title and body tags.

Uploaded by

arghajitray
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

1. What is HTML?

HTML or Hypertext Markup Language, was created by


Berners-Lee in 1991. It is a markup language used to
create and structure website templates or web pages to
present content on the World Wide Web. It consists of a
series of elements, and the HTML elements tell the
browser how to display the content. HTML helps in making
the text more interactive and dynamic. You can save an
HTML page by adding .html or .html in the web page
name.

2. What are the features of HTML?


The following are the features of HTML:
 It is a markup language that provides flexibility to
design web pages with text.
 It is easy to use and learn.
 HTML is platform-independent and can be used on
Windows, Linux, Macintosh, etc.
 It enables programmers to add images, video, and
audio to a web page to make it more interactive.
 HTML allows programmers to add a link on web pages,
helping the readers to browse the information of their
interest.
 You can use tags either in lower-case or upper-case.

3. What is the difference between HTML elements and


tags?
HTML Elements Tags
1. The element is an 1. HTML tag (either opening
individual component of the or closing) marks the start
HTML web page or or end of an element.
document that consists of a
start tag, its attributes, an
end tag, and everything in
between.
2. They usually contain a 2. They begin with < symbol
start tag, content, and an and end with > symbol.
end tag. Whatever is written inside <
and > are called tags.
3. HTML Elements hold the 3. HTML Tags hold the
content. HTML element.
4. They specify the general 4. HTML tags are like
content. keywords. Each tag has a
unique meaning.
5. For example, <p>This is 5. For example, <a> is an
an example of a opening anchor tag and
paragraph.</p> </a> is a closing anchor tag.

4. Write the basic structure of the HTML


template.
The basic structure of the HTML template is:
<html>
<head>
<title>Title of the page</title>
</head>
<body>content of the page</body>
</html>

5. What are the most commonly used lists used


while designing a page?
The following are the most commonly used lists that are
used while designing a page:
 unordered list (<ul> tag) – displays elements in a
bulleted format.
 ordered list (<ol> tag) – displays elements in a
numbered format.
 definition list (<dl>, <dt> and <dd> tags) – displays
elements in definition form like in a dictionary.
6. Explain the layout of HTML.
HTML layout represents how all the elements in the
document are arranged.
The following HTML elements are used to define the
different parts of a webpage:
 <header>: define a header for a document or a section.
 <nav>: defines a container for navigation links
 <section>: it defines a section in a document
 <article>: define an independent, self-contained article
 <aside>: it defines content aside from the content
 <footer>: define a footer for a document or a section
 <details>: define additional details

7. What is the difference between a block-level


element and an inline element?

Block-level Elements Inline Elements


They start on a new line. Do not start on a new line
and can begin within a line.
Stretch to fill the full width Take up as much width as
available to them. necessary. Its width only
extends as far as it is
defined by its tags.
They have a top and a Inline elements do not have
bottom margin. a top and a bottom margin.
Examples of block-level Examples of inline
elements in HTML: <div>, elements: <span>, <img>,
<img>, <form>, <main>, <strong>, <code>, <input>,
<table>, <video>. <time>, <i>.

8. How to insert an image in HTML?


Images can be inserted using an HTML page’s <img>
tags. It is an empty tag with only attributes and does not
require a closing tag. The <img> tag must be used inside
<body>…</body> tag. The following parameters will be
required to insert an image using <img> tag
1. src attribute – It is used to add the path to the image
(URL of the image).
2. alt attribute – It is for adding alternate text.
3. Width – To add the width of the image
4. Height – To add the height of the image
Example:
<img src=”img_pancakes.jpg” alt=”Blueberry Pancakes”
width=”500″ height=”600″>

9. What are the different media types and


formats supported by HTML?
HTML supports a variety of media formats for sound,
music, videos, movies, and animations. The different
formats supported by HTML are:
 Images: jpg, jpeg, png, gif, svg, apng, BMP ico
 Audio: RealAudio, WMA, MIDI, AAC, WAV, MP3, MP4
 Video: MPEG, AVI, QuickTime, RealVideo, WMV,
Flash, WebM, and MP4
10. What is the difference between cell padding and
cell spacing?
Cell Padding Cell Spacing
cell padding is the white The space that exists
space that exists between between specific
the edge of a table cell and neighboring cells is known
its contents. as “cell spacing.”

It is associated with just one It is associated with multiple


cell. cells.
Cellpadding’s default value Cellspacing’s default value
is 1. is 2.

11. What are the different ways to display HTML


elements?
The different ways to display HTML elements are listed
below:
 inline: Any element at the block level can be shown as
an inline element using this technique. Aspect values
for the element’s height and width have no bearing.
 none: The HTML element can be hidden by using this
property.
 block: used to display inline element as a block
element.
 inline-block: This property is identical to inline, however
utilizing the display as inline-block, allows us to format
the element by using its height and width values.
 flex: The element and container are shown as flexible
construction. It adheres to flexbox properties.
 inline-flex: While its content adheres to the flexbox
specifications, the flex container is shown as an inline
element.
 grid: It presents the HTML elements in a grid container.

12. What do you understand by the universal


sector?
A universal selector is a selector is used instead of
selecting elements of a particular type.

Example:

*{

color: blue;

font-size: 10px;

13. What are the elements of the CSS Box


Model?
The CSS box model defines the layout and design of CSS
elements. The elements are content , padding , border
and margin .

14. How can CSS be integrated into an HTML


page?
There are three ways of integrating CSS into
HTML:using style tags in the head section, using inline-
styling, writing CSS in a separate file, and linking into
the HTML page by the link tag.

15. What is meant by RGB stream?

RGB represents colors in CSS. The three streams are


namely Red, Green, and Blue. The colors is represented
using numbers 0 to 256. This allows CSS to have different
colors.

16. What was the purpose of developing CSS?


CSS was developed to define the appearances of
websites. It allows developers to separate the structure
and content of a website that was not possible before.

17. What is the difference between a class and


an ID?
Class is a way of using HTML elements for styling. They
are not unique and have multiple elements. Whereas ID is
unique and it can be assigned to a single element.

18. How can you target h3 and h2 with the same


styling?
Multiple elements can be targeted by separating with a
comma.

Example:

h2, h3 {

color: red;

19. How can you use CSS to control image


repetition?
The background-repeat property is used to control the
image. Example:

h3 {

background-repeat: none;

}
20. Tell us about the property used for image
scroll controlling?
The background-attachment property is used to set
whether the background image is fixed or it scrolls with the
rest of the page.

Example for a fixed background-image:

body {

background-image: url(‘url_of_image’);

background-repeat: no-repeat;

background-attachment: fixed;

21. Name some font-related CSS attributes.


The font-related attributes are Font- style, variant, weight,
family, size, etc.

22. What are the limitations of CSS?

 CSS cannot always be used in every browser.


 The parent selector tag is not available, thus you can’t
select the parent selector tag.
 Some selectors can lead to cross-browser issues due
to their less browser-friendly behavior.
 We cannot request a webpage through CSS.
23. What are the different types of Selectors in
CSS?
Universal Selector, Element type Selector, ID selector,
Class selector, Descendant combinatory, Child
Combinator, General Sibling Combinator, Adjacent sibling
combinator, and Attribute selector.

24. Difference between reset vs normalize CSS?


How do they differ?
 Reset CSS is used to remove all built-in styles in the
browser such as paddings, margins, and font sizes,
and can be reset using all the elements.
 Normalize CSS is used to make all built-in styles in the
browser consistent and correct bugs.

25. What is the difference between inline, inline-block,


and block?

 Block Elements are <div> and <p>. They usually start


on a new line and can take space for an entire row or
width.
 Inline elements are <a>, <span>, <strong>, and <img>
tags. They don't start on a new line.They appear on the
same line as the content and tags beside them.
 Inline block elements have padding and margins and
set height and width values. They are similar to inline
elements.
26. How do you specify units in the CSS? What
are the different ways to do it?
There are mainly four different units in the CSS that are
px, em, pt, and percentage (%).

 Px (Pixel) is used for fine-grained control and alignment


and not cascade.
 Em is used to maintain relative size and responsive
fonts. 1em = 16px having also the same font size.
 Pt (point) is a fixed-size unit that is used in print. 1pt =
1/72 inch.
 Percentage (%) is used to set the font size with respect
to the font size of the body.

27. Does margin-top or margin-bottom have an


effect on inline elements?
No, Margin-top or Margin-bottom does not have an effect
on the inline elements.

28. What property is used for changing the font


face?
The font-family property is used for changing the font face
that is applied to the element in the DOM.

29. What are the differences between adaptive


design and responsive design?
Adaptive Design Responsive Design
 Main focus is to develop  Main focus is to show
a website in multiple content with respect to
fixed layout sizes. browser space.

 Offers good control over  Offers less control over


the design the design.

 It is very time-consuming  It takes less time to build


and takes a lot of effort to the design and there is
build the best possible no screen size issue
adaptive design. irrespective of content.

 There are six standard  It uses CSS media


screen sizes for the queries to design the
appropriate layouts; they screen layouts with
are 320px, 480px, 760px, respect to specific
960px, 1200px, 1600px devices and property
to design. changes in the screen.

30. What is cascading in CSS?


Cascading is defined as the process of style declaration
and its weight that will help the browser in selecting the
styling rules.

31. Difference between CSS grid vs flexbox?


 CSS Grid Layout is a two-dimensional system along
with rows and columns. It is used for large-sized
layouts.
 Flexbox is a Grid layout with a one-dimensional system
either within a row or a column. It is used for the
components of an application.

32. What is common between class and ID?

Both class and ID are used in HTML to assign a value


from CSS. The ID is used as an element and the class is
used as a block.

You might also like