What Is HTML
What Is HTML
<h1> <h1>
<div>Hello world</div> <div>Hello world</h1>
</h1> </div>
what is Html ? 1
The DOCTYPE declaration tells the modern browsers that this document is
interpreted in html5 language.
The <html> element is know as the root element since all the elements are
withing this element and most probably it is not within other tags.
The <head> is the tag that contains the links to css and scripts this area also
contains the meta data.
Meta data is the information about the document here it describes the
character
set of the document, meta data can also contain the data such as author
information publishing status and the information that can be used by the
search
engine.
In the head element the main element is the title element it is said that every
html document must contain a title element
the body element contains everything that you want to show up in the
browser.
what is Html ? 2
Every content in html starts with opening tag and ends with closing tag expect
in some case.
Every html can have pre-defined Attributes. Every Attribute must be written in
opening tag.
my id no - Attribute value
Content Models
There are two types of elements in content Models. They are-
<!DOCTYPE html>
<html>
<head>
<title>my first program</title>
</head>
<body>
<div>
hello everyone this me
</div>
<span>welcome to my channel</span>
what is Html ? 3
<div>your famous actor<span> the natural star</span>
</div>
</body>
</html>
Types of contents
HTML5
3.2.5 Content models Each element defined in this specification
has a content model: a description of the element's expected
contents. An HTML element must have contents that match the
https://www.w3.org/TR/2011/WD-html5-20110525/content-
models.html
Ex: <H1></H1>
<H2><H2>
<section></section>
what is Html ? 4
These are software's that are used to validate the html code they usually check for
the following
If you do not include the doctype in the code it does not know the html version
it
should validate the document.
Non-standard elements
Mismatched tags
Nesting errors
HTML Tags
HTML Lists Tags
Unordered list-
<ul style="list-style-type:square">
<li>science</li>
<ul>
<li>biology</li>
<li>chemistry</li>
<li>physics</li>
</ul>
<li>math</li>
<li>social<li>
<li>kannada</li>
<li>Hindi</li>
</ul>
ordered list-
what is Html ? 5
<ol>
<li>science</li>
<ol>
<li>biology</li>
<li>chemistry</li>
<li>physics</li>
</ol>
<li>math</li>
<li>social<li>
<li>kannada</li>
<li>Hindi</li>
</ol>
Description Lists-
<dl>..</dl>
<dt>..</dt>
3.A value, such as a description or definition
<dd>…</dd>
what is Html ? 6
Heading tag
It is an block element
Horizontal Rule
Also known as thematic break, these indicate the end of a topic, paragraph or a
page
without introducing a new heading in older HTML versions it was rendered as a 3d
shaded line but with html5 it adds a semantic meaning and as mentioned several
times if all you wanted was a decorative line then use css to make it
what is Html ? 7
the
blockquotes tag.
<blockquote>
<p>Our alphabet hasn't changed in eons; there isn't much lati
tude in
what a designer can do with the individual letters.</p>
<p>Much like a piece of classical music, the score is written
down. It's not something that is tampered with, and yet, each
conductor interprets that score differently. There is tension
in
the
</blockquote>
Preformatted text
Sometimes when you are using code examples or writing a poem in your site then
white spaces are semantically significant then you can use the <pre> element to
print the text as it is typed the white spaces and carriage returns in the pre are not
ignored.
The content withing figure element must be self contained it means if the
figure is removed from the main content even then the main content and the
figure should still make sense
If you want to provide a text caption to the image then you can use the
figcaption tag.
<figure>
<pre>
what is Html ? 8
ccode>
body {
background-color :
color: red;
</code>
</pre>
#000 ;
<figcaption>Samp1e CSS rule.</figcaption>
</figure>
The content in the main element must be unique to that page it should not
contain the elements that are shared between pages.
A page should contain only one main and it should not nest within article,
aside, header, footer, nav.
When using it in an individual article it might contain this like author name
published date etc...
The footer may be for the whole body or just a particular section such as
section, aside, article etc..
what is Html ? 9
Section tag <section></section>
Long documents are easier to maintain when they are divided into smaller
sections for example books are divided into several chapters and a
newspaper is divided into several sections such as local news, sports news
etc..
The section tag is an aptly named and is used to group elements that have
something in common.
what is Html ? 10
• It is a generic block level element, if the content you have cannot be defined
using any available block level elements then you can use div tag and use the
class and id attributes to name them.
So developers can add attributes like roles, state and properties, dev can add
it to
give richer semantic information.
role attribute
This is used to define the element more precisely it acts as a landmark.
what is Html ? 11
what is Html ? 12
Links
Anchor tag <a></a>
• Linking is the most important thing in the internet after-all liking is what makes
the
web.
• To make any text a link we enclose it within <a></a> tags.
• href attribute is used to provide the url to the target website
Types of links
I. Absolute links
2 Relative links
•
Absolute links are used when you url points to another site that is not in your
server it contains the protocol and also the pathname.
•
Relative links this is used when the files are within your server it only contains
the path name and there is no need for the protocol
.) when using relative links you can use two types relative and root relative
.) In relative .Jings.jpg the directory is specified with respect to the current
directory.
.) In root relative /ings.img the directory is specified with respect to the root
directory.
what is Html ? 13
This is used to specify where the new link is opened whether it is in the new
tab or new window.
You can name target anything without the _ for example: target="display".
You can reuse the same display window to open other urls.
The Mailto
• You can use the mailto: to specify mails when clicked it will take you to your
default mailing app.
• But be aware that spam bots can use this to send spam mails to avoid this you
can use java script {research on this for more info}
• ex: <a href=”mailto: ………”</a>
The Tel
• This is used to give the functionality when clicked this take you to the dial-pad to
make a call.
• Make sure you include the international code in the ph number ex +91
• Some times android and ios devices detect a string of IO numbers as a ph
number and make them a link to make sure this wont happen you can use the
following.
Images
There are two type of images
o the ones that are part of the content these are added in html.
o the ones used for decoration purpose these are added in css.
servers usually have a mime type for each file extension of an image when a
image is requested the server mime data to the browser to the browser so that
what is Html ? 14
the browser can interpret the type of image being received and use a helper
application if required.
It is called a replaced element unlike other elements the content is not there it
is replaced by other file.
It is an inline element.
Never forget to use eat attribute It provides text Info about the image It is used
by screen readers and some times when the image is not loaded the text
might be displayed if the image does not mean anything to the content then
you should keep the value of alt null it is done by add nothing between the
double quotes.
ex: alt=""
what is Html ? 15
scr provides locations of the image(url).
SVG does not loss their clarity because they are made up of shapes and path
that are defined mathematically.
HTML as elements like <p>, <figure> etc, Similarly SVG as elements such as
rectangle (rect), circle (circle), paths (path).
what is Html ? 16