Friday 23 December 2016

HTML Attributes

HTML Attributes

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

The lang Attribute

The language of the document can be declared in the <html> tag.
The language is declared with the lang attribute.
Declaring a language is important for accessibility applications (screen readers) and search engines:
<!DOCTYPE html>
<html lang="en-US">
<body>

...

</body>
</html>


HTML Elements

HTML Elements

An HTML element usually consists of a start tag and end tag, with the content inserted in between:
<tagname>Content goes here...</tagname>
The HTML element is everything from the start tag to the end tag:
<p>My first paragraph.</p>



Nested HTML Elements

HTML Elements can be nested (elements can contain elements).
All HTML documents consist of nested HTML Elements
This example contains four HTML Elements.
<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

Thursday 2 June 2016

HTML TAGS

HTML Documents

All HTML documents must start with a type declaration: <!DOCTYPE html>.
The HTML document itself begins with <html> and ends with </html>.
The visible part of the HTML document is between <body> and </body>.

<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>




HTML Headings


HTML headings are defined with the <h1> to <h6> tags:


<h1>This is a heading</h1>

<h2>This is a heading</h2>
<h3>This is a heading</h3>




HTML Paragraphs

HTML paragraphs are defined with the <p> tag:

<p>This is a paragraph.</p>

<p>This is another paragraph.</p>



HTML Links

HTML links are defined with the <a> tag:

<a href="http://basiccomputerlanguage.blogspot.in/">This is a link</a>


HTML Images

HTML images are defined with the <img> tag.
The source file (src), alternative text (alt), and size (width and height) are provided as attributes:

<img src="j.png" alt="html" width="104" height="142">




Wednesday 27 January 2016

HTML Basic

HTML documents must start with a type declaration : <!DOCTYPE html>
The Html document itself begins with <html> and ends with </html>
The visible part of the HTML documents is between <body> and </body>

Example  :


<!DOCTYPE html>
<html>
<body>

<h1> Heading</h1>
<p> Paragraph.</p>

</body>
</html>


HTML Heading

Html headings are define with the <h1> to <h6> tags


Example  :

<!DOCTYPE html>
<html>
<body>

<h1> Heading1 </h1>
<h2> Heading2 </h2>
<h3> Heading3 </h3>
<h4> Heading4 </h4>
<h5> Heading5 </h5>
<h6> Heading6 </h6>

</body>
</html>

HTML Paragraphs

HTML paragraphs are defined with the <p> tag:

<!DOCTYPE html>
<html>
<body>

<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>

</body>
</html>

HTML Links

HTML links are defined with the <a> tag:


<!DOCTYPE html>
<html>
<body>

<a href="http://www.facebook.com">This is a link</a>

</body>
</html>

The link's destination is specified in the href attribute
Attributes are used to provide additional information about HTML elements.


HTML Images

HTML images are defined with the <img> tag.
The source file (src), alternative text (alt), and size (width and height) are provided as attributes :

<!DOCTYPE html>
<html>
<body>

<img src="facebook.jpg"  alt="facebook.com" width="104" height="142">

</body>

</html>

Tuesday 26 January 2016

HTML Introduction



  • HTML is a markup language for describing web documents.
  • HTML stands for Hyper Text Markup Language. 
  • A Markup language is a set of markup tags.
  • Each HTML tag describes different document content.


<!DOCTYPE.html>
<html>
<head>
<title> Page title </title>
</head>
<body>

<h1> Headline </h1>
<p> Paragraph </p>

</body>
</html>



  • The DOCTYPE declaration defines the document type to be HTML
  • The text between <html> and </html> describes an HTML document
  • The text between <head> and </head> provides information about the document
  • The text between <title> and </title> provides a title for the document
  • The text between <body> and </body> describes the visible page content
  • The text between <h1> and </h1> describes a heading
  • The text between <p> and </p> describes a paragraph.