Showing posts with label Html attributes. Show all posts
Showing posts with label Html attributes. Show all posts

Tuesday, December 25, 2018

Attributes Description.

Attributes Description:-


  • ALT :- Specifies an alternative text for an image, when the image cannot be displayed.
  • DISABLED :- Specifies that an input element should be disabled.
  • HREF :- Specifies the URL (web address) for a link.
  • ID :- Specifies a unique id for an element.
  • SRC :- Specifies the URL (web address) for an image.
  • STYLE :- Specifies an inline CSS style for an element.
  • TITLE :- Specifies extra information about an element (displayed as a tool tip).

Non quotes

ATTRIBUTE WITHOUT QUOTES:-

<html>
<body>

<a href=https://www.google.com>This is a link</a>

</body>
</html>

OUTPUT:-

Alt attribute

The alt Attribute:-

<html>
<body>

<h2>Alt Attribute</h2>
<p>Alt attribute should reflect the image content, so users who cannot see the image gets an understanding of what the image contains:</p>

<img src="imgtag.jpg" alt="Tag with image" width="200" height="300">

</body>
</html>

OUTPUT:-

  • Alt attribute should reflect the image content
  • users who cannot see the image gets an understanding of what the image contains

Size attributes

THE WIDTH AND HEIGHT ATTRIBUTE:-

<html>
<body>

<h2>Size Attributes</h2>
<p>Images in HTML have a set of size attributes, which specifies the width and height of the image:</p>

<img src="imgtab.jpg" width="200" height="300">

</body>
</html>

OUTPUT:-


  • The image size is specified in pixels: width="200" means 200 pixels wide.

Href attribute

HTML HREF ATTRIBUTE:-

<html>
<body>

<h2>Href Attribute</h2>
<p>HTML links are defined with the a tag. The link address is specified in the href attribute:</p>

<a href="https://www.google.com">This is a link</a>

</body>
</html>

OUTPUT:-


  • HTML links are defined with the a tag.
  • The link address is specified in the href attribute.

Title attribute

HTML TITLE ATTRIBUTE:-

<html>
<body>

<h2 title="Is a header">The title Attribute</h2>

<p title="Is a tooltip">
Mouse over this paragraph, to display the title attribute as a tooltip.
</p>

</body>
</html>

OUTPUT:-



  • All HTML elements can have attributes.
  • Attributes give us additional information about an element.
  • Attributes are always specified in the start tag.
  • Attributes usually come in name/value pairs like: name="value".



  • Internal Javascripts

    Internal Javascripts :    The script code can be written directly into the HTML document. script code is placed in header of the docume...