html_Presentation1
html_Presentation1
NEW HTML
TA G A N D
AT T R I B U T E
P R E S E N T E D BY:
P I N K I PAT E L
H T M L < P I C T U R E > TA G
• The <picture> tag gives web developers more flexibility in specifying image resources.
• The most common use of the <picture> element will be for art direction in responsive
designs. Instead of having one image that is scaled up or down based on the viewport
width, multiple images can be designed to more nicely fill the browser viewport.
• The <picture> element contains two tags: one or more <source> tags and one <img>
tag.
• The browser will look for the first <source> element where the media query matches the
current viewport width, and then it will display the proper image (specified in the srcset
attribute). The <img> element is required as the last child of the <picture> element, as
a fallback option if none of the source tags matches.
EXAMPLE
<picture>
<source media="(min-width:650px)" srcset="img_pink_flowers.jpg">
<source media="(min-width:465px)" srcset="img_white_flower.jpg">
<img src="img_orange_flowers.jpg" alt="Flowers" style="width:auto;">
</picture>
H T M L < M E T E R > TA G
• The <meter> tag defines a scalar measurement within a known range, or a
fractional value. This is also known as a gauge.( to make a judgement or to
calculate something by guessing)
• Examples: Disk usage, voting population, temperature, web traffic the relevance of
a query result, etc.
• Tip: Always add the <label> tag for best accessibility practices!
• Attributes - form , high, low, max, min, optimum,value
• Note: The <meter> tag should not be used to indicate progress (as in a progress
bar). For progress bars, use the <progress> tag.
EXAMPLE
• The time element is used to tell a browser that the associated text is time-related. In-and-of itself, that
doesn’t do a lot for users or browsers, although it may be a help to users of some assistive technologies.
The time element isn’t particularly useful until paired with a datetime attribute. One a datetime attribute
has been associated with the time element, the browser knows a lot more about the time
described in the time element and can use that information when interacting with other applications —
such as when importing information from an HTML email or webpage into a calendar application.
• The datetime attribute can be used to identify a year, a month and year, a specific date, a date and time, a
time without a date, and durations of time.
EXAMPLE
<p>
Meet me at <time>11:59</time> at the dock.
</p>
<p>Open from <time>10:00</time> to <time>21:00</time> every weekday.</p>
<p>
Last updated
<time datetime="2015-11-03">
November 3rd 2015
</time>.
</p>
H T M L < M A P > TA G
https://www.image-map.net/
EXAMPLE
<img src="workplace.jpg" alt="Workplace" usemap="#workmap" width="400" height="379">
<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm"
target="_blank">
<area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm"
target="_blank">
<area shape="circle" coords="337,300,44" alt="Cup of coffee" href="coffee.htm"
target="_blank">
</map>
H T M L D ATA - * AT T R I B U T E S
• The data-* attributes is used to store custom data private to the page or application.
• The data-* attributes gives us the ability to embed custom data attributes on all HTML
elements.
• The stored (custom) data can then be used in the page's JavaScript to create a more
engaging user experience (without any Ajax calls or server-side database queries).
• The data-* attributes consist of two parts:
• The attribute name should not contain any uppercase letters, and must be at least one
character long after the prefix "data-"
• The attribute value can be any string
• Note: Custom attributes prefixed with "data-" will be completely ignored by the user agent.
EXAMPLE
<ul>
<li onclick="showDetails(this)" id="owl" data-animal-type="bird">Owl</li>
<li onclick="showDetails(this)" id="salmon" data-animal-type="fish">Salmon</li>
<li onclick="showDetails(this)" id="tarantula" data-animal-type="spider">Tarantula</li>
</ul>
<script>
function showDetails(animal) {
var animalType = animal.getAttribute("data-animal-type");
alert("The " + animal.innerHTML + " is a " + animalType + ".");
}
</script>
H T M L H I D D E N AT T R I B U T E
• The pattern attribute specifies a regular expression that the <input> element's value
is checked against.
• Note: The pattern attribute works with the following input types: text, date, search,
url, tel, email, and password.
• Tip: Use the global title attribute to describe the pattern to help the user.
</ol>
HTML
< A > D O W N L O A D AT T R I B U T E
• The download attribute specifies that the target (the file specified in
the href attribute) will be downloaded when a user clicks on the hyperlink.
• The optional value of the download attribute will be the new name of the file
after it is downloaded. There are no restrictions on allowed values, and the
browser will automatically detect the correct file extension and add it to the
file (.img, .pdf, .txt, .html, etc.).
• If the value is omitted, the original filename is used.
• Example: https://www.w3schools.com/tags/tryit.asp?
filename=tryhtml5_a_download
EXAMPLE
<h1>The a download attribute</h1>