HTML Short Notes
HTML Short Notes
Line Break Tag anything following it starts from the next line.Empty/Single tag
<br>
Centering Content any content in the center of the page or any table cell.
Horizontal Lines The <hr> tag creates a line from the current position in the
document to the right margin and breaks the line accordingly.
Empty/Single tag.
Preserve Formatting Any text between the opening <pre> tag and the closing </pre>
tag will preserve the formatting of the source document.
Nonbreaking Spaces use a nonbreaking space entity
HTML element <p> This is paragraph </p>
content.
<h1> This is heading content. </h1>
<div This is division content. </div>
>
<br />
Nested HTML Elements allowed to keep one HTML element inside another HTML element:
Align Attributes three possible values of align attribute: left, center and right.
Core Attributes
Id,Title ,Class ,Style
The Id Attribute The id attribute of an HTML tag can be used to uniquely identify
any element within an HTML page.
<p id=”x..y..z">….</p>
The title Attribute The title attribute gives a suggested title for the element.
<h3 title="Hello HTML!">………</h3>
The class Attribute class="className1 className2 className3"
The style Attribute <p style="font-family:arial; color:#FF0000;">Some text...</p>
Internationalization
Attributes dir ,lang ,xml:lang
The dir Attribute The dir attribute allows you to indicate to the browser about the
direction in which the text should flow.
ltr Left to right
rtl Right to left
<html dir="rtl">
The lang Attribute The lang attribute allows you to indicate the main language used in
a document.
<html lang="en">
Nested Tables You can use one table inside another table
unordered list This will list items using plain bullets ,in which <li>…</li> tag used
<ul>…….</ul>
The type Attribute You can use type attribute for <ul> tag to specify the type of bullet
you like.
<ul type="square">
<ul type="disc">
<ul type="circle">
<ol type="1"> - Default-Case Numerals.
<ol type="I"> - Upper-Case Numerals.
<ol type="i"> - Lower-Case Numerals.
<ol type="a"> - Lower-Case Letters.
<ol type="A"> - Upper-Case Letters
ordered list If you are required to put your items in a numbered list instead of
bulleted,in which <li>….</li> tag is used.
<ol>………</ol>
The start Attribute <ol type="i" start="4" >
Definition Lists
A definition list. This arranges your items in the same way as they
are arranged in a dictionary
HTML <canvas> Tag <canvas> tag is for drawing graphics, animations etc using scripting.
<canvas id="newCanvas">Your browser does not support
canvas tag.</canvas>
HTML <del> Tag <del> tag is used for markup of deleted text
<del>HTML del tag</del>
HTML Tag
HTML <dt> Tag The HTML
tag is used to define the start of a term in a definition list.
HTML <em> Tag The HTML tag formats the text in a document. It specifies emphasized text.
<em>image</em>
HTML <embed> Tag tag represents a container for external application or interactive content.
<embed src="/html/yourfile.mdi" width="250" height="100"
/>
HTML <form> Tag tag is used for creating a form for user input
<form action="/cgi-bin/hello_get.cgi" method="get">
First name:
<input type="text" name="first_name" value=""
maxlength="100" />
<br />
Last name:
<input type="text" name="last_name" value=""
maxlength="100" />
<input type="submit" value="Submit" />
</form>
HTML <html> Tag tag is the container that contains all other HTML elements except
for the !doctype tag which is located before the opening tag. All
other HTML elements are nested between the and
tags.
HTML <i> Tag I tag is used to display the content in italic.
HTML <iframe> Tag tag is used to create an inline frame
<iframe src ="http://www.tutorialspoint.com/index.htm"
width="100%"></iframe>
HTML <ilayer> Tag The HTML <ilayer> tag is used to create a layer that
occupies space in the containing text
flow.
HTML <ins> Tag The HTML <ins> tag is used to indicate newly inserted text.
<ins>HTML ins tag</ins>
HTML <isindex> tag <isindex> tag is used for querying a document through a text
field.
HTML <kbd> Tag <kbd> tag defines keyboard input. It is a phrase tag.
<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>T</kbd>
HTML keygen Tag <keygen> tag is used to process Web forms with certificate
management
Systems
HTML <label> Tag The HTML <label> tag is used to add a label to a form control
like text, textarea etc.
HTML <layer> Tag The HTML <layer> tag is used to position and animate
(through scripting) elements in a
Page
<layer id="layer1" top="250" left="50" width="200"
height="200" bgcolor="red">
<p>layer 1</p>
</layer>
HTML <legend> Tag The HTML <legend> tag s used to define a caption for
<fieldset> tag.
<form>
<fieldset>
<legend>Details</legend>
Student Name: <input type="text"><br />
MCA Subjects:<input type="text"><br />
Course Link:<input type="url" name="websitelink">
</fieldset>
</form>
HTML <li>Tag The HTML <li> tag is used for specifying a list item in ordered,
unordered, directory, and
menu lists
<ul>
<li>ol - ordered list</li>
<li>ul - unordered list</li>
<li>dir - directory list</li>
<li>menu - menu list</li>
</ul>
HTML <link> Tag <link> tag is used for defining a link to an external document.
It is placed in
the <head> section of the document.
HTML Main Tag <main> tag specifies main or important content in the
document
HTML <map> Tag The HTML <map> tag is used for defining an image map along
with <img> tag.
<img src="/images/html.gif" alt="HTML Map" border="0"
usemap="#html"/>
<!-- Create Mappings -->
<map name="html">
<area shape="circle"
coords="154,150,59" href="about/about_team.htm"
alt="Team"
target="_self" />
</map>
HTML Mark Tag <mark> tag specifies a text highlighted for reference
purposes,
HTML <marquee> Tag <marquee> tag is used for scrolling piece of text or image
displayed either
horizontally across or vertically down your web site page
depending on the settings
<marquee>This is basic example of marquee</marquee>
<marquee direction="up">The direction of text will be
from bottom to
top.</marquee>
HTML <menuitem> tag The HTML <menuitem> tag is used for defining a menu item
for a menu.
HTML <meta> tag The HTML <meta> tag is used for declaring metadata for the
HTML document.
Difference between HTML In HTML the <meta> tag has no end tag.
and XHTML In XHTML the <meta> tag must be properly closed.
HTML <meter> Tag The HTML <meter> tag specifies a scalar measurement within
a known range (a gauge).
<meter value="7" min="0" max="10">2 out of 10</meter><br
/>
HTML <multicol> tag <multicol> tag is used to create multiple columns of text and
lets you control
the size and number of the columns
HTML <nav> Tag The HTML <nav> tag specifies a section that contains only
navigation links.
<nav>
<a href="dbms/index.htm">DBMS</a> |
<a href="mongodb/index.htm">MongoDB</a> |
<a href="mysql/index.htm">MySQL</a> |
<a href="plsql/index.htm">PL/SQL</a> |
<a href="sql/index.htm">SQL</a>
</nav>
HTML <nobr> Tag The HTML <nobr> tag is used to instruct the browser
not to break the specified text (such as the usual line
wrap that occurs at the right edge of the browser
window).
HTML <noembed> Tag The HTML <noembed> tag is used to handle
browsers which do not support the <embed>
tag. The <noembed> tag makes it easy to supply
alternative content that tells users what
they are missing.
HTML <noframes> Tag
HTML <noscript> Tag
HTML <object> Tag
HTML <ol> Tag The HTML <ol> tag is used for creating an ordered list.
<ol>
<li>ol - ordered list</li>
<li>ul - unordered list</li>
<li>dir - directory list</li>
<li>menu - menu list</li>
</ol>
HTML <optgroup> Tag The HTML <optgroup> tag is used for grouping related options
within your select list.
HTML <option> Tag The HTML <option> tag is used within a form for defining
options in the drop-down list.
<form action="/cgi-bin/dropdown.cgi" method="post">
<select name="dropdown">
<option value="Java" selected>Maths</option>
<option value="Ruby">Physics</option>
</select>
<input type="submit" value="Submit" />
</form>
HTML Section Tag The HTML <section> tag specifies a section in a document.
HTML <select> Tag The HTML <select> tag is used within a form for defining a
select list.
HTML <spacer> Tag The HTML <spacer> tag specifies a whitespace.
HTML <small> Tag <p><small> Simply Easy Learning</small></p>
HTML <dialog> tag The HTML <source> tag is used for defining multimedia
resources for <audio> and <video> elements
<audio controls>
<source src = "yourfile.mp3">
<p>The browser doesnot support the file</p>
</audio>
HTML <strong> tag The HTML <strong> tag is used for emphasizing an important
text.
HTML <style> tag <style type="text/css">
h1 { color:#F1F1F1 }
</style>
HTML <sub> Tag The HTML <sub> tag is used for defining subscript text.
HTML <sup> Tag The HTML <sup> tag is used for defining superscript text.
HTML <table> Tag The HTML <table> tag is used for defining a table. The table
tag contains other tags that define the structure of the table.
HTML <tbody> Tag The HTML <tbody> tag is used in adding a body to a table
HTML <td> Tag The HTML <td> tag is used for specifying a cell or table data
within a table.
HTML textarea Tag The HTML <textarea> tag is used within a form to declare a
textarea element - a control that allows the user to input text
over multiple rows.
HTML <tfoot> Tag The HTML <tfoot> tag is used in adding a footer to a table
HTML <th> Tag The HTML <th> tag is used for specifying a header cell or
table header within a table.
HTML <thead> Tag
HTML <time> tag The HTML <time> tag is used for displaying the human
readable date and time.
HTML <title> Tag The HTML <title> tag is used for indicating the title of the
HTML document
HTML <tr> Tag The HTML <tr> tag is used for specifying a table row within a
table.
HTML <track> tag <audio controls>
<source src = "yourfile.mp3">
<track src = "subtitles.vtt" kind="subtitles"
srclang="en" label="English">
<p>:The browser doesnot support the file</p>
</audio>
HTML <tt> Tag The HTML <tt> tag specifies teletype text. This is not
supported in HTML5.
HTML <u> Tag The HTML <u> tag is used to underline a text.
HTML <ul> Tag The HTML <ul> tag is used for creating an unordered list.
HTML <var> Tag <p> The equations: <var>3x</var> - <var>7z</var> =
<var>8y</var> + 2 and
<var>x</var> + <var>3z</var> = <var>4y</var> + 9 </p>
HTML <wbr> Tag The HTML <wbr> tag defines a potential line break point if
needed. This stands for Word Break Opportunity
HTML <xmp> Tag The HTML <xmp> tag specifies preformatted text.
CSS Rules Overriding 1- Any inline style sheet takes the highest priority. So, it will
override any rule defined in <style>...</style> tags or the rules
defined in any external style sheet file.
2-Any rule defined in <style>...</style> tags will override the rules
defined in any external style sheet file.
3- Any rule defined in the external style sheet file takes the lowest
priority,and the rules defined in this file will be applied only when
the above two rules are not applicable.
CSS Comments /*.....this is a comment in style sheet.....*/
Unit MEASUREMENT UNITS
%,cm,em,in,mm,….etc p {font-size: 16pt; line-height: 125%;}
div {margin-bottom: 2cm;}
p {letter-spacing: 7em;}
p {font-size: 24pt; line-height:3ex;}
p {word-spacing: .15in;}
p {word-spacing: 15mm;}
COLORS p{color:#FF0000;}
p{color:rgb(50%,50%,50%);}
MARGINS The margin specifies a shorthand property for setting the margin properties
in one declaration.
The margin-bottom specifies the bottom margin of an element.
The margin-top specifies the top margin of an element.
The margin-left specifies the left margin of an element.
The margin-right specifies the right margin of an element.
<p style="margin-bottom: 5%; border:1px solid
black;"></p>
<p style="margin-top: 15px; border:1px solid black;"></p>
<p style="margin-left: 15px; border:1px solid
black;"></p>
<p style="margin-right: 15px; border:1px solid
black;"></p>
OUTLINES
DIMENSION The height property is used to set the height of a box.
The width property is used to set the width of a box.
The line-height property is used to set the height of a line of text.
The max-height property is used to set a maximum height that a box can be.
The min-height property is used to set the minimum height that a box can
be.
The max-width property is used to set the maximum width that a box can
be.
The min-width property is used to set the minimum width that a box can be.
<p style="width:400px; max-height:10px;border:1px solid
red;
padding:5px; margin:10px;"></p>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-
scale=1">
<title>Bootstrap demo</title>
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
2. Include Bootstrap’s CSS and JS. Place the <link> tag in the <head> for our CSS, and the <script> tag for our
JavaScript bundle (including Popper for positioning dropdowns, poppers, and tooltips) before the closing </body>.
Learn more about our CDN links.
<!doctype html>
<html lang="en">
<head>
<title>Bootstrap demo</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]
alpha2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnu
TN7QbdgL+OapgHtvPp" crossorigin="anonymous">
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
3. HTML5 doctype
<!doctype html>
<html lang="en">
...
</html>
4. Viewport meta
Bootstrap is developed mobile first, a strategy in which we optimize code for mobile devices first and then scale up
components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices,
add the responsive viewport meta tag to your <head>.
5. What is RFS?
Bootstrap’s side project RFS is a unit resizing engine which was initially developed to resize font sizes (hence its
abbreviation for Responsive Font Sizes). Nowadays RFS is capable of rescaling most CSS properties with unit values
like margin, padding, border-radius, or even box-shadow.
6. RTL
</html>
1-Layout
1. Breakpoints
Breakpoints are customizable widths that determine how your responsive layout behaves
across device or viewport sizes in Bootstrap .
Available breakpoints
Bootstrap includes six default breakpoints, sometimes referred to as grid tiers, for building
responsively. These breakpoints can be customized if you’re using our source Sass files.
2. Containers
Containers are a fundamental building block of Bootstrap that contain, pad, and align
your content within a given device or viewport.
How they work
Containers are the most basic layout element in Bootstrap and are required when using our
default grid system. Containers are used to contain, pad, and (sometimes) center the content
within them. While containers can be nested, most layouts do not require a nested container.
The table below illustrates how each container’s max-width compares to the
original .container and .container-fluid across each breakpoint.
Default container
Our default .container class is a responsive, fixed-width container, meaning its max-width changes at each
breakpoint.
<div class="container">
<!-- Content here -->
</div>
Responsive containers
Responsive containers allow you to specify a class that is 100% wide until the specified breakpoint is
reached, after which we apply max-widths for each of the higher breakpoints. For example, .container-
sm is 100% wide to start until the sm breakpoint is reached, where it will scale up with md, lg, xl,
and xxl.
Fluid containers
Use .container-fluid for a full width container, spanning the entire width of the viewport.
<div class="container-fluid">
...
</div>
3. Grid system
Example
Bootstrap’s grid system uses a series of containers, rows, and columns to layout and align content.
It’s built with flexbox and is fully responsive. Below is an example and an in-depth explanation for
how the grid system comes together.
Grid options
Bootstrap’s grid system can adapt across all six default breakpoints, and any breakpoints you
customize. The six default grid tiers are as follows:
4. Columns
When building grid layouts, all content goes in columns. The hierarchy of Bootstrap’s grid
goes from container to row to column to your content. On rare occasions, you may combine
content and column, but be aware there can be unintended consequences.
Bootstrap includes predefined classes for creating fast, responsive layouts. With six
breakpoints and a dozen columns at each grid tier, we have dozens of classes already built
for you to create your desired layouts. This can be disabled via Sass if you wish.
Alignment
Use flexbox alignment utilities to vertically and horizontally align columns.
Vertical alignment
Change the vertical alignment with any of the responsive align-items-* classes.
5. Gutters
Gutters are the padding between your columns, used to responsively space and align content in the
Bootstrap grid system.
On this page
Horizontal gutters
.gx-* classes can be used to control the horizontal gutter widths. The .container or .container-fluid parent
may need to be adjusted if larger gutters are used too to avoid unwanted overflow, using a
matching padding utility. For example, in the following example we’ve increased the padding
with .px-4:
6. A
7. a