1.Basic HTML & Html5
1.Basic HTML & Html5
the structure of a web page. It uses a special syntax or notation to organize and
give information about the page to the browser. Elements usually have opening
and closing tags that surround and give meaning to content
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
2) All HTML tags are written in lowercase, for example <p></p> and not <P></P>
------------------------------------------------------------------------------------------------------3)
Fill in the Blank with Placeholder Text
'Lorem ipsum text' has been used as placeholder text by typesetters since the
16th century , matlab temporarily paragraph mai ye paste kardenge fir aage jaake
actual para edit karenge.
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
5) The main HTML5 tag helps search engines and other developers find the main
content of your page.
------------------------------------------------------------------------------------------------------
(i) You can add images to your website by using the img element, and point to a
specific image's URL using the src attribute.
(ii) All img elements must have an alt attribute. The text inside an alt attribute is
used for screen readers to improve accessibility and is displayed if the image
fails to load.
When we hover over the image , the title will be displayed near the mouse
pointer
------------------------------------------------------------------------------------------------------
<style>
body{
or
background-repeat:no-repeat;
background-position:center;
height: Ypx //or else it wont be visible unless there is some content
</style>
https://www.w3schools.com/html/html_images_background.asp
To place the items , need to use position property (refer parallax react project)
------------------------------------------------------------------------------------------------------
You can use a (anchor) elements to link to content outside of your web page.
a elements need a destination web address called an href attribute. They also
need anchor text. Here's an example:
------------------------------------------------------------------------------------------------------
a (anchor) elements can also be used to create internal links to jump to different
sections within a webpage.
To create an internal link, you assign a link's href attribute to a hash symbol #
plus the value of the id attribute for the element that you want to internally link
to, usually further down the page. You then need to add the same id attribute to
the element you are linking to. An id is an attribute that uniquely describes an
element.
<a href="#contacts-header">Contacts</a>
...
<h2 id="contacts-header">Contacts</h2>
------------------------------------------------------------------------------------------------------
<p>
</p>
You must give your element an attribute of target and set it to _blank in order
for your link to open in a new tab (i.e. target="_blank")
------------------------------------------------------------------------------------------------------
Sometimes you want to add a elements to your website before you know where
they will link.Replace the href attribute value with a #, also known as a hash
symbol, to create a dead link
href="#"
------------------------------------------------------------------------------------------------------
<a href="#">
</a>
------------------------------------------------------------------------------------------------------
12)Bulleted/Unordered list
<ul>
<li>milk</li>
<li>cheese</li>
</ul>
------------------------------------------------------------------------------------------------------
13)Numbered/Ordered list
<ol>
<li>Garfield</li>
<li>Sylvester</li>
</ol>
------------------------------------------------------------------------------------------------------
input elements are a convenient way to get input from your user.
if you wanted to make a text input field required, you can just add the attribute
required within your input element, like this:
------------------------------------------------------------------------------------------------------
You can build web forms that actually submit data to a server using nothing more
than pure HTML. You can do this by specifying an action on your form element.
<form action="/open-this-link-when-submitted.php"></form>
Example -
· <Select> is drop-down menu.
Note - method="GET" vs POST . If you click on the register button to submit the
form and if you are using GET , then all the information of your input will be
shown in the url of that same page but if you use POST , that info will be
attached to the body of the page.
Note - "name" attribute helps to group similar elements like radio buttons.And
while submiting the form , the "name" attr will make a field of it's name given in
the backend. The "value" attr can be used to rename the submit button and
most importantly , it will give the value to that "name" attr in the
backend.Mandatory to use both of them.
------------------------------------------------------------------------------------------------------
All related radio buttons should have the same name attribute to create a radio
button group. By creating a radio group, selecting any single radio button will
automatically deselect the other buttons within the same group ensuring only one
answer is provided by the user.
<label>
Indoor
</label>
It is considered best practice to set a for attribute on the label element, with a
value that matches the value of the id attribute of the input element. This allows
assistive technologies to create a linked relationship between the label and the
child input element.
<label for="indoor">
Indoor
</label>
------------------------------------------------------------------------------------------------------
17)Create a Set of Checkboxes{ refer 18) }
Forms commonly use checkboxes for questions that may have more than one
answer.Checkboxes are a type of input.All related checkbox inputs should have
the same name attribute
<label for="loving">
Loving
</label>
------------------------------------------------------------------------------------------------------
<label for="indoor">
</label>
<label for="outdoor">
</label>
Here, you have two radio inputs. When the user submits the form with the
indoor option selected, the form data will include the line: indoor-
outdoor=indoor. This is from the name and value attributes of the "indoor"
input.
If you omit the value attribute, the submitted form data uses the default value,
which is on. In this scenario, if the user clicked the "indoor" option and
submitted the form, the resulting form data would be indoor-outdoor=on, which
is not useful. So the value attribute needs to be set to something to identify the
option.
------------------------------------------------------------------------------------------------------
You can set a checkbox or radio button to be checked by default using the
checked attribute.
------------------------------------------------------------------------------------------------------
The div element, also known as a division element, is a general purpose container
for other elements.The div element is probably the most commonly used HTML
element of all.Just like any other non-self-closing element, you can open a div
element with <div> and close it on another line with </div>.
------------------------------------------------------------------------------------------------------
At the top of your document, you need to tell the browser which version of HTML
your page is using.You tell the browser this information by adding the <!
DOCTYPE ...> tag on the first line, where the ... part is the version of HTML. For
HTML5, you use <!DOCTYPE html>
<!DOCTYPE html>
<html>
</html>
------------------------------------------------------------------------------------------------------
22)Define the Head and Body of an HTML Document
Any markup with information about your page would go into the head tag. Then
any markup with the content of the page (what displays for a user) would go into
the body tag.Metadata elements, such as link, meta, title, and style, typically go
inside the head element.
<!DOCTYPE html>
<html>
<head>
<title> </title>
</head>
<body>
</body>
</html>
Note - <head> it defines/holds what information is needed for the html file , it's
effect cant be seen visibly on the page like other elements.Example adding links
to an external css files , etc.
------------------------------------------------------------------------------------------------------
<br> = break
------------------------------------------------------------------------------------------------------
24)Text formatting
o/p -
------------------------------------------------------------------------------------------------------
25)To give a horizontal line
<hr>
-------------------------------------------------------------------------------------------------x-x-x-x-x-
x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
o/p -
----------------------------------------------------------
(x)section
----------------------------------------------------------
(xi)wbr
-----------------------------------------------------------------------------------------------
2)Form input types
http://html5doctor.com/html5-forms-input-types/
-----------------------------------------------------------------------------------------------
3)HTML Canvas
-----------------------------------------------------------------------------------------------
5)HTML audio
audio formats -
· mp3 : type = audio/mpeg
· ogg : type = audio/ogg
· wav : type = audio/wav
----------------------------------------------------------
· <audio controls loop> : will loop the audio after it ends
· <audio controls autoplay> : will play the audio as soon as the page loads
· <audio controls muted> : will mute the audio
-----------------------------------------------------------------------------------------------
6)HTML video
video formats -
· mp4 : type = video/mp4
· webm : type = video/webm
· ogg : type = video/ogg
----------------------------------------------------------
loop , muted , autoplay
-----------------------------------------------------------------------------------------------
Note - To embed youtube video to a site.
Step 1 - click on share button on the video
Step 2 - then click on embed
Step 3 - copy the <iframe> code to the html file