HTML: Audio Tag

The <audio>… </audio> tag defines sound, such as music or other audio streams.

Supported Format: mp3, wav, and ogg

AttributeValueDescription
autoplayautoplaySpecifies that the audio will start playing as soon as it is ready
controlscontrolsSpecifies that audio controls should be displayed (such as a play/pause button etc)
looploopSpecifies that the audio will start over again, every time it is finished
mutedmutedSpecifies that the audio output should be muted
preloadauto
metadata
none
Specifies if and how the author thinks the audio should be loaded when the page loads
srcURLSpecifies the URL of the audio file

preload

Tagged : / / /

HTML: Map tag

The <map>….</map> tag is used to define a client-side image-map. An image-map is an image with clickable areas.

The <map>…. </map> tag contains a number of <area> tags, that defines the clickable areas in the image map.

<map name=“mapname” id=“mapname”>……… </map>

Area Tag

The <area> tag defines an area inside an image-map. An image-map is an image with clickable areas.

The <area> element is always nested inside a <map>….</map> tag.

AttributeValueDescription
alttextSpecifies an alternate text for the area. Required if the href attribute is present
coordscoordinatesSpecifies the coordinates of the area
downloadfilenameSpecifies that the target will be downloaded when a user clicks on the hyperlink
hrefURLSpecifies the hyperlink target for the area
hreflanglanguage_codeSpecifies the language of the target URL
mediamedia querySpecifies what media/device the target URL is optimized for
shapedefault
rect
circle
poly
Specifies the shape of the area
target_blank
_parent
_self
_top
framename
Specifies where to open the target URL
typemedia_typeSpecifies the media type of the target URL
relalternate
author
bookmark
help
license
next
nofollow
noreferrer
prefetch
prev
search
tag
Specifies the relationship between the current document and the target URL

Coords attribute:

Tagged : / / / /

HTML: Image tag

The <img> tag is used to insert images on web pages.

AttributeValueDescription
srcURLSpecifies the URL of an image
alttextSpecifies an alternate text for an image
widthpixelsSpecifies the width of an image
heightpixelsSpecifies the height of an image
ismapismapSpecifies an image as a server-side image-map
usemap#mapnameSpecifies an image as a client-side image-map

src attribute

<img src=“car.jpg”>
<img src=“C:\image\dog.jpg”>

alt attribute

<img src=“car.jpg” alt=“car”>

// If the image is not to be open then its attribute message show in alt=”car”.

Width and height attribute

<img src=“car.jpg” alt=“car” width=“200” height=“100”>

ismap attribute

click coordinates are sent to the server.

Tagged : / / / / / / / / /

HTML: Sandbox

The restriction to the content such as disabling script or plugins is given by the internal frame.

An iframe with sandbox value as empty will have the following restrictions: –

  • Forms can not be submitted
  • Framed document cannot navigate its top level parent
  • Scripts are disabled
  • Stops frame content from using plugins
  • New windows(browsing contexts) cannot be created by the framed document
  • Framed content will be treated from an unique origin. Hence it will not have access to data stored in earlier cookies
  • Disable APIs
  • Automatically triggered features like auto playing videos etc are blocked

<iframe sandbox> </iframe>

Values

ValueDescription
(no value)Applies all restrictions
allow-formsRe-enables form submission
allow-pointer-lockRe-enables APIs
allow-popupsRe-enables popups
allow-same-originAllows the iframe content to be treated as being from the same origin
allow-scriptsRe-enables scripts
allow-top-navigationAllows the iframe content to navigate its top-level browsing context

allow-same-origin

A web page can have access to a second web page only if both have the same origin.

Uniform Resource Identifier (URI), Port Number, and HostName

Same-origin

  • https://www.google.com/p/contact-us.html
  • https://www.google.com/p/about-us.html

Different Port So Not in the Same Origin

  • https://www.google.com:82/p/contact-us.html
  • https://www.google.com/p/about-us.html

Different Host So Not in the Same Origin

  • https://en.www.google.com/p/contact-us.html
  • https://www.google.com/p/contact-us.html

allow-top-navigation

Top navigation allows us to open the linked document in the full body of the window or the top browsing context.

AttributeValueDescription
target_blank _parent _top framename _selfOpens the linked document in a new window or tab Opens the linked document in the parent frame Opens the linked document in the full body of the window Opens the linked document in a named frame Opens the linked document in the same frame as it was clicked (this is the default)
Tagged : / / /

HTML: Anchor Tag

We can create hyperlinks using the anchor tag.

What is a Hyperlink?

A hyperlink is a link between web pages and it is used to connect one web page to another.

Ex:- <a href=”https://www.google.com”>Visit Google </a>

Anchor Tag Attributes

AttributeValueDescription
hrefURL referenceSpecifies the URL as a destination web page or a different section of the web page
downloadfilenameSpecifies that the target will be downloaded when a user clicks on the hyperlink
mediamedia_querySpecifies what media/device the linked document is optimized for
hreflanglanguage_codeSpecifies the language of the linked document
typemedia_typeSpecifies the media type of the linked document

Anchor Tag Attributes

AttributeValueDescription
target_blank _parent _top framename _selfOpens the linked document in a new window or tab Opens the linked document in the parent frame Opens the linked document in the full body of the window Opens the linked document in a named frame Opens the linked document in the same frame as it was clicked (this is the default)

Ex:- <a href=”https://www.google.com”target=”_blank”>Visit Google </a>

Anchor Tag Attributes

href Attribute

Syntax: – <a href=“URL”>

  • An absolute URL – points to another web site. Ex: – href=”http://www.google.com”
  • A relative URL – points to a file within a web site. Ex:- href=“page1.html”
  • Link to an element with a specified id within the page. Ex: –  href=”#bottom”
  • Other protocols. Ex:- https://, ftp://, mailto:, file:, etc..
  • A script. Ex:- href=‘javascript:alert(“Hello”);’

Download Attribute

The download attribute specifies that the target will be downloaded when a user clicks on the hyperlink.

Ex:- <a href=”image/example.jpg”download=”nature”>

Media Attribute

The media attribute specifies what media/device the linked document is optimized for.

This attribute is used to specify that the target URL is designed for special devices (like iPhone and Android etc), speech, or print media.

ValueDescription
widthSpecifies the width of the targeted display area.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (min-width:500px)”
heightSpecifies the height of the targeted display area.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (max-height:700px)”
device-widthSpecifies the width of the target display/paper.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (device-width:500px)”
device-heightSpecifies the height of the target display/paper.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (device-height:500px)”
orientationSpecifies the orientation of the target display/paper.
Possible values: “portrait” or “landscape”
Example: media=”all and (orientation: landscape)”
ValueDescription
aspect-ratioSpecifies the width/height ratio of the targeted display area.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (aspect-ratio:16/9)”
device-aspect-ratioSpecifies the device-width/device-height ratio of the target display/paper.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (aspect-ratio:16/9)”
colorSpecifies the bits per color of the target display.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (color:3)”
color-indexSpecifies the number of colors the target display can handle.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (min-color-index:256)”
monochromeSpecifies the bits per pixel in a monochrome frame buffer.
“min-” and “max-” prefixes can be used.
Example: media=”screen and (monochrome:2)”
ValueDescription
resolutionSpecifies the pixel density (dpi or dpcm) of the target display/paper.
“min-” and “max-” prefixes can be used.
Example: media=”print and (resolution:300dpi)”
scanSpecifies scanning method of a tv display.
Possible values are “progressive” and “interlace”.
Example: media=”tv and (scan:interlace)”
gridSpecifies if the output device is grid or bitmap.
Possible values are “1” for the grid, and “0” otherwise.
Example: media=”handheld and (grid:1)”
ValueDescription
allDefault. Suitable for all devices
auralSpeech synthesizers
brailleBraille feedback devices
handheldHandheld devices (small screen, limited bandwidth)
projectionProjectors
printPrint preview mode/printed pages
screenComputer screens
ttyTeletypes and similar media using a fixed-pitch character grid
tvTelevision type devices (low resolution, limited scroll ability)
  • And
  • Not
  • ,(OR)

Ex:- media=”print and (resolution:300dpi)”>

hreflang Attribute

Type Attribute

http://www.iana.org/assignments/media-types/media-types.xhtml

rel Attribute

ValueDescription
alternateLinks to an alternate version of the document (i.e. print page, translated or mirror)
authorLinks to the author of the document
bookmarkPermanent URL used for bookmarking
helpLinks to a help document
licenseLinks to copyright information for the document
nextThe next document in a selection
nofollowLinks to an unendorsed document, like a paid link.
(“nofollow” is used by Google, to specify that the Google search spider should not follow that link)
noreferrerSpecifies that the browser should not send a HTTP referer header if the user follows the hyperlink
prefetchSpecifies that the target document should be cached
prevThe previous document in a selection
searchLinks to a search tool for the document
tagA tag (keyword) for the current document

Link Color

By default, links will appear as follows in all browsers:

An unvisited link is underlined and blue

A visited link is underlined and purple

An active link is underlined and red

link – specifies the color of the hyperlink that has not been visited or clicked
  before on a webpage

vlink – specifies the color of hyperlink that has been visited before on a web page

alink – specifies the color of currently active links

Tagged : / / / / / / / / / / / / / /

HTML: Table create

  • <table> ……….. </table> tags represents an HTML table.
  • <th> …………. </th> tags is used to add a column heading in a column.
  • <tr> …………. </tr> tags represents a row in the table.
  • <td> ……….. </td> tags are used to add data value in the column.

NameRoll Result
Rakesh01pass
Sushant 02pass
Suraj03pass
Tagged : / / / / /

HTML: Definition List

A definition list is a list of terms, with a definition of each term.

We can create definition list by using the <dl> ………. </dl> with <dt> and <dd> tag.

The <dt> …….. </dt> tag is used to define the term; whrereas, the <dd> tag is used to give the term’s definition.

<dl>
	<dt>College</dt>
	<dd>A boring place</dd>
	<dt>School</dt>
	<dd>Learn as much as you can</dd>
	<dt>University</dt>
	<dd>for fun</dd>
</dl>
Tagged : / / / / / / /

HTML: Ordered List

An ordered list displays a list of items using numbers or letters in either ascending or descending order.

The <ol> ………. </ol> tag is used to define an ordered list ; whereas the <li> ….. </li> tag is used to define the items of list.

Ex:-

<ol>
	<li>Linux</li>
	<li>Windows</li>
	<li>Mac</li>
	<li>Android</li>
</ol>
AttributeValue
Type1, A, a, I, i
StartAny numeric value
ReversedReversed
<ol type=1>
	<li>Linux</li>
	<li>Windows</li>
	<li>Mac</li>
	<li>Android</li>
</ol>
Tagged : / / / / / /

HTML: Unordered List

An unordered list is used to create a bulleted list of items.

The <ul> …………….. </ul> tag is used to define an unordered list; whereas, the <li> ……… </li> tag is used to define the items of the list.

Ex:-

<ul>
	<li>Linux</li>
	<li>Windows</li>
	<li>Mac</li>
	<li>Android</li>
</ul>
  • Linux
  • Windows
  • Mac
  • Android
Tagged : / / / / / /