Essential HTML Tags and Commands Guide
Essential HTML Tags and Commands Guide
Fundamental TAG
Text formatting
<H1> </H1> start and end level 1 header (up to level 6 is possible)
<P> , inizio paragrafo saltando una riga
<P ALIGN="type"> start paragraph with alignment type (LEFT, CENTER, RIGHT)
<BR> paragraph start without skipping a line
<BR CLEAR=ALL> , paragraph interruption
<PRE></PRE> It allows you to replicate every space and every line break typed in the programming.
even in the browser window
<B> </B> , bold start and end
<I> </I> , italic start and end
<U> </U> start and end of underline
<CODE> </CODE> , start and end character typewriter
<CENTER> </CENTER> start and end centered alignment
<SUP> </SUP> , beginning and end quotation mark
Oss :
• / indicates the end of a tag
• Empty lines in Notepad are not displayed by the browser (if you want to consider them, you need to use the <PRE> tag)
• the options (e.g. BGCOLOR) are added to the tags (e.g. BODY) and modify their effect
• to add special characters, use the format: &#ASCII-code
• Before closing the site, add the date, time of the last update, and the name and surname of the site owner.
with an email address possibly in the form of a link
HR Properties
Ex.
<HR WIDTH="50%" ALIGN="left" SIZE="2" COLOR="blue">
inserts a horizontal line with a width of '50%' on the size of the window, aligns it to the left with font size
"2" and colors it blue
1
BODY Property
FONT Properties
Es.
<FONT COLOR=”Yellow”> </FONT> start and end text coloring with yellow
<FONT SIZE=”6”> </FONT> start and end modify font dimensions
<FONT FACE="Georgia,serif" SIZE="5"> set the font type and its size
COLOR CODE
Colors can be entered by their code or their name in English.
WHITE BLACK RED GREEN BLUE
#FFFFFF #000000 #FF0000 #00FF00 #0000FF
MAGENTA CYAN YELLOW AQUAMARINE DARK GREEN
#FF00FF #00FFFF #FFFF00 #70DB93 #2F4F2F
LIGHT BLUE LIGHT GREEN ORANGE PINK SUMMER SKY
#C0D9D9 #32CD32 #E47833 #BC8F8F #236B8E
TURQUOISE VIOLET thistle GOLDENROD MAROON
#ADEAEA #4F2F4F #D8BFD8 #DBDB70 #8E236B
LIGHTEST GREY LIGHTER GREY MEDIUM GREY DARKER GREY DARKEST GREY
#DDDDDD #A8A8A8 #545454 #454545 #333333
2
Command lists
Ex.
Fundamental components of a computer
<OL TYPE="I">
CPU
<UL>
CU
ALU
</UL>
Central memory
<UL>
RAM
ROM
</UL>
Input/Output Devices
<UL>
Input Devices
Output Devices
Input/Output Devices
<UL>
Mass storage (Hard Disk, Floppy Disk, CD, DVD)
</UL>
</UL>
</OL>
Glossary
<DL>
<DT>CPU <DD> Central Processing Unit
CU Control Unit
<DT>ALU <DD> Arithmetic Logic Unit
The glossary continues...
</DL>
3
Anchor Commands or Links
email_address
create a link to the email address contained in the tag (when clicked, an email will open with
the destination address already prepared with that indicated in the tag
Note: if the link is internal to the same page, the syntax will be as follows
<A HREF="#anchor_name_to_reach"> Link name </A>
and where you want to insert the anchor, which will not be displayed, you will type
<A NAME="anchor_name"></A>
Ex.
<A HREF="[Link] Virgilio search engine </A>
create a link named 'Virgilio search engine' that points to the [Link]
<A HREF="[Link]"> Volare </A>, creates a link named "Volare" that points to the song volare
4
IMG Properties - Image Commands
<IMG>
SRC="path/image_name" indicate which image should be uploaded
ALT="image title" it will display image title during loading, also useful for
index the image and make it "visible" to search engines
WIDTH="n° pixel" , image width
HEIGHT="n° pixel" image height
HSPACE="n° pixel" , horizontal space left around the image
VSPACE="pixel number" , vertical space left around the image
ALIGN="type" , allineamento (tipo: TOP, MIDDLE, BOTTOM, LEFT, RIGHT)
Oss:
• Internet Explorer: the properties of the image can be obtained by right-clicking on the image.
Netscape: displays the dimensions of the image when loaded in the browser window.
The dimensions in pixels are displayed on the menu bar.
• <BR CLEAR=ALL> paragraph interruption (e.g. what follows is positioned below the image and not to the side)
Es.
<IMG SRC=”images/[Link]” ALIGN=”right” ALT=”Titolo dell’immagine”>
insert the image '[Link]' present in the 'images' folder and align it to the right of the following text, introducing
a brief description during the image loading phase
Mapped images
They are links represented by graphic images and are a useful aid to simple text links, which are still useful for making oneself
"visible" to search engines.
To create them, follow these steps:
- build the image-link bar with a graphics program (e.g. paint) and note the coordinates in pixels provided
from the program itself, the angles at the top left and bottom right of each image inserted in the bar just
created, which must start from the coordinates 0,0
- add the following html code to the page/file where you want to create the link-bar:
Oss : the COORDS coordinates are examples like the HREF html files, the name and path of the bar
"images\linked_mapped.jpg" and all the values of the other attributes.
The name indicated by USEMAP must match the one given to the bar in <MAP NAME>, to which '#' is added in front.
the other shape options besides rect are circle and polygon
By inserting the option ALT="name" before coords, a name is given to the image that will be displayed when hovering over it.
with the mouse
5
STYLE Properties - Style sheets
<STYLE TYPE="text/css">
<!-
.style_name { proprietà1: modifica proprietà1; proprietà2: modifica proprietà2;…}
->
</STYLE>
Example.
<STYLE TYPE="text/css">
<!-
character The provided text appears to be incomplete or incorrectly formatted. Please provide a valid text for translation.
left: 5em }
->
</STYLE>
Oss :
• The previous commands should be placed in the header (HEAD)
• There needs to be a tabulation between the style_name and the curly brace.
• The properties entered in the command are examples
• The first and last line are used to hide the command from older web browsers.
• To invoke the defined style: <P CLASS="name_style"> , Is. <P CLASS="character">
In a table, it will be called in the <TR> and <TD> tags.
If one must use a style only in a certain context (e.g., within a sentence), the following command can be used:
Text to modify
Ex.
Text to be modified
6
TABLE Properties - Table Commands
Ex.
• <TABLE WIDTH="50%" HEIGHT="100" BORDER="2" BGCOLOR="yellow">
<TR VALIGN="center" ALIGN="center">
<TD><FONT SIZE="4" FACE="Georgia,serif" COLOR="blue"> Table text </FONT></TD>
</TR>
</TABLE>
create a table with a width of '50%' of the window size, height '100', border '2' and background color 'yellow' then
format the rows and their alignment with <TR> and finally format the cells with the <TD> tag setting the font of the characters
a “Georgia,serif” di dimensioni “4” e colore “blue”
7
FRAME property
<FRAMESET ROWS="n° pixel, *, *,…" indicates the frame size in number of pixels in height and then divides it
remaining part of the page in as many equal parts as there are asterisks
<FRAMESET COLS="number pixel, *, *,…" indicates the frame size in pixel width and then divides
the remaining part of the page into as many equal parts as there are asterisks
</FRAMESET> , it is inserted at the end of the frame definition
<NOFRAMES> </NOFRAMES> start and end command to manage browsers that do not support frames
(content in frameset) useful for making oneself "visible" to search engines
providing a complete description of the site and a list of the links of the
two main pages
TARGET=”nome_bersaglio” this attribute already seen in the "link" section allows you to select the
target frame (-> "target_name") of a certain link
<BASE TARGET="name_frame"> , added in the <HEAD> section creates a default destination,
"name_frame", for all the links present on the HTML page without
doverla più specificare per ogni collegamento a meno che i link non
they must aim at a different frame than the default one
TARGET=”_top” to be included in all links coming from the site if you want to eliminate the frameset
Oss :
• The FRAMESET tag must contain a number of FRAME tags equal to the number of frames defined.
• If I want to define frames within frames, simply replace the FRAME tag with another FRAMESET tag that will be equipped with.
your return of tag FRAME
• Naturally, the SRC property only works if the files indicated by 'page_name' exist.
Ex.
<HTML>
<HEAD><TITLE>Prova comandi frame</TITLE></HEAD>
<FRAMESET COLS="200, *">
<FRAME SRC="[Link]" NAME="left" SCROLLING="AUTO" NORESIZE FRAMEBORDER="1">
<FRAME SRC="[Link]" NAME="right" SCROLLING="AUTO" NORESIZE FRAMEBORDER="1">
</FRAMESET>
</HTML>
8
FORM properties
<INPUT> inserts objects (text boxes, buttons, ...) into the form
TYPE="text" inserts a text box
TYPE="password" password text box (with asterisks)
TYPE="radio" , insert a radio button (box with a dot)
TYPE="checkbox" insert a checkbox
TYPE="submit" , it adds an insert button
TYPE="reset" , it adds a reset button
NAME="name" , text box name
SIZE="num_characters" dimensions width box in number of characters
VALUE=... value returned by the selected object on the form
CHECKED for radio button and checkbox selected by default
Ex.
<FORM ACTION="[Link] METHOD="POST">
<PRE>
Nome : <INPUT TYPE=”text” NAME=”nome”>
Sex : Male <INPUT TYPE='radio' NAME='gender' VALUE='male'>
Female<INPUT TYPE="radio" NAME="gender" VALUE="female">
Email : <INPUT TYPE=”text” NAME=”email”>
Comments: <TEXTAREA NAME="comments"></TEXTAREA>
</PRE>
</FORM>
It should be noted that the labels of the text boxes Name, Email, and Comments will appear, thanks to the <PRE> command, equal
appear on the page displayed by the browser
9
The META tags, or how to make yourself visible to search engines
In addition to the tips mentioned above, to make oneself visible to search engines, META tags can be used. First, one must decide which ones to use.
these are the keywords of the site and try to verify their use on the Internet through one of the designated sites for this purpose (e.g.
[Link]). After deciding which keywords to use, you can insert them into the site via the META tag that will be
transcribed in the index page immediately after <TITLE> as follows:
Insert the keywords here, separated by commas.
Additionally, a second META tag will be included with a brief description of the site (max 200 characters)
<META NAME = ”description” CONTENT = “Descrizione sintetica max 200 caratteri”>
This work can be repeated for all pages of the site, with different keywords and descriptions.
What is Javascript?
JavaScript offers a way to further improve the design and functionality of web pages.
First of all, one must be careful not to confuse Java, a programming language, with JavaScript, a language of
scripting; too often, in fact, the two terms are used interchangeably. Java was developed by Sun Microsystems as
platform-independent programming language for computers, for creating small applications, or 'applets', that
They could both be part of a webpage and be a standalone desktop program. Java applets are like small programs.
independent, which can be used without seeing them or worrying about them.
Originally called 'LiveScript', JavaScript was developed by Netscape as something very different. It was
renamed because of the structural similarities with the Java programming language. To create JavaScript, you just need to type the
your embedded commands in your HTML and the browser follows the commands while trying to format the web page.
Simple commands
• Modify the message associated with a link displayed in the status bar
<a href="[Link]" onMouseOver="[Link]='message text
link text
oss : The two events onClick and onMouseOver can be nested within the same HREF tag.
#dummy_anchor it is a fictional anchor that must be inserted just above the relevant html line,
to prevent the browser from jumping to an unwanted page
oss : toolbar=yes/no display the browser buttons (forward, back, home, print, etc)
address display the field that shows the URL for the current window
directories display the directory buttons of other web browsers
status display the browser toolbar at the bottom
menubar display the menu bar of the web browser
resizable allows users to change the window size
scrollbars provides scroll bars if the content is wider than the window
width=XX specify the window width in pixels
height=YY specify the height of the window when it is opened, in pixels
screenX, screenY, left and top fix the top left corner of the window
10