Monday , February 18 2019
Home / Web Development / HTML Basic Examples

HTML Basic Examples

HTML Basic Examples

Hi Guys! Hope so you are fine.
Now we go on next step
Don’t worry if these examples use tags you have not learned.

You will learn about them in the upcoming Posts.


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

The links represent is specified in the(Hyperlink Reference) href attribute.

Attributes are used to provide additional information about HTML5 elements or webpage.

What is HTML Images

HTML images are defined with the tag of <img> tag.

The source file (src), alternative text (alt), width, and height are provided as attributes:

Example

<img src="Codeneat.jpg" alt="http://www.codeneat.com" width="105" height="140">

What is HTML Elements

An HTML element usually consists of a starting tag and ending tag, with the content inserted  between them:

<tagname>Write your content here</tagname>

The HTML element is everything from the start tag to the end tag og the page:

<p>My 1st paragraph.</p>

What is Nested HTML Elements

HTML elements can be nested (elements can contain elements or Element within an Element is called nested element).

Every HTML document consist of nested HTML elements.

This example shows 4 HTML elements:

Example

<!DOCTYPE html>
<html>
<head><title>Example Html</title></head>
<body><h1>My 1st Heading</h1>
<p>My Sample  paragraph.</p></body>
</html>

 

Explaination of Example

The <html> element identify  that HTML based  document .

It must be  start  with tag <html> and  end tag </html>.

The element content is another HTML element (the <body> element where we can write content ).

<html>

<body>

<h1>My st Heading</h1>
<p>My Sample paragraph.</p>

</body>
</html>

HTML Attributes

  1. Every HTML elements can have attributes
  2. Attributes provide additional information about the element
  3. Attributes are always represented in the start tag
  4. Attributes mostly come in name/value pairs like: name=”value”

The href Attribute

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

Example

<a href=”http://www.codeneat.com”>This is a link</a>

The src Attribute

HTML images are defined with  <img> tag which is specified for image .

The filename of the image source is specified with  src attribute:

Example

<img src=”img_boy.jpg”>

What is the width and height Attributes

Images in HTML having  set of size attributes, which specifies the width and height of the image tag:

Example

<img src=”img_boy.jpg” width=”400″ height=”500″>

The image size is specified in pixels: width=”400″ means 400 pixels wide.

What is alt Attribute

The alt attribute specifies the alternative text which is to be used when the image cannot be displayed on the screen.

The value of the attributes can be read by the screen reader or user of the site.

Example

<img src=”img_boy.jpg” alt=”Boy with a jacket”>

Did you Missed Recent Article! So click Here : Basic Syntax and First Webpage HTML5

 

Check Also

PHP Tutorials List

PHP Tutorials List In this course, you’ll explore the basic structure of PHP Scripting Language. …