Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


Coding a webpage with HTML tags



Minimalist web page


<html>
<head>
<meta charset="UTF-8">
<title> My web page </title>
</head>
<body>

<h1> My web page </h1>

<p> I am a very interesting person,
as I will now explain at length. </p>

<p>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/Wells._Vicar%27s_Close_1.jpg/1024px-Wells._Vicar%27s_Close_1.jpg">
<br>
Embedded image in HTML.   
And now a hyperlink to what it is: 
The <a href="https://en.wikipedia.org/wiki/Vicars%27_Close,_Wells">oldest street in Europe</a>.
</p> 

</body>
</html>

  
Exercise: Copy this into your own web page and view it.
The image is from here. But it should ideally be a local copy.



HTML

  1. HTML is not programming.
  2. Rather it is something called "markup". Defines sections of content.

  3. Browsers are forgiving:
    • Case of tags doesn't matter. Blank space and new lines are all compressed.
    • You can probably leave out the <html> tags, and also the closing </body> and </html> - all browsers can display partial downloads.
    • Also <p> starts a new paragraph no matter what, so you can leave out the </p> tags.
    • We could say "HTML is forgiving", but it's more accurate to say that browsers are forgiving. The HTML spec can say what it likes - the browsers will still forgive errors.
    • See discussion of this under XHTML.

  4. Open source model:
    • Source is interpreted on client side.
    • Can "View .. Source" on other people's pages to get ideas.



Some common tags




Some HTML tags.


  

Reference



ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.