|
Web Design ![]() This website demonstrates using wikis as teaching and learning tool. The course instructor is happy to share the teaching materials here with those who find it readable. |
Lecture /
Basic Elements of a Web PageA Web Design Lecture by Steven Choy Overview: Before you design your website, you will need to understand what elements you can use in your design. A web page typically contains the following elements: body copy, headings, hyperlinks, images, lists, tables, header and footer, navigation, search box, and scrolling areas.
Introduction to HTML
It is the web page content received by a browser. It tells the browser what to display on the user's screen.
It does not necessarily mean HTML files in the server.
Examples: all of the following URLs will result in a HTML received by a browser:
about.html
about.php
about.aspx
about.jsp
HTML = head information + document body
<!DOCTYPE . . . >
<html>
<head>
<title>Insert your page title here</title>
. . . .
. . . .
</head>
<body>
. . . .
. . . .
</body>
</html>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<p>Paragraph</p>
<img src="url" alt="text">
<a href="url" title="text">...</a>
<ul>
<li>Bullet point</li>
<li>Bullet point</li>
<li>Bullet point</li>
</ul>
<ol>
<li>First point</li>
<li>Second point</li>
<li>Third point</li>
</ol>
<dl>
<dt>definition term<dt>
<dd>definition deail<dd>
<dt>definition term<dt>
<dd>definition deail<dd>
<dt>definition term<dt>
<dd>definition deail<dd>
</dl>
Basic table attributes:
<table>
<tr>
<td>Table cell</td>
<td>Table cell</td>
</tr>
<tr>
<td>Table cell</td>
<td>Table cell</td>
</tr>
</table>
<form action="URL" method="GET">
<select name="name">...</select>
<input type="checkbox"></input>
<input type=". . ."></input>
<input type=". . ."></input>
</form>
Body copy
Headings
HTML headings, created with the h1-h6 elements, are very useful and should be used for anything that visually looks or acts like a heading. This is partly because it is the semantically right choice, partly because it may help your search engine rankings. But the most important reason is that using real headings improves accessibility.
Each document should have a logical heading structure that starts at level 1 and doesn’t skip any levels
Anything that visually looks like a heading should be marked up as a real heading
The title of the document’s main content should be a level 1 heading
There should be only one level 1 heading in each document
Hyperlinks
1) Ensure your links are large enough to easily click.
2) The first link is the most important one.
3) Don't link everything.
4) Don't radically alter link behavior.
5) Don't title your link "Click Here".
6) Don't use long text to title your link.
7) Don't include icons on every link.
8) Don't make your content depend on links to work.
9) Don't hide your links.
10) Don't mix advertising and links.
11) Don't obfuscate your URLs.
Images
Lists
<ul>...</ul> Creates a bulleted list
<ol>...</ol> Creates a numbered list
<li>...</li> Precedes each list item, and adds a number
<dl>...</dl> Creates a definition list
<dt> Precedes each definition term
<dd> Precedes each definition
<ul> <li>Apple</li> <li>Banner</li> </ul> <ol> <li>Apple</li> <li>Banner</li> </ol> <dl> <dt>Cascading Style Sheets</dt> <dd>Style sheets are used to provide presentational suggestions for structured documents marked up in XML or HTML.</dd> </dl>
Tables
"Although many sites still use tables for layout, it's better to use CSS for layout and just use tables for format data."
<!-- Table markup--> <table id="..."> <!-- Table header --> <thead> <tr> <th scope="col" id="...">...</th> ... </tr> </thead> <!-- Table footer --> <tfoot> <tr> <td>...</td> </tr> </tfoot> <!-- Table body --> <tbody> <tr> <td>...</td> ... </tr> ... </tbody> </table>
Forms
<FORM ACTION="form2email.php" METHOD="POST"> Name: <INPUT TYPE="TEXT" NAME="Name" VALUE="" SIZE="25" MAXLENGTH="50"> <BR> Email: <INPUT TYPE="TEXT" NAME="Email" VALUE="" SIZE="25" MAXLENGTH="50"><BR> <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Sign Me Up!"> </FORM>
Common elements of a Web site
Header and Footer
Navigation
Search box
Most visitors expect to see a search box in the top-right of the web page.
Thanks for ReadingIf you would rather like to have this lecture note in printed format, please click the print action link in the top right corner. If you find any problem in this lecture note, please feel free to tell Steven via steven [at] findaway.hk. |