Front End Web Technologies_HTML
Front End Web Technologies_HTML
HTML
By Prerna Solanke
Introduction
Three languages define front-end web development —
HTML, CSS, and JavaScript.
Syntax:
<a href = "..url...."> Link Text </a>
<a href="#top">Go to Top</a>
Example 1:
<body>
<a href="https://www.w3schools.com">Visit W3Schools.com!</a>
</body>
Example 2:
<body>
<center>
<img src =
"https://www.mistay.in/travel-blog/content/images/2020/07/mayani.jpg"
height = "400" width = "500" />
<footer> <a
href="https://www.mistay.in/travel-blog/top-10-bird-sanctuaries-in-mumb
ai-for-nature-lovers/"> Bird Sactuary </a> </footer>
</center>
</body>
Example 2: output
Example 3:
<p>To create a link that opens in the user's email program (to let
them send a new email): </p>
<p>
<a href="mailto:[email protected]">Send email</a>
</p>
Audio and Video tag in HTML5
● Earlier, native web technologies such as HTML didn't allow
embedding video and audio on the Web.
● Later, HTML5 specification introduced such features with the
<video> and <audio> elements.
● The <audio> element is used to embed audio files to a web
page, and the <video> element is used to embed a video.
<audio> tag in HTML5
● The <audio> tag is used to embed an audio file on a web page.
● The src attribute specifies the location of the audio file.
● The controls attributes used to specify the audio file to be
played, the volume, and the playback rate.
● It may contain multiple <source> tags to specify multiple
audio formats.
<audio>
<source src="music.mp3" type="audio/mp3">
</audio>
Attributes:
autoplay
Makes the audio or video start playing right away, while the rest
of the page is loading.
loop
Makes the video (or audio) start playing again whenever it
finishes.
preload
Used for buffering large files; it can take one of three values:
● "none" does not buffer the file
● "auto" buffers the media file
● "metadata" buffers only the metadata for the file
<audio> tag example
<head>
<title>Jingle Bells</title>
</head>
<body>
<audio controls>
<source src="C:\Users\91983\OneDrive\Desktop\Jingle-Bells.mp3"
type="audio/mpeg">
</audio>
<p>Click the play button</p>
</body>
<audio> tag example
<video> tag in HTML5
● The <video> tag is used to embed a media player that supports
video playback on a web page.
● The src attribute specifies the location of the video file.
● The controls attributes used to specify the video file to have
controls like play, pause, stop, volume, etc.
● It may contain multiple <source> tags to specify multiple video
formats
<video>
<source src="video-path.mp4" type="video/mp4">
</video>
<video> tag example
<body>
<video width="400" height="300" controls>
<source src="animal.mp4" type="video/mp4">
</video>
</body>
<video> tag example
<video> tag
The poster Attribute is used to display the image while video
downloading or when user click the play button.
If this image not set then it will take the first frame of video as a
poster image.
Syntax:
<video poster="URL">
<canvas> tag
<form>
The input elements goes here
</form>
<form> tag
Two attributes to be used with the form tag are:
● The action attribute points to the back-end of our web page,
which handles the form submission
● The method attribute is used to upload the data. The most
commonly used attributes are the GET and POST methods.
<form >
--------
</form>
<form> tag: The <input> Element
An <input> element can be displayed in many ways, depending on
the type attribute. Here are some examples:
<form> tag: The <label> Element
The <label> element defines a label for several form elements.
Example:
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname">
Label
<form> tag:
<form> tag: The <select> Element
<select> element defines a drop-down list:
Example:
Example:
<textarea name="message" rows="10" cols="30">
The cat was playing in the garden.
</textarea>
<form> tag: The <fieldset> and <legend> Elements
The <fieldset> element is used to group related data in a form.
The <legend> element defines a caption for the <fieldset>
element.
<form> tag: The <button > Element
The <button> element defines a clickable button.
Example:
<!DOCTYPE html>
<body>
<h2>The button Element</h2>
<button type="button" onclick="alert('Hello!')">Click Me!</button>
</body>
</html>
<iframe> tag
The <iframe> tag can appear anywhere in your document.
The <iframe> tag defines a rectangular region within the
document in which the browser can display a separate document
or file.
We can include external html file in your document using iframe
tag.
Example:
<iframe src="file.html" width="300" height="200">
</iframe>
<iframe> tag
<!DOCTYPE html>
<body>
<h2>iframes Example</h2>
<p>Use the height and width attributes
to specify the size of the iframe:</p>
<iframe src="f1.HTML"
height="400"
width="400"></iframe>
</body>
</html>