Web site logical path: [www.psy.gla.ac.uk] [~steve] demos: [this page] [flowRound] [CSSposAbs] [imagemaps]

1. Small simple markup

< P style="page-break-after: always"> < /P>
< P style="page-break-before: always"> < /P>
< div STYLE="page-break-inside: avoid"> but not impl. in my browser

< BR style="clear: both;">

Bold text[B]
Italic text[I]
Underlined text[u] (Not in html.1)
Blinking text[BLINK]
Emphasised text[EM]
Strong text[STRONG]

Centered text[CENTER]

Centered text[TABLE]

Text Subscript [SUB]
Text Superscript [SUP]
Citation text [CITE]
Code text [CODE]
Definition text [DFN]
Keyboard text [KBD]
Strike out/through text [Strike]
Variable name text [VAR]
TT text [TT]
< !-- This would be a comment without the space. -->
xx text [xx]

These char codes are case sensitive:
& is '&amp;' = 38 decimal
£ is '&pound;' or '&#163;' = decimal 163 in ISO-Latin-1 (char # less the 8th bit)
French: èéêîôàÀ etc. [&egrave; ... Agrave icirc eacute ...]
German: ü Ä ö Ö Ü ä ë [&uuml; &Auml; ....]
'A' is '&#65;' (A) = decimal 65 = hex 41 = '&#x41;' (A)
Fixed space ' ' is '&#160;' = decimal 160 (space char plus the 8th bit)
Fixed space ' ' is '&nbsp;' = non breaking space; 8194, 8195 are HTML fat (n and m-) spaces.
Non-breaking hyphen i.e. minus is ‑ i.e. '&#8209;'
Decimal points / "middle dot":-   &sdot;: 1⋅33   &middot;: 1·33   char 183: 1·33   char hex B7: 1·33  
145 ‘   146 ’   147 “   148 ”   168 ¨
128 €   129    130 ‚   131 ƒ   132 „   133 …   134 †   135 ‡   136 ˆ   137 ‰   138 Š   139 ‹   140 Œ   141    142 Ž   143    144   
149 (or &bull;) •   150 –   151 —   152 ˜   153 ™   154 š   155 ›   156 œ   157    158 ž   159 Ÿ  
Dashes: &mdash; —   (151 works but is technically illegal in HTML: 150 – 151 — 8211 – 8212 —)
Quotes: 145-148 illegal. 8216 ‘ 8217 ’ 8220 “ 8221 ”
  Nice display of chars   extended charset   HTML symbols   extra HTML 4 symbols
Arrows and other symbols: [&there4; &rarr; rArr larr uarr darr harr crarr, etc.]
∴ → ⇒ ← ↑ ↓ ↔ ⇔ ↵ ≡ ≠ ≈ ≅ ∞ √

Font smaller

Font larger
scroll crawling

<CENTER><P><B><STRIKE><BLINK><FONT COLOR="#EB0F11"><FONT SIZE=+3>THIS</FONT></FONT></BLINK></STRIKE></B></P></CENTER> gives:

THIS

Blinking: used to be a tag <BLINK>; can do in javascript (see next); can do in CSS with webkit-animation (see css1 file).

Or else: This too

< BODY onload="blinkIt()">
< SCRIPT type="text/javascript">
var  blinkCycles = 3, blinkStartOn = 1, blinkEndOff = 0;
var blinkCount, blinkLimit;
function blinkIt() {
	//if (blinkCount < 0) { // inits
	if (isNaN(blinkCount)) { // inits
		blinkCount = (blinkStartOn ? 0 : 1);
		blinkLimit = 2 * blinkCycles;
		if (blinkEndOff) blinkLimit++;
	};
	turnOff = (blinkCount % 2);  // Turn off if odd number
	val = ((turnOff) ? 'hidden' : 'visible');
	if (blinkCount < blinkLimit) {
		if (turnOff)	{ setTimeout("blinkIt()", 100); }
		else		{ setTimeout("blinkIt()", 900); };
	}; // else let this be last run of blinkIt()

	for(i = 0; i < document.getElementsByTagName('myblink').length; i++){
		s = document.getElementsByTagName('myblink')[i];
		s.style.visibility = val;
	}
	blinkCount++;
}
< /SCRIPT>
	< MYBLINK>< FONT COLOR="#EB0F11">Adopters being actively sought as clients< /FONT>< /MYBLINK>
And a horizontal rule [HR]:
<HR>
<P style="clear: both;"> <HR size=5 noshade> </P>
<HR style='background-color: red; color: red; width: 80%;'>




Colour

Either for font: <FONT COLOR="#FF0000">THIS</FONT> THIS
or whole document background: <BODY BGCOLOR="#FF0000">

Samples:
•  color="#000000" black     •  color="#FFFFFF" white
• color="#FF0000" red   • 7F0000   • FF8080
• color="#00FF00" green   • 007F00   • 80FF80
• color="#0000FF" blue   • 00007F   • 8080FF
• color="#FFFF00" yellow   • 7F7F00   • FFFF80
• color="#FF00FF" mauve   • 7F007F   • FF80FF
• color="#00FFFF" turquoise  •007F7F  •80FFFF

  • 7F4F00 brown     •  color="#3A6EA5" royal (UoG) blue


2. Medium simple markup

[Plain] This is meant to be a considerable block of text, reaching over several lines and so displaying the wrap issues. I just hope that this is long enough for the windows I'll usually be using.

[ADDRESS] This is meant to be a considerable block of text, reaching over several lines and so displaying the wrap issues. I just hope that this is long enough for the windows I'll usually be using.

[BLOCKQUOTE] This is meant to be a considerable block of text, reaching over several lines and so displaying the wrap issues. I just hope that this is long enough for the windows I'll usually be using.

[PRE]
 This is meant to be a considerable block of text, reaching over
several lines and so displaying the wrap issues.  I just hope that this is
long enough for the windows I'll usually be using.


3. Structures: small

Anchors, images

An email link. Commas optional between addresses. [A href="mailto:steve steve@dcs"]

A basic link [A href="std/howtoref.html"]
A popup link [A href="default.html#0" target="new"]
[A name="atarget"][/A] A target to which other links can jump within a document.
This is now superceded by having the "target" in a URL jump to any < ANYTAG id="atarget" >. So I'll probably just use a DIV to embrace any section, rather than a point, I want to jump to.

< A .. > links need not just be URLs
HREF is a url: link as a link: std/howtoref.html
HREF is java code: Links as a button: javascript:window.location='std/howtoref.html' or javascript:document.bgColor='red';return false;
Button as a link:
Links as a button active from just hovering: onmouseover="javascript:document.bgColor='red';" (hover to action; click to reverse).

A basic picture link [IMG SRC="button1.GIF"] This text acts as a label, but just follows it.
* [IMG SRC="button1.GIF" WIDTH="35" HEIGHT="35" BORDER="0" ALT="*"]
Correct usage: width etc. lets browsers lay out the page correctly before fetching the image; ALT gives a text alternative for when images are disabled.
Link [A HREF="SteveDraper.GIF" target="new"] [IMG ALT="Link" SRC="button2.GIF" WIDTH=21 HEIGHT=21 BORDER=2][/A]
Image as a link (button), with border.

To get a picture centered on the page, embed in a table that is centred < TABLE align="center">< TR>< TD> < IMG SRC=maped.gif width=391 height=688 > < /TABLE>< /TR>< /TD>

To see how to get text flow-round an IMG or indeed other object, see demot.html.

< Acronyms: incomplete note on a new tags for acronyms This CSS: This NSS:


4. Structures: big

menus, lists, headers, tables


[Horizontal menus]
[without any HTML tag]
  PsyDept   |   PsyDept (old)   |   CompSciDept   |   UoG

CSS:
 


Lists, suppressing blank line before first item: < UL style="margin-top: -1em;">

See 'DOCcss' for explanations. Value here is usually -1em, but can be 0.


[DIR]

  • MenuItem1 preceded by <LI>
  • MenuItem2
  • MenuItem3
  • MenuItem4

  • [MENU]

  • MenuItem1 preceded by <LI>
  • MenuItem2
  • MenuItem3
  • MenuItem4

  • [DL]

    Term preceded by [DT]
    Definition preceded by [DD]
    Term preceded by [DT]
    Definition preceded by [DD]


  • LI without a UL list structure

    1. [OL]

    2. Item1 preceded by <LI>
    3. Item2
      1. Item3
      2. Item4
        1. Item11
        2. Item12
      3. Item19
      4. Item20
    4. Item21
    5. Item22

    You can also start with any number, and have various styles of number:

    1. First item (< OL start = 0>)
    2. Second item
    1. Item 1 (< OL type=1>)
    2. Item 2
    1. Item 1 (< OL type=a>)
    2. Item 2
    1. Item 1 (< OL type=A start=3>)
    2. Item 2
    1. Item 1 (< OL type=i>)
    2. Item 2
    1. Item 1 (< OL type=I>)
    2. Item 2


    Heading level 6[H6]

    text

    Heading level 5[H5]

    text

    Heading level 4[H4]

    text

    Heading level 3[H3]

    text

    Heading level 2[H2]

    text

    Heading level 1[H1]

    text


    Heading level 6[H6] size=+2 size=-2

    text

    Heading level 5[H5] size=+2 size=-2

    text

    Heading level 4[H4] size=+2 size=-2

    text

    Heading level 3[H3] size=+2 size=-2

    text

    Heading level 2[H2] size=+2 size=-2

    text

    Heading level 1[H1] size=+2 size=-2

    text


    This is a table

    Table caption
    this is cell 1, row1
    this is cell 2, row1
    this is cell 1,

    row2

    this is cell 2,
    row2

    See also ~/bin/wtable.
    And demot.html for using tables to get figure captions.

    5. Forms

    For work, see:

    Forms seem to have basic facilities you might want to use, not necessarily for forms, for:

    Thus you can consider mixing them with the other standard mechanisms:

  • Use of "url?var1=value1&var2=value2" to send variable settings by URL. However this only works if the server software has explict code to parse these.
  • Use of standard links within forms for the appearance. This can be done by using the form attribute ACTION to set a URL to jump to a page, and the link HREF to call the java routine e.g. "javascript:document.evaluation.submit();" class="normaddr"

    Forms have items; any item (displayed or not) that has both a name and a value, will have that encoded and sent as: url?name=val1&name2=val2&name3=val3+word3b.... Buttons (type "submit") will also have their value sent iff they have both name and value defined. (Their value is the button label, so you may see buttons with value but no name.)

    Preserving state

    To preserve state in a multi-step interaction, the server/author may put out pages with hidden variables set to values gathered from user earlier, so they are re-sent by the form.

    Cookies are an alternative. Now part of the HTTP protocol: server specs them by putting in a "Set-Cookie: " line/field in the HEAD of a response. They may also be set by Java within a page sent to the user. A browser will send it back as part of any GET request if the URL matches (of cookie against the request the browser is making). Cookies have expiry dates (if none, then deleted when browser is quitted). Their content are mainly name=value pairs. See the Wiki entry. Main use: maintaining state, preventing repetitive logins, shopping baskets etc. But also used for logging users' access to a site across time. If cookies are visible to browser-java, then theft of cookies from other servers becomes possible.

    5?. Other/ new HTML tags

    < noscript> ...< /noscript> displays iff javascript is off in the browser.

    < embed> reads in (#include) another file; meant for plugins.
    < EMBED SRC="../graphics/sounds/1812over.mid" HEIGHT=60 WIDTH=144>
    < EMBED SRC="q.pdf">

    < IFRAME> like EMBED, used for video insert into page body. See demot.html.

    6. Page redirection

    See the wikipedia entry.

    The first method will work for all URLs within server's domain, not just for real pages or page names within user-author's control. The rest of the methods only work for redirecting from pages within the user-author's control.

    1. Simplest: just empty the page, put in a link to the new site, and ask the end user to do it by clicking on the link you give.
      [Won't work for IMG fetched files.]
    2. Use .htaccess file (if your server is Apache). User can do this. Must be one line; even if .htaccess is lower down, need path from root; can have full remote URL too.
      Redirect   /~steve/best/triad2.html   /~steve/rap/surgeon.html
    3. The simplest way is to get the server to do it. Apparently a list of such redirections are compiled in; probably implemented by sending http redirection codes. URLs that are directories or new domain names must point not to files but to directories (with index.html files), and probably be redirected again.
    4. A bad way is to use links or symbolic links. Not only may symlinks be disabled by server, but with links the local refs on the page will not work as they assume the page is in one (not all) of its actual locations.

      Though this might be fixable by adding line to page inside < HEAD> < BASE href="http://www.psy.gla.ac.uk/~steve/dir/tmp/"> to spec. the new location file root. So: a) move main copy of file to new place; b) add BASE to spec this file root; c) edit internal URLs or move dependent files (IMGs etc.) with it. d) link to it from old file location (and others).

    5. The page author (as opposed to server manager) may use this inside the page header: <HEAD>
      <meta http-equiv="refresh" content="0; url=http://www.psy.gla.ac.uk/~steve/resources/pal.html">

      This uses a refresh command with zero delay (or put in 1 or 5 seconds). It does depend on the browser implementing this non-essential facility, but most do (e.g. netscape 3). It commands the browser to pretend it received an extra header line in the HTTP exchange. Shouldn't there be a "redirect" http command/ header line?
      [Won't work for IMG fetched files.]

    6. The page author could use Javascript to do it. This will not work for users with Java turned off. Put this anywhere (in HEAD, ...).
      <SCRIPT>
      window.location = "http://www.psy.gla.ac.uk/~steve/resources/pal.html";
      window.location.reload(); (actually seems not necessary)
      </SCRIPT>

      OR: < A href = "javascript:window.location='< ?=$url1?>'
      [Won't work for IMG fetched files.]

    7. For pages under servers with this facility, can aim at the php pre-processing offered by the server. This can be put anywhere on page, which must be "index.php" not .html, but depends on that page/area/user-author being authorised. So presumably it cannot be used to redirect x.html pages. Here is the recipe:
      <?php header("Location: http://www.psy.gla.ac.uk/~steve/resources/pal.html"); exit; ?>
    8. Frame redirects (which also cloak the real URL).