Auto AdSense

Saturday, 30 January 2016

Jump to another part of a document (on the same page) - HTML Programs

<html>
<body>
<p>
<a href="#C4">See also Chapter 4.</a>
</p>

<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>

<h2><a id="C4">Chapter 4</a></h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 5</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 6</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 7</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 8</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 9</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 10</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 11</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 12</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 13</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 14</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 15</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 16</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 17</h2>
<p>This chapter explains ba bla bla</p>

</body>
</html>

Output

See also Chapter 4.

Chapter 1

This chapter explains ba bla bla

Chapter 2

This chapter explains ba bla bla

Chapter 3

This chapter explains ba bla bla

Chapter 4

This chapter explains ba bla bla

Chapter 5

This chapter explains ba bla bla

Chapter 6

This chapter explains ba bla bla

Chapter 7

This chapter explains ba bla bla

Chapter 8

This chapter explains ba bla bla

Chapter 9

This chapter explains ba bla bla

Chapter 10

This chapter explains ba bla bla

Chapter 11

This chapter explains ba bla bla

Chapter 12

This chapter explains ba bla bla

Chapter 13

This chapter explains ba bla bla

Chapter 14

This chapter explains ba bla bla

Chapter 15

This chapter explains ba bla bla

Chapter 16

This chapter explains ba bla bla

Chapter 17

This chapter explains ba bla bla

Open link in a new browser window - HTML Programs

<html>
<body>

<a href="http://www.google.com" target="_blank">Visit Google.com!</a> 

<p>If you set the target attribute to "_blank", the link will open in a new browser window/tab.</p>

</body>
</html>

Output

Visit Google.com!
If you set the target attribute to "_blank", the link will open in a new browser window/tab.

How to create hyperlinks - HTML Programs

<html>
<body>
<p>
<a href="http://www.google.com/">HTML Tutorial</a> This is a link to a page on this website.
</p>

<p>
<a href="http://www.google.com/">Google</a> This is a link to a website on the World Wide Web.
</p>

</body>
</html>

Output

HTML Tutorial This is a link to a page on this website.
Google This is a link to a website on the World Wide Web.

Make a hyperlink of an image - HTML Programs

<html>
<body>

<p>Create a link of an image:
<a href="http://www.google.com/">
<img src="smiley.gif" alt="HTML tutorial" width="32" height="32"></a></p>

<p>No border around the image, but still a link:
<a href="http://www.google.com/">
<img border="0" src="smiley.gif" alt="HTML tutorial" width="32" height="32"></a></p>

</body>
</html>

Output


Create a link of an image: HTML tutorial
No border around the image, but still a link: HTML tutorial

Note: Due to inclusion of code to blogpost, images not able to display. But the code will work properly

Tuesday, 17 November 2015

Let the image float to the left/right of a paragraph - HTML Programs

<html>
<body>

<p>
<img src="smiley.gif" alt="Smiley face" style="float:left" width="32" height="32"> A paragraph with an image. The image will float to the left of this text.
</p>

<p>
<img src="smiley.gif" alt="Smiley face" style="float:right" width="32" height="32"> A paragraph with an image. The image will float to the right of this text.
</p>

<p><b>Note:</b> Here we have used the CSS "float" property to align the image; as the align attribute is deprecated in HTML 4, and is not supported in HTML5.</p>

</body>
</html>

Output


Smiley face A paragraph with an image. The image will float to the left of this text.
Smiley face A paragraph with an image. The image will float to the right of this text.
Note: Here we have used the CSS "float" property to align the image; as the align attribute is deprecated in HTML 4, and is not supported in HTML5.

Note: Due to inclusion of code to blogpost, images not able to display. But the code will work properly