top of page

How To Build A Website: Part IX— Other Elements

HTML includes several other features besides those already mentioned. The <iframe> element allows for the embedding of outside web content on a page. The <canvas> element allows for the drawing of graphics via JavaScript. The<div>element is essentially a grouping tag. And the <table> defines, obviously, a table.


The <iframe> element is perhaps the most important of these, next to the <div>. It is used to embed content, defined by the URL value of the src=“” attribute. The iframe’s content cannot be accessed by JavaScript. The src=“” attribute must access a site with the same protocol, if the protocol is http:// or https:// . This is why I can’t embed my site here. The iframe can embed HTML content, but for images or videos, it is better to use the <img> and <video> tags, respectively, with the src as the URL of the object you want to embed.


The <canvas> element is used to draw graphics with JavaScript. This element can be very powerful, even to the extent of a 3D character editor. This is an example of a gradient drawn in a canvas with JavaScript:


The <div> is a grouping element. It is usually distinguished by CSS classes, or by the id attribute. The <div> is often used to manipulate multiple elements at once with JavaScript or CSS.


A table layout is created with the <table> element. The table invloves the <tbody>, <tr>, and <td> elements for the table’s body, rows, and columns:


<table>

<tbody>

<tr>

<td>

<p>ROW I COL I</p>


</td>

<td>


<p>ROW I COL II</p>


</td>

</tr>

<tr>

<td>

<p>ROW II COL I</p>


</td>

<td>


<p>ROW II COL II</p>


</td>

</tr>

</tbody>

</table>


This outputs:




Next, we will move on to CSS and stylize our login page. Then, we will combine HTML and CSS to make an attractive homepage.


__RESOURCES__

The blank HTML file — Experiment!


8 views0 comments

Recent Posts

See All

Comentarios


Post: Blog2_Post
bottom of page