DHTML
Basics - Intro
Think of almost every tag in HTML as pairs or twins. For
every opening tag, there must be a closing tag. Opening
tags always begin with < >. Closing tags always
begin with </ > Everything that you will create in HTML
will be enclosed in <HTML> and </HTML>. It's good
practice when adding an opening tag, to immediately add the
closing tag after it, and type the rest of your HTML between
these lines. In JavaScript, you will also want to do this
with bracket placement. This will save you hours of
debugging time (in my humble opinion). Above any other
skill that you will develop in programming, I recommend learning
to read and analyze source code. In literature, every
great writer first became a great reader, and by reading the
works of others they began to develop slowly, over time, their
own writing style. Why would it be any different for
programmers? If you want to become a good programmer, that
is to say if you want to write good code, you must first become
an avid reader of good code, and gleaning from the styles of
others you will develop your own programming style. I
believe you will learn far more from analyzing actual DHTML,
C++, Java, JavaScript and VB source that from my needless
rambling. Often times an entire book covering a
programming language can be reduced to a few dozen pages of
source code. So without further ado we present DHTML
source:
To see an example of what the following code would display
click:
EXAMPLE .
<!-- This is a comment
TAG. Comment tags are placed inside <> tags and
begin with a ! mark. A web browser will
-->
<!-- ignore anything placed in
these tags. They are just for leaving notes on your
source. -->
<HTML>
<!-- Head tags delineate what loads in a browser
before the <BODY> tag. The page title and META tags
are inserted here. -->
<HEAD>
<TITLE>The title of
your page, displayed between title tags, appears at the bottom
of the status bar</TITLE>
</HEAD>
<BODY bgcolor="#ffffff"
text="#000000">
<p>Placing items between these tags adds them to a
new paragraph</p>
To create a hyperlink:<a href = "myhomepage.html">My
Home Page </a>.
<p>
To display an email address:
<a href ="mailto:cgermany@networkingprogramming.com">cgermany@networkingprogramming.com
</a>.
</p>
<u>Text between these tags will be
underlined.</u>
<br>
<b>Text between these tags will be in bold</b>
<br>
<i>This text will be italicized.</i>
<br>
<strong>This has about the same effect as the bold
tag.</strong>
<H1>This would create a text header</H1>
<FONT face="Arial" size="4"
color="#000000">This text will be in Arial, size 4
and black.</FONT>
<center>This text will be centered.</center>
<!-- The two <BR> tags below will add two empty
lines.-->
<BR>
<BR>
To write 10 to the power of two use the superscript
tags<sup></sup> as in 10<sup>2</sup>.
To write 10 base two use the subscript
tags<sub></sub> as in 10<sub>2</sub>.
<pre>
Any thing inserted between <pre></pre> tags will
appear on the page
just
as
it
is
formatted in the HTML.
</pre>
<BR>
<del>This
text will appear as striked out text</del>
<p>Were you to write
3 times, it would display 3 spaces, as in 3 spaces.</p>
<!-- UL tags = Unordered Lists, li = list items-->
<ul>
<li>Item
1</li>
<li>Item 2
<!--Let's nest a 2nd unordered list inside the 2nd list item
of the 1st.-->
<ul>
<li>Nested Item 1 inside Item 2</li>
<li>Nested Item 2 inside Item 2</li>
</ul>
</li>
<li>Item 3</li>
</ul>
<!-- OL tags = an
ordered list, type can be specified-->
<ol type = "I">
<li>Item 1</li>
<li>Item 2</li>
</ol>
<!-- another nested ordered list -->
<ol type = "a">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<!-- ol elements without a type attribute are sequenced by number-->
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<!--Inserting images-->
<img src="../flag.gif" alt="You can use img
src to insert an image. ALT provides alternate text."
border="0">
<!--Inserting sound-->
Can be done as <bgsound
src="../hola.wav">
or <embed src="../hola.wav"
autostart=true hidden=true>
. This depends on your browser type and version.
<!-- The HR tag will add horizontal "rules" or
lines to your page.-->
<HR>
<HR>
</BODY>
</HTML>
DHTML
2
DHTML 3
Home
DHTML
4
Example
|