HTML Notes
HTML Notes
2. HTML provides description of web pages. (means it will tell which is paragraph,
which is image etc.) Its a skeleton of a webpage.
3. First, we have a html document then a web browser which renders (load /
translate) it and show web page to us.
4. Tags: a keyword/ anotation that tells the browser how to render different
elements.
7. Tags in HTML are case insensitive.( eg. html and HTML both are same.)
9. Text Element:
a) Block Element : <p>, <h1>, <ul>, <article>,<ol>,<li>
b) Inline element : <em> , <strong>, <a> ,<img>
10. Block Element: To divide whole webpage into different sections or blocks is
what
block elements do. (takes whole line)
11. Inline Element: used to differentiate specific part of text.(takes only space
which is necessary).
14. <br> : to insert line break. ( empty tag , self closing tag like, <hr> ,
<img> , < br> , < input> )
The start attribute specifies the start value of the first list item in an ordered
list.
This value is always an integer, even when the numbering type is letters or romans.
E.g., to start counting list items from the letter "c" or the roman number "iii",
use start="3".
<ol type="A" start="10"> :: it will start from j letter.
*=> Description List: It encloses a list of groups of terms (dt-> term, dd-
>description)
<dl>
<dt>Beast of Bodmin</dt>
<dd>A large feline inhabiting Bodmin Moor.</dd>
<dt>Morgawr</dt>
<dd>A sea serpent.</dd>
<dt>Owlman</dt>
<dd>A giant owl-like creature.</dd>
</dl>
18. <img src="source of image" alt= " message to be displayed when image will not
appear " height= "" width=" " />
19. Attributes is the property of a tag (ex. src is attribute and its path(url) is
value)
Provides additional information about element.
23. Id (# ) : it can only include unique element. (means 2 elements cant have the
same id) ,
24. Anchor tag used to create links <a href="https:// url " > content </a>
25. what happens when we close an empty tag? (ans. In case of vs code no error but
on other platforms it will throw an error ).
(some empty tags are : img, br, hr, area, meta)
(if u use <br></br> then VS Code will seen it as 2 <br> and leaves 2 line
breaks.)
26. <!Doctype html> : it tells the browser that its an html version 5 document.
27. <html lang ="en"> tells that the content of webpage is in english language.
28. Inside head tag meta data of HTML document, title is present .
like characterset , style, script, keywords , description.
35. Why headings only upto H6 are present not after it? (ans. 6 was presumably
chosen because it was assumed that nobody would need a sub-sub-sub-sub-sub-sub-
heading.
Very few documents come close to that level of subdivision
of sections. and its size decreases too much after h6).
39. <pre> : Tag used to give specific space as it was written in HTML code.
42. font-family: name => to describe the family or style of that font.
43. text-align : center (or left, right ) => to align text or content.
44. <b>, <i>, <u> : bold , italics , underline. (<strong> =>bold , <em> =>italics)
47. <mark> : text with background color (default is yellow, but can be changed by
using inline css).
=> cite : The HTML <cite> tag defines the title of a creative work (e.g. a
book, a poem, a song, a movie, a painting, a sculpture, etc.).
ex. <cite>.......</cite> (shows in italics)
=>address: The HTML <address> tag defines the contact information for the
author/owner of a document or an article.
ex. <address> .. address of author </address>
=>bdo: The HTML <bdo> tag is used to override the current text direction:
(bi-directional)
ex. <bdo dir="rtl">Hare Krishna</bdo>
This will be seen as opposite like , (anhsirK eraH).
52. Tables:
<table>
<tr> : Table row
<td> : Table column
</table>
54. <thead> : first row , use <th> inside thead so that it will be in bold
(To insert border to table use style tag, give border to table, tr, td and use
border-collapse : collpase;
58. create a form using table tag with username and password
as entries.
63. To write caption under the table use caption-side : bottom (changes in style
tag).
66. Ex. how u can do , no change in color of 1st column and change color of
others ??
Ans. <colgroup>
<col span = "1"> // only selected and no change is done in this.
<col span = "2" style="color:yellow">
</colgroup>
67. To hide a column in table : use visibility: collapse ( inside style tag)
(why to hide? ans. Some settings needs to be hidden from user and only
administrator
can change those settings).
(it is only for table (visibility: collapse ) but for other elements we can
use visibility : hidden)
68. To give caption for an image use :<figcaption> ( inside fig tag)
ex. <figure>
<img src="path.png">
<figcaption>Photograph by me</figcaption>
</figure>
72. How to create bookmarks? ( Bookmarks means to reach out a particular section in
an HTML page )
Ans. use id for that particular section and then use href tag ex. <a
href="#idname">Move to contacts</a>
(only valid for id not for class **)
73. scroll-behavior: smooth => (style) to make the scrolling of webpage smooth.
75. <span> tag: same as div tag , but its a inline element.
76. display property: it is used to convert a block element into a inline element
or vice versa.
(ex. display: block , converts given element into block
element ;
( display: inline-block => converts given element into inline element
with block properties )
( only difference between them is that in inline block we can set
height and width but in case of inline we cannot channge it
also we can set margin and padding in inline block but not in inline.)
77. semantic tags: which provides complete description about elements present
inside
(ex . <article> : it means content inside is an article ,
<table> )
78. Non- Semantic tag: which do not provide any description about element present
inside .
(ex. div,span ).
79. <arcticle> : independent data (it can contain multiple <p> tag).
81. Some semantic tags : Header, Nav, Section, Article, Aside, Footer.
: These dont change the content visually, they just needed for good
practice.
82. section can be inside article tag or article can be inside section tag.
83. Difference between < h1> and header. (ans. <h1> is a heading, header is a
container and container can contain h1 tag.)
84. Can we use header inside footer? (ans. No, element header can't be a descendant
of footer ).
85. Can we use multiple header tags? (ans. yes, we can use multiple headers, but it
should not be descendant of other elements ).
87. <nav> => navigation Links ( anchor tags is generally used inside it) .
88. <aside> => like adds, note, summary, indirectly connected content.
89. float : center do not work , (left and right works fine ).
(it helps to give position to div/ block).
92. ' for ' attribute of label stag should be same as that of id.
=> For selecting only one value from radio buttons name should be same
for all.
=> <p>This is another Paragraph<p></p> => (code) => <p>This is another Paragraph
<p> </p> (< -> lower tag , >-> greater tag)
<audio controls>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
97. To add icons in html page like icon of insta, whatsapp etc.
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/5.15.3/css/all.min.css">
and then use fab fa-twitter etc.
98. To use external fonts : @import url('https://fonts.googleapis.com/css2?
family=Pacifico&display=swap');
and now can use that particular type of font.