One of the most useful attributes is the align attribute. As you can see the code as follow
<html>
<head>
<title>Title of the page</title>
</head>
<body>
<h1 align=left>Heading aligned in the left </h1>
<h1 align=center>Heading aligned in the center</h1>
<h1 align=right>Heading aligned in the right</h1>
</body>
</html>
Output:
Heading aligned in the left
Heading aligned in the center
Heading aligned in the right
Below are other tags you can use in HTML:
<head>
<title>Title of the page</title>
</head>
<body>
<h1 align=left>Heading aligned in the left </h1>
<h1 align=center>Heading aligned in the center</h1>
<h1 align=right>Heading aligned in the right</h1>
</body>
</html>
Output:
Heading aligned in the left
Heading aligned in the center
Heading aligned in the right
Below are other tags you can use in HTML:
Text Formatting Tags
| Tag | Description |
| <b> | Defines bold text |
| <big> | Defines big text |
| <em> | Defines emphasized text |
| <i> | Defines italic text |
| <small> | Defines small text |
| <strong> <sub> | Defines strong text Defines subscripted text |
| <sup> | Defines superscripted text |
| <ins> | Defines inserted text |
| <del> | Defines deleted text |
| <tt> | Defines mono spaced text |
| <u> | Defines underlined text |
| <strike> | Defines strike-through text |
| <s> | Defines strike-through text |
Logical Text Formatting Tags
| Tag | Description |
| <h1> | Heading |
| <p> | Paragraph |
| <br> | Break |
| <center> | Center |
| <div> | Division |
| <blouquote> <address> | Blouquote Address |
| <pre> | Preformatted |
| <hr> | Horizontal Rule |
Citation, Quotation, and Definition Tags
| Tag | Description |
| <abbr> | Defines an abbreviation |
| <p> | Defines an acronym |
| <br> | Defines an address elements |
| <center> | Defines the text direction |
Other Tags
an anchor may point to any resource on the Web: an HTML page, an image, a sound file, a movie. Etc., This uses the <a> tag and creates a link to another document. The “href” is the attribute that may be used in the <a> tag making it a <a href>. This addresses the document to link to:
Example: Create this new file by typing the following code:
<html>
<head>
<title>Title of the page</title>
</head>
<body>
<b> hello world! </b>
<br>
<a href=second.htm>Click here</a>
</body>
</html>
Save this as first.htm. Open a new file again and type the following:
<html>
<head>
<title>Title of the page</title>
</head>
<body>
<b>Hello World!</b>
<br>
<a href=first.htm> Click here</a>
</body>
</html>
Save this as second.htm. Now view first.htm using the web browser and click the link. See what happens.
The target attribute may define where the linked document will be opened. The code below will show that the link will open a new-window. Edit first.htm, then instead of using href, use the target attribute.
<html>
<head>
<title>Title of the page</title>
</head>
<body>
<b>Hello World!</b>
<br>
<a href=second.htm target=”_blank”> visit my second homepage</a>
</body>
</html>
Save it as first.htm then view it using your web browser
An unordered list is a list of items that are marked with bullets. It starts with the <ul> tag and each list item starts with the <li> tag.
<ul><b>My Favorites Movies</b>
<li>Sweet November</li>
<li>Before Sunset</li>
<li>Love Actually</li>
<li>Image You and Me</li>
<ul>
<ul><b>My Favorites Movies</b>
<li>Sweet November</li>
<li>Before Sunset</li>
<li>Love Actually</li>
<li>Image You and Me</li>
<ul>
Here as an output:
My Favorite Movies
My Favorite Movies
· Sweet November
· Before Sunset
· Love Actually
· Imagine You and Me
An ordered list is a list items that are marked with numbers. It starts with the <ol> and each list item starts with the <li> tag. Copy the code below and see the difference from the previous example.
<ol><b>My Favorites Movies</b>
<li>Sweet November</li>
<li>Before Sunset</li>
<li>Love Actually</li>
<li>Image You and Me</li>
<ol>
Here as an output:
My Favorite Movies
1. Sweet November
2. Before Sunset
3. Love Actually
4. Imagine You and Me
The image tag is <img>. This shows graphic displays on the web page. The syntax is shown below. The align attribute can also be used here.
<img align =” bottom” border = “integer pixels” height= “integer pixels” src=”URL” vspace=”integer pixels” width=”integer pixels”>
</img>
Copy the tags below.
<html>
<head>
<title>Title of the page</title>
</head>
<body>
<img align =”boat.jpg” border = “200” height= “200” border=”0”>Image example</img>
<img align =” bottom” border = “integer pixels” height= “integer pixels” src=”URL” vspace=”integer pixels” width=”integer pixels”>
</img>
Copy the tags below.
<html>
<head>
<title>Title of the page</title>
</head>
<body>
<img align =”boat.jpg” border = “200” height= “200” border=”0”>Image example</img>
</body>
</html>
</html>
Walang komento:
Mag-post ng isang Komento