Tags—
HTML is short for Hypertext Markup Language, the text-based language used
to write Web pages. HTML tags are coding instructions imbedded in the
HTML document. A Web browser is designed to read the instructions, or
HTML tags, in order to render the page graphically. In other words, a Web
browser translates HTML tags into visual effects that mold the way an HTML
document looks to the viewer.
Heading Tags—
You may be wondering why heading tags are necessary at all since you could
achieve the same effect by specifying a larger font or defining a css class.
The main reasons are:
Comment tag—
The COMMENT tag is for organizing the source code (HTML) just like the
Horizontal Rule <HR> tag is for the web page. The comment tag is used in
the BODY area of the code. It can be any length in characters.
Anchor Tag—
The <a> tag defines an anchor. An anchor can be used in two ways:
Internal Links
Introduction
An internal link allows you to link to another section on the same web page, so
it basically scrolls the page up or down to the desired location. This is helpful
to the user to quickly jump to the information he/she is looking for.
index.html - Notepad
....<BODY>
<A HREF="#top">
Go To Top Of Page
</A>
</BODY>....
My Homepage - Microsoft Internet
Explorer
Go To Top Of Page
Lists—
DEFINITION
coding results
Preceeding Text Preceeding Text List Header
<DL> List item 1
<LH>List Header</LH> Description of List item 1.
<DT>List item 1
<DD>Description of List item
1.
List item 2
<DT>List item 2
Description of List item 2.
<DD>Description of List item
2.
</DL>
WITH IMAGE BULLETS
coding results
Preceeding Text
<DL>
<LH>List Header</LH>
Preceeding Text List Header
<DD><IMG SRC="redball.gif" ALT="*"> List
List item 1.
item 1.
List item 2.
<DD><IMG SRC="redball.gif" ALT="*"> List
item 2.
</DL>
DIRECTORY
coding results
List Name
<DIR> List Name
<LI>List item List item
1 1
<LI>List item List item
2 2
</DIR>
MENU
coding results
List Name
<MENU>
List Name
List item
List item 1
1<BR>
List item 2
List item 2
</MENU>
NESTED LISTS
coding results
Preceeding Text
<OL TYPE="1">
<LI>List Item 1
<OL TYPE="a">
Preceeding Text
<LI>Nested List Item
1
I. List Item 1
<LI>Nested List Item
a. Nested List Item 1
2
b. Nested List Item 2
</OL>
II. List Item 2
<LI>List Item 2
<UL>
o Nested List Item 1
<LI>Nested List Item
1
</OL>
</OL>
ORDERED
coding results
Preceeding Text
Preceeding Text
<OL>
List Header
<:LH>List
Header</LH>
1. List item 1
<LI>List item 1
<LI>List item 2
2. List item 2
</OL>
ORDERED<LI>TYPES
coding results
<OL>
<LI TYPE="A">List
item
A. List item
<LI TYPE="a">List
item
a. List item
<LI TYPE="I">List
item
I. List item
<LI TYPE="i">List
item
i. List item
<LI TYPE="1">List
item
1. List item
</OL>
<OL>TYPES
Example: <OL TYPE="A">
coding results
<OL
TYPE="A"> A. List item 1
<LI>List item 1
<LI>List item 2 B. List item 2
</OL>
<OL START="8">
coding results
<OL
START="8"> 8. List item 8
<LI>List item 1
<LI>List item 2 9. List item 9
</OL>
UNORDERED
coding results
Preceeding Text
Preceeding Text
<UL>
List Header
<LH>List
Header</LH>
• List item 1
<LI>List item 1
<LI>List item 2
• List item 2
</UL>
UNORDERED <LI> TYPES
• IMAGE
coding results
<UL
SRC="redball.gif">
<LI>List item 1
o List item 1
<LI>List item 2
</UL>
o List item 2
• PLAIN
coding results
<UL PLAIN>
<LI>List item
1
<LI>List item o List item 1
2
</UL> o List item 2
• TYPE
coding results
<UL>
<LI TYPE="CIRCLE">List item
<LI TYPE="DISC">List item o List item
<LI TYPE="SQUARE">List o List item
item
</UL> o List item
When it comes to formatting a web page using HTML code, you can think of
it (kind of) in the same way you would look at formatting a document
formatted by a word processor. You have your headlines to show you where
one section starts and stops. You have your paragraphs to break up blocks of
text, and you have line breaks to show where there should be a new line
started. Now I am going to show you how to get some of these things done
using HTML.
• 1 Headline Tags
• 2 Paragraph Tags
• 3 Line Break Tags
• 4 Blockquote Tags
• 5 What Have You Learned About HTML Formatting Tags?
Headline Tags
The main purpose of the headline tags are make the titles stand out on the
page, and also tell the browser and visitors where the titles are. You can use
<h1></h1> for the main title, then (if needed) <h2></h2> for a secondary
title. The bigger the number gets, the smaller or less important the title
becomes. Remember to use the headline tags for headings only. It is not a
good idea to use them to make text bigger or bolder. Also, search engines
look at how your headline tags are used to help index the structure of the
content on your web pages.
Paragraph Tags
The paragraph tags are important because they show the start (
What if you don't want to go to a new paragraph, and instead only want to
break of one line and move to the line right under it? That is what the
or
tags are for. You might see either used, however it might be best to start
using
to future-proof your web page for browsers in the future (just in case support
for
was ever dropped.
Code: I can put this at the end of a line to show where I want it to stop.
<br />
Blockquote Tags
The <p> element offers a way to structure your text. Each paragraph of text
should go in between an opening <p> and closing </p> tag as shown below
in the example:
Whenever you use the <br /> element, anything following it starts on the
next line. This tag is an example of an empty element, where you do not
need opening and closing tags, as there is nothing to go in between them.
Note: The <br /> element has a space between the characters br and the
forward slash. If you omit this space, older browsers will have trouble
rendering the line break, while if you miss the forward slash character and
just use <br> it is not valid XHTML
Example:
Hello<br />
You come most carefully upon your hour.<br
/>
Thanks<br />
Manasvi
Table tags—
CELLPADDING
• CELLPADDING="10"
<TABLE BORDER="7"
This
CELLPADDING="10">
is a This a
<TR>
TD TH cell
<TD>This is a TD cell</TD>
cell
<TD><PRE> </PRE></TD>
<TH>This is a TH cell</TH>
</TR> Text Image
<TR> align in TH
<TH VALIGN="TOP">Text aligned ed cell
top</TH> top with
<TH>Image in TH cell with default default
alignments ---></TH> alignm
<TH><IMG SRC="blylplne.gif" ents
ALT="airplane"></TH> --->
</TR>
<TR>
Image
<TH VALIGN="BOTTOM">Text aligned
in TD
bottom</TH>
cell
<TD><Image in TD cell with default
Text with
alignments ---></TD>
align default
<TD><IMG SRC="blylplne.gif"
ed alignm
ALT="airplane"></TD>
bott ents
</TR>
om --->
</TABLE>
CELLSPACING
• CELLSPACING="10"
CELL WIDTH
COLSPAN
• COLSPAN="2"
NULCELL
ROWSPAN
• ROWSPAN="3"
<TABLE BORDER="7"
CELLSPACING="10">
<TR>
<TH><IMG SRC="redball.gif"
ALT="*"></TH>
<TD><PRE> </PRE></TD>
<TH><IMG SRC="redball.gif"
ALT="*"></TH> The USS
</TR> Enterprise
<TR> arrives home
<TD><PRE> </PRE></TD>
Bold Italic
<TD>
Text Text
<TABLE BORDER="7"
in a in a
CELLSPACING="5">
TD TD
<CAPTION ALIGN="BOTTOM">
cell cell
The USS Enterprise arrives home
</CAPTION>
<TR>
<TD><IMG SRC="ee.jpg" ALT="Star
Trek pic"></TD>
</TR>
</TABLE>
</TD>
<TD><PRE> </PRE></TD>
</TR>
<TR>
<TD ALIGN=:LEFT"><B>Bold Text in a TD
cell</B></TD>
<TD><BR></TD>
<TD><I>Italic Text in a TD cell</I></TD>
</TR>
</TABLE>
COLOR IN TABLES
• For 141 color names (including the 16 listed in the HTML 3.2
documentation) go to the Color page.
• IN TR TAG WITH IMAGE.
Results of example
Example code
code
<TABLE BORDER="7" CELLPADDING="7"
CELLSPACING="10"> Image is a
<TR BGCOLOR="#00FF00"> transpare
<TD><IMG SRC="rrose.gif" nt .gif.
ALT="rose"></TD>
<TD>Image is a transparent .gif.</TD>
</TR>
</TABLE>
<TABLE BORDER="7"
This cell
CELLPADDING="7"
should be
CELLSPACING="10"> A
yellow, Back to the
<TR BGCOLOR="#00FF00"> green
overriding row color.
<TD>A green row.</TD> row.
the row
<TD
color.
BGCOLOR="#FFFF00">This
cell should be yellow,
overriding the row color.</TD> A blue This cell
<TD>Back to the row row. takes the
color.</TD> color of
<TR BGCOLOR="#0000FF"> the
<TD>A blue row.</TD> topmost
A red row. row that it
<TD><PRE> </PRE></TD>
<TD ROWSPAN="2">This cell spans.
takes the color of the topmost
row that it spans</TD>
</TR>
<TR BGCOLOR="#FF0000">
<TD>A red row.</TD>
</TR>
</TABLE>
<TABLE BGCOLOR="#FF0000"
The table has a
BORDER="7" CELLPADDING="7"
red background
CELLSPACING="10">
<TR>
<TD>The table has a red BGCOLOR in TD/H
background</TD>
<TD><PRE> </PRE></TD>
or TR overrides
</TR>
BGCOLOR in the
<TR>
TABLE tag.
<TD BGCOLOR="#0000FF">BGCOLOR in
TD/H or TR overrides BGCOLOR in the
TABLE tag.</TD>
<TD><PRE> </PRE></TD>
</TR>
</TABLE>
<TABLE BORDER="0"
blah
CELLPADDING="0" CELLSPACING="0" more blah
blah
BGCOLOR="#0000FF"> blah blah
blah
<TR> blah
blah
<TD>
<TABLE BORDER="5"
CELLPADDING="10"
CELLSPACING="10">
<TR>
<TD BGCOLOR="#FFFFFE"> blah blah
blah blah</TD><TD
BGCOLOR="#FFFFFE"> more blah blah
blah blah</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
o
o Example B: with no outer border
Example Code Code Result
<TABLE BORDER="0"
blah
CELLPADDING="0" CELLSPACING="0" more blah
blah
BGCOLOR="#0000FF"> blah blah
blah
<TR> blah
blah
<TD>
<TABLE BORDER="0"
CELLPADDING="10"
CELLSPACING="10">
<TR>
<TD BGCOLOR="#FFFFFE"> blah blah
blah blah</TD><TD
BGCOLOR="#FFFFFE"> more blah blah
blah blah</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
•
• TABLE COLORS WITH FONT COLORS
Results of
Example code
example code
Results of example
Example code
code
CSS—
What is CSS ?
CSS was first developed in 1997, as a way for Web developers to define the
look and feel of their Web pages. It was intended to allow developers to
separate content from design so that HTML could perform more of the
function that it was originally based on - the markup of content, without
worry about the design and layout.
CSS didn’t gain in popularity until around 2000, when Web browsers began
using more than the basic font and color aspects of CSS. And now, all
modern browsers support all of CSS Level 1, most of CSS Level 2, and some
aspects of CSS Level 3.
Web Designers that don’t use CSS for their design and development of Web
sites are rapidly becoming a thing of the past. And it is arguably as important
to understand CSS as it is to know HTML - and some would say it was more
important to know CSS.
CSS is an Abbreviation
Style sheet refers to the document itself. Style sheets have been used for
document design for years. They are the technical specifications for a layout,
whether print or online. Print designers use style sheets to insure that their
designs are printed exactly to specifications. A style sheet for a Web page
serves the same purpose, but with the added functionality of also telling the
viewing engine (the Web browser) how to render the document being
viewed.
For example, in my Web browser, the default font is “Times New Roman”
size 16. But nearly no pages I visit display in that font family and size. This is
because the cascade defines the second style sheets set by the designers to
redefine the font size and family and override my Web browser’s defaults.
CSS is used to style Web pages. But there is more to it than that. CSS is used
to style XHTML and XML markup. This means that anywhere you have XML
markup (including XHTML) you can use CSS to define how it will look.
CSS is also used to define how Web pages should look when viewed in other
media than a Web browser. For example, you can create a print style sheet
that will define how the Web page should print out and another style sheet to
display the Web page on a projector for a slide show.
CSS is one of the most powerful tools a Web designer can learn because with
it you can affect the entire mood and tone of a Web site. Well written style
sheets can be updated quickly and allow sites to change what is prioritized
or valued without any changes to the underlying XHTML.
The challenge of CSS is that there is so much to learn. But it doesn’t seem
like it. After all, there are only around 60 properties in CSS Level 1 and
around 70 in CSS Level 2. Compared with the number of HTML tags and
attributes to learn, that can feel like a cake walk.
But because CSS can cascade, and combine and browsers interpret the
directives differently, CSS is more difficult than plain HTML. But once you
start using it, you’ll see that harnessing the power of CSS will give you more
options and allow you to do more and more things with your Web sites.
26 Jun
The code used to create the Web page is downloaded, interpreted, and then
rendered by the browser to create the final display.
Tips
• The power of CSS comes from its ability to mix and match different
rules from different sources to tailor your Web pages’ layout to your
exact needs. In some ways, it resembles computer programmingwhich
is not too surprising, because a lot of this stuff was created by
programmers rather than designers. But once you get the hang of it,
CSS will become as natural as putting together a sentence.
• Sometimes a Web browser will render HTML content before the style
sheet is applied to it, so you may see a “naked” or unstyled page flash
briefly on the screen.
• There is always the possibility that your Web page will be displayed
without the CSS code, either because of an error or because the device
being used does not accommodate CSS (such as a mobile phone
browser, for instance). You should always consider how your page will
look without the style sheet, and make sure that structurally it makes
sense
An HTML page using CSS to add an image in the background, position the
content down and to the right, and format the text.
The same code displayed without the benefit of CSS. The page still displays,
but without the formatting in Figure.
External HTML links are those HTML links that go to another Web site. If you
place HTML links to About.com, or another Web site you like, on your Web
page that would be an example of external HTML links. Having external
HTML links on you Web site is very important because if you have a good set
of HTML links that your visitors are interested in it will keep them coming
back to your Web site to access those HTML links. For example if you have a
set of HTML links on Star Trek and they really like Star Trek then it would be
much easier for them to come to your Web site than to go looking through a
search engine for the sites they want. They they may even bookmark your
Web pages so they can get to your HTML links faster thus resulting in more
page views for you. If they like it that much they may even tell their friends
about your pages of HTML links and their friends will place HTML links to your
Web site from their Web sites. Result: even more page views.
An internal link allows you to link to another section on the same web
page, so it basically scrolls the page up or down to the desired location. This
is helpful to the user to quickly jump to the information he/she is looking for.
The Anchors
To link to a specific spot on a web page, you need to use a pair of anchors.
One where you are linking from, and one where you would like to link to. The
first one, is where you are linking from. It is very similar to the normal link
tag. The starting tag looks like <A HREF="#name"> and the closing tag
looks like </A>. The text between the two tags is what is the link. The text
"name" identifies the anchor, giving it a name.
The second anchor identifies where you are linking to. This tag must be
placed in your HTML in the location where you would like to link to. The
starting tag is <A NAME="name"> and the closing tag is </A>. It is not
necessary that any text goes between these two tags as it is just identifying
an area. The text "name", must match that in the first anchor, for the link to
work. Here is an example of an internal link.
An HTML comment:
<!--This is a comment. Comments are not displayed in the browser-->
<p>This is a paragraph.</p>
Try it yourself »
Definition and Usage
HTML comments
This means that the following are all legal SGML comments:
Note that an "empty" comment tag, with just "--" characters, should always
have a multiple of four "-" characters to be legal. (And yes, <!> is also a
legal comment - it's the empty comment).
Not all HTML parsers get this right. For example, "<!------> hello-->" is a legal
comment, as you can verify with the rule above. It is a comment tag with two
comments; the first is empty and the second one contains "> hello". If you
try it in a browser, you will find that the text is displayed on screen.
1. The browser sees the ">" character and thinks the comment ends there.
2. The browser sees the "-->" text and thinks the comment ends there.
There is also the problem with the "--" sequence. Some people have a habit
of using things like "<!-------------->" as separators in their source.
Unfortunately, in most cases, the number of "-" characters is not a multiple
of four. This means that a browser who tries to get it right will actually get it
wrong here and actually hide the rest of the document.
For this reason, use the following simple rule to compose valid and accepted
comments:
An HTML comment begins with "<!--", ends with "-->" and does not
contain "--" or ">" anywhere in the comment.