SlideShare a Scribd company logo
1 of 8
Download to read offline
Basic HTML Tutorial
by Robert Frank, Team 358
HTML Structure
HTML, or hypertext markup language, is very simple to learn and very simple to use. HTML is used in most
modern websites. HTML has two basic forms:
<name attribute1="value1" attribute2="value2">Content of 'name'</name>
and
<name attribute1="value1" attribute2="value2">
After you learn the basic form of HTML, you are ready to do some HTML coding. And just so you know, the
capitalization of the name's of the basic structure and the attributes does not matter, while the capitalization of the
values and contents of them do.
HTML pages always start with a DTD, or document type definition. This allows the web-browser to determine what
type of HTML you are using as well as what language the characters are in. The type of DTD that I would
recommend is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
After the DTD, you would continue with the HTML tag, like so:
<HTML>
...
</HTML>
HTML pages are broken into two main sections: the HEAD and the BODY, both contained within the HTML tags.
The head contains the title and sometimes meta tags. The body contains the main page that everyone sees. A typical
website looks something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
...
</HEAD>
<BODY>
...
</BODY>
</HTML>
Page Title
The title is the most important element of a quality web page. The title allows people to know what they are visiting
and represents the page. When search engines add your website to their database, they add the title as what you see
when searching for what you want. Page titles are very useful for letting your guests know just what is on you
website. There can only be one title per page, so only the first code read containing the title will be shown. In order
to add a title use the following code:
<TITLE>this is the title</TITLE>
Please note that this is one of the tags that will go within the HEAD tags. Here is an example of a web page:
Simple Headings
There are six different simple headings that can be used (H1 to H6). Many websites use headings. You can use the
following code to make headers.
<H1>This is the Heading</H1>
<H2>This is the Heading</H2>
<H6>This is the Heading</H6>
Of the six different headings, <H1> produces the biggest, and <H6> produces the smallest. You can also center the
headings by using the align attribute, as you can see here:
<H1 ALIGN="center">This is the centered Heading</H1>
Paragraphs
Paragraphs are very useful and should be used. They can be created by using the following code:
<P>This is a paragraph.</P>
<P>This is a second paragraph.</P>
New Lines/Spacing
New lines are very important for making any website. In order to create a new line you would add the following
code:
<BR>
Spacing is also very important. When using HTML, you can use just a space, but only up to the first space. Beyond
the first space, the web-browser will just ignore. In order to do any amount, you must use the following code for
each space wanted:
&nbsp;
Horizontal rules
Horizontal lines can be added by doing the following code:
<HR>
You can also change the width of the line as well as align them to the left or right, as can be seen here:
<HR ALIGN="left" WIDTH="50%">
Please note that you can have the width in pixels instead of percentages as well. You can also change the height in
pixels by doing the following:
<HR SIZE="5">
Comments
Comments are very useful for people that want to identify things in their HTML. They are used when multiple
people update website. They are also used to "block" the HTML code. The user does not see a comment unless they
view the source code. You can add a comment by doing the following:
<!-- This is the comment -->
Changing Font Color/Face/Size
Changing the font color, face and size are all relatively simple, and are all contained within the same HTML
function. In order to just change the color, you can do the following:
<FONT COLOR="red">This is the text that the color applies to</FONT>
This is the text that the color applies to
Within the color field you may name a color, as shown, or you may use the HEX code of the color, which is the
preferred method, as seen below:
<FONT COLOR="#FF0000">This is the text that the color applies to</FONT>
This is the text that the color applies to
The color in hex code has a lot more ability and I would recommend that you use it so that you can have a unique
website. The hex code of red then green and blue, all up to 255 but in hexadecimal code. Please note that not all
monitors display all colors.
Changing the face of a font is also very simple and useful. You can change the face of the font to whatever font you
wish, but be careful, if a user does not have that font installed on their computer, then it will just show the default
font. You can change the face by using the following code:
<FONT FACE="Webdings">This is the text that it applies to</FONT>
       
Because people may not have the specific font type that you want it is a good idea to have backup font types
separating them by commas, as seen here:
<FONT FACE="BobsFont,Wingdings,Times New Roman,Times,Courier New">This is the text that it applies
to</FONT>
       
You can change the font size using two basic methods. You can do it by using the size attribute, or by using the style
attribute. The code for the size attribute:
<FONT SIZE="5">This is the text that it applies to</FONT>
This is the text that it applies to
Using this method, you can change the font from 1 to 7. I would not recommend this method. You could also make
the font change, compared to what it was right before as can be seen here:
<FONT SIZE="+2">This is the text that it applies to</FONT>
This is the text that it applies to
As you can notice the font size increased by two font sizes from what it was right before. You can go from -7 to +7,
where the -7 decreases the font size by seven and the positive increases it by seven. Another method of changing the
font size it by using the following:
<SMALL>The small text<SMALL>
The small text
<BIG>The big text<BIG>
The big text
The more commonly seen font size can be changed by using the font style attribute. You can use this code for
modifying that:
<FONT STYLE="Font-Size:20px;">This is the text that it applies to</FONT>
This is the text that it applies to
By using this, you can easily modify the font size from 1 and on. this is what most programs and websites use as
their font size.
Bolding/Italicizing/Underlining/Striking
You may also want to bold, italicize, or underline some of you website. It is very good for making things stand out.
You can bold something using the following code:
<B>This is the text that it applies to</B>
This is the text that it applies to
Or you may bold by doing the following:
<STRONG>This is the text that it applies to</STRONG>
This is the text that it applies to
Or you may italicize using the following:
<I>This is the text that it applies to</I>
This is the text that it applies to
And another way to italicize is:
<EM>This is the text that it applies to</EM>
This is the text that it applies to
Or you may underline using the following:
<U>This is the text that it applies to</U>
This is the text that it applies to
Or you may strikethrough text by using the following:
<STRIKE>This is the text that it applies to</STRIKE>
This is the text that it applies to
Making Links
Links are extremely useful for bringing the user to another page that may be within your website, or may be another
website that you think would be useful to others. You can create a simple link using the following code:
<A HREF="tutorials.php">This is the text that it applies to</A>
This is the text that it applies to
There are several different types of links, for local pages, you would use something like the above. For links to other
sites, you may use something like the following:
<A HREF="http://bobbys.us/tutorials.php">This is the text that it applies to</A>
This is the text that it applies to
There are many different things that you can do besides just simple links, but this is still very useful.
Making Links in new windows
You may occasionally need to open a new window for the user because you may not want them to leave you website
or another reason. Many people these days do not like new windows though, and will just block all new windows. In
fact in many 'top ten website mistakes', people place having new windows within the list. But if you want to make
new windows, you can use the following code:
<A HREF="http://bobbys.us/tutorials.php" TARGET="_BLANK">This is the text that it applies to</A>
This is the text that it applies to
Making Links to email addresses
Many times you may also want to have a link to your email address. I personally do not like the method and would
recommend using a script to send the mail for you, but it is always a good thing to know. To add a link to ayou can
use the following code:
<A HREF="mailto:admin@bobbys.us">E-mail me</A>
E-mail me
Please be warned, it is dangerous to place your email address like this, there are many crawlers out there just looking
for emails like this. Once crawlers collect emails, lists are sold to spammers. This is how many people get a lot of
spam.
Linking to somewhere in the page
You may also have a large page and want to link to different pieces of the webpage. In order to do this, first you
must make location to link to. You can do this by using the 'name' attribute on the 'A' element, as can be seen here:
<A NAME="section1">Section One - Downloads</A>
This would create a place to link to called 'section1'. You can link to it by using the following code:
<A HREF="#section1">Go to downloads</A>
or by putting the name of the HTML document, like so:
<A HREF="tutorials.php#section1">Go to downloads</A>
Adding images
You may also want to create image. Images are simple to add, and are very useful for showing pictures or diagrams.
To add an image you can use the following code:
<IMG SRC="images/one.gif" ALT="alternate text"> Once you add an image, you may notice that there is a border
when you make the image a link. In order to get rid of this you will have to change the border attribute. Here is an
example of how to change the border to a size of 0:
<IMG SRC="images/one.gif" ALT="alternate text" BORDER="0">
Centering Text
When making your page, you may also want to center your header or whatever else. In order to center text you make
use the following code:
<CENTER>This is the text that it applies to</CENTER>
This is the text that it applies to
Special Characters
In many cases you may find that you may need to insert special characters. They are very simple to insert, if you
know what each character is. As you may remember we added a space by using &nbsp;. Other special characters can
be added by doing & followed by the code for them, which can be found here (please note: this is not on my site),
and then you would place a semi-colon afterwards. here are some examples:
&#169; produces ©
&#38; produces &
&#162; produces ¢
&#174; produces ®
&#177; produces ±
&#178; produces _
etc...
Lists
You may also have lists of items that you will need to add. There are several types of lists. The two most common
ones are ordered and unordered lists. Ordered lists are called ordered lists because they have numbers for people to
be guided by. Here is an example of an ordered list:
<OL>
<LI>Item one</LI>
<LI>Item two</LI>
<LI>Item three</LI>
</OL>
1. Item one
2. Item two
3. Item three
There are also different types of ordered lists. Here is an example of a specific type of ordered list:
<OL TYPE="I">
<LI>Item one</LI>
<LI>Item two</LI>
<LI>Item three</LI>
</OL>
I. Item one
II. Item two
III. Item three
The 'TYPE' attribute can contain one the following types: 1, a, A, i, or I.
Unordered lists are similar to ordered lists, except that they have bullets instead of numbers. Here is an example of
an unordered list:
<UL>
<LI>Item one</LI>
<LI>Item two</LI>
<LI>Item three</LI>
</UL>
• Item one
• Item two
• Item three
Tables
Tables are used in many websites. Although they are not always seen, tables are very good at aligning certain things.
In fact, this website uses tables, but you probably cannot see them. Tables have many attributes that can be modified
to fit exactly what you want. Simple tables can be added by doing the following:
<TABLE BORDER="1">
<TR>
<TD>top left</TD>
<TD>top right</TD>
</TR>
<TR>
<TD>bottom left</TD>
<TD>bottom right</TD>
</TR>
</TABLE>
top left top right
bottom left bottom right
Here is what it would look like without a border:
<TABLE>
<TR>
<TD>top left</TD>
<TD>top right</TD>
</TR>
<TR>
<TD>bottom left</TD>
<TD>bottom right</TD>
</TR>
</TABLE>
top left top right
bottom left bottom right
You can simple add more rows by adding another <TR> with the columns. Here is an example with five rows:
<TABLE BORDER="1">
<TR>
<TD>top left</TD>
<TD>top right</TD>
</TR>
<TR>
<TD>row 2 - left</TD>
<TD>row 2 - right</TD>
</TR>
<TR>
<TD>row 3 - left</TD>
<TD>row 3 - right</TD>
</TR>
<TR>
<TD>row 4 - left</TD>
<TD>row 4 - right</TD>
</TR>
<TR>
<TD>bottom left</TD>
<TD>bottom right</TD>
</TR>
</TABLE>
top left top right
row 2 - left row 2 - right
row 3 - left row 3 - right
row 4 - left row 4 - right
bottom left bottom right
You can also add columns by just adding a <TD> in each of the rows. Here is an example:
<TABLE BORDER="1">
<TR>
<TD>top left</TD>
<TD>top - column 2</TD>
<TD>top - column 3</TD>
<TD>top right</TD>
</TR>
<TR>
<TD>bottom left</TD>
<TD>bottom - column 2</TD>
<TD>bottom - column 3</TD>
<TD>bottom right</TD>
</TR>
</TABLE>
top left top - column 2 top - column 3 top right
bottom left bottom - column 2 bottom - column 3 bottom right
<TH> can be used instead of <TD>. The difference between the two is that TH is bolded and centered, whereas TD
is left aligned and unbolded. There are also many more attributes for each column and row as well as the tables.
Much more...
There are also many more attributes and elements that I did not cover. You can visit http://www.w3.org/ to find all
of the types of elements, now that you know the basics of HTML. One good HTMl cheatsheet is located at
http://www.webmonkey.com/. And of course, look at what people have done on their website, by going to 'View
Source,' it is a great way to learn HTML code.
Validity of your page
When you are done making your page, it is a good idea to make sure that it is valid. w3.org has created an online
website validator. You can find their validator here: The W3C Markup Validation Service

More Related Content

What's hot

Code This, Not That: 10 Do's and Don'ts For Learning HTML
Code This, Not That: 10 Do's and Don'ts For Learning HTMLCode This, Not That: 10 Do's and Don'ts For Learning HTML
Code This, Not That: 10 Do's and Don'ts For Learning HTMLHubSpot
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTMLMayaLisa
 
Web pageassignment
Web pageassignmentWeb pageassignment
Web pageassignmentbeachtch
 
HTML email best practices
HTML email best practicesHTML email best practices
HTML email best practicesJeffrey Barke
 
CSS3 and a brief introduction to Google Maps API v3
CSS3 and a brief introduction to Google Maps API v3 CSS3 and a brief introduction to Google Maps API v3
CSS3 and a brief introduction to Google Maps API v3 Jeffrey Barke
 
Learn html Basics
Learn html BasicsLearn html Basics
Learn html BasicsMcSoftsis
 
GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1Heather Rock
 

What's hot (14)

Code This, Not That: 10 Do's and Don'ts For Learning HTML
Code This, Not That: 10 Do's and Don'ts For Learning HTMLCode This, Not That: 10 Do's and Don'ts For Learning HTML
Code This, Not That: 10 Do's and Don'ts For Learning HTML
 
HTML 5 Web Design
HTML 5 Web DesignHTML 5 Web Design
HTML 5 Web Design
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Web pageassignment
Web pageassignmentWeb pageassignment
Web pageassignment
 
Html tutorials
Html tutorialsHtml tutorials
Html tutorials
 
HTML email best practices
HTML email best practicesHTML email best practices
HTML email best practices
 
Learning Html
Learning HtmlLearning Html
Learning Html
 
Html 5
Html 5Html 5
Html 5
 
CSS3 and a brief introduction to Google Maps API v3
CSS3 and a brief introduction to Google Maps API v3 CSS3 and a brief introduction to Google Maps API v3
CSS3 and a brief introduction to Google Maps API v3
 
Learn html Basics
Learn html BasicsLearn html Basics
Learn html Basics
 
GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1
 
Html 5 Forms
Html 5 FormsHtml 5 Forms
Html 5 Forms
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Intr To Html & Xhtml
Intr To Html & XhtmlIntr To Html & Xhtml
Intr To Html & Xhtml
 

Viewers also liked

Pratiyogita darpan extra issue new reasoning test {exam oriented} [series-1...
Pratiyogita darpan extra issue   new reasoning test {exam oriented} [series-1...Pratiyogita darpan extra issue   new reasoning test {exam oriented} [series-1...
Pratiyogita darpan extra issue new reasoning test {exam oriented} [series-1...Jagroop Yadav
 
Enterpreneurship notes ME 5 sem BE RGPV
Enterpreneurship notes  ME 5 sem BE RGPVEnterpreneurship notes  ME 5 sem BE RGPV
Enterpreneurship notes ME 5 sem BE RGPVDr Md. Ilyas Khan
 
Data Structure Part II
Data Structure Part IIData Structure Part II
Data Structure Part IINANDINI SHARMA
 
Data Structure Part III
Data Structure Part IIIData Structure Part III
Data Structure Part IIINANDINI SHARMA
 
Database Management System
Database Management SystemDatabase Management System
Database Management SystemNANDINI SHARMA
 
Computer Network MAC Layer Notes as per RGPV syllabus
Computer Network MAC Layer Notes as per RGPV syllabusComputer Network MAC Layer Notes as per RGPV syllabus
Computer Network MAC Layer Notes as per RGPV syllabusNANDINI SHARMA
 
Data Structure Notes Part-1
Data Structure Notes Part-1 Data Structure Notes Part-1
Data Structure Notes Part-1 NANDINI SHARMA
 
Web engineering UNIT V as per RGPV syllabus
Web engineering UNIT V as per RGPV syllabusWeb engineering UNIT V as per RGPV syllabus
Web engineering UNIT V as per RGPV syllabusNANDINI SHARMA
 
Web Engineering UNIT III as per RGPV Syllabus
Web Engineering UNIT III as per RGPV SyllabusWeb Engineering UNIT III as per RGPV Syllabus
Web Engineering UNIT III as per RGPV SyllabusNANDINI SHARMA
 
Number System (Computer)
Number System (Computer)Number System (Computer)
Number System (Computer)NANDINI SHARMA
 
Basic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV SyllabusBasic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV SyllabusNANDINI SHARMA
 
Computer Network Unit I RGPV
Computer Network Unit I RGPV Computer Network Unit I RGPV
Computer Network Unit I RGPV NANDINI SHARMA
 
Biometric security Presentation
Biometric security PresentationBiometric security Presentation
Biometric security PresentationPrabh Jeet
 
Web engineering UNIT IV as per RGPV syllabus
Web engineering UNIT IV as per RGPV syllabusWeb engineering UNIT IV as per RGPV syllabus
Web engineering UNIT IV as per RGPV syllabusNANDINI SHARMA
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT IINANDINI SHARMA
 
Bce notes unit 1 be 205
Bce notes unit 1 be 205Bce notes unit 1 be 205
Bce notes unit 1 be 205NANDINI SHARMA
 

Viewers also liked (20)

Cs gate-2012
Cs gate-2012Cs gate-2012
Cs gate-2012
 
Sample psycho
Sample psycho Sample psycho
Sample psycho
 
Pratiyogita darpan extra issue new reasoning test {exam oriented} [series-1...
Pratiyogita darpan extra issue   new reasoning test {exam oriented} [series-1...Pratiyogita darpan extra issue   new reasoning test {exam oriented} [series-1...
Pratiyogita darpan extra issue new reasoning test {exam oriented} [series-1...
 
Ias english notes
Ias english notesIas english notes
Ias english notes
 
Enterpreneurship notes ME 5 sem BE RGPV
Enterpreneurship notes  ME 5 sem BE RGPVEnterpreneurship notes  ME 5 sem BE RGPV
Enterpreneurship notes ME 5 sem BE RGPV
 
Data Structure Part II
Data Structure Part IIData Structure Part II
Data Structure Part II
 
Data Structure Part III
Data Structure Part IIIData Structure Part III
Data Structure Part III
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Computer Network MAC Layer Notes as per RGPV syllabus
Computer Network MAC Layer Notes as per RGPV syllabusComputer Network MAC Layer Notes as per RGPV syllabus
Computer Network MAC Layer Notes as per RGPV syllabus
 
Data Structure Notes Part-1
Data Structure Notes Part-1 Data Structure Notes Part-1
Data Structure Notes Part-1
 
Queueing theory
Queueing theoryQueueing theory
Queueing theory
 
Web engineering UNIT V as per RGPV syllabus
Web engineering UNIT V as per RGPV syllabusWeb engineering UNIT V as per RGPV syllabus
Web engineering UNIT V as per RGPV syllabus
 
Web Engineering UNIT III as per RGPV Syllabus
Web Engineering UNIT III as per RGPV SyllabusWeb Engineering UNIT III as per RGPV Syllabus
Web Engineering UNIT III as per RGPV Syllabus
 
Number System (Computer)
Number System (Computer)Number System (Computer)
Number System (Computer)
 
Basic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV SyllabusBasic Computer Engineering Unit II as per RGPV Syllabus
Basic Computer Engineering Unit II as per RGPV Syllabus
 
Computer Network Unit I RGPV
Computer Network Unit I RGPV Computer Network Unit I RGPV
Computer Network Unit I RGPV
 
Biometric security Presentation
Biometric security PresentationBiometric security Presentation
Biometric security Presentation
 
Web engineering UNIT IV as per RGPV syllabus
Web engineering UNIT IV as per RGPV syllabusWeb engineering UNIT IV as per RGPV syllabus
Web engineering UNIT IV as per RGPV syllabus
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT II
 
Bce notes unit 1 be 205
Bce notes unit 1 be 205Bce notes unit 1 be 205
Bce notes unit 1 be 205
 

Similar to Basic html tutorial

Similar to Basic html tutorial (20)

Lesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdfLesson 8 Computer Creating your Website.pdf
Lesson 8 Computer Creating your Website.pdf
 
Html tutorials
Html tutorialsHtml tutorials
Html tutorials
 
In Class Assignment 1 .docx
In Class Assignment 1                                        .docxIn Class Assignment 1                                        .docx
In Class Assignment 1 .docx
 
Notes4
Notes4Notes4
Notes4
 
WDD
WDDWDD
WDD
 
Web topic 3 html format tags
Web topic 3  html format tagsWeb topic 3  html format tags
Web topic 3 html format tags
 
Basic html training national
Basic html training nationalBasic html training national
Basic html training national
 
HTML Bootcamp
HTML BootcampHTML Bootcamp
HTML Bootcamp
 
HTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docxHTML Lab ProjectTo create a simple web page you will need .docx
HTML Lab ProjectTo create a simple web page you will need .docx
 
HTML
HTMLHTML
HTML
 
HTML-INTRO.pptx
HTML-INTRO.pptxHTML-INTRO.pptx
HTML-INTRO.pptx
 
introduction to html.ppt
introduction to html.pptintroduction to html.ppt
introduction to html.ppt
 
ARTICULOENINGLES
ARTICULOENINGLESARTICULOENINGLES
ARTICULOENINGLES
 
Formatting your web page
Formatting your web pageFormatting your web page
Formatting your web page
 
Web Designing Training in Ambala ! BATRA COMPUTER CENTRE
Web Designing Training in Ambala ! BATRA COMPUTER CENTREWeb Designing Training in Ambala ! BATRA COMPUTER CENTRE
Web Designing Training in Ambala ! BATRA COMPUTER CENTRE
 
Html introduction
Html introductionHtml introduction
Html introduction
 
Web Design.ppt
Web Design.pptWeb Design.ppt
Web Design.ppt
 
Basic Html Notes
Basic Html NotesBasic Html Notes
Basic Html Notes
 
HTML
HTMLHTML
HTML
 
html tags
 html tags html tags
html tags
 

More from Ravi Rajput

Audio visual round fun quiz competition
Audio visual round fun quiz competitionAudio visual round fun quiz competition
Audio visual round fun quiz competitionRavi Rajput
 
Mozilla Firefox 10 Principles
Mozilla Firefox 10 PrinciplesMozilla Firefox 10 Principles
Mozilla Firefox 10 PrinciplesRavi Rajput
 
Presentation over Wi-Fi technology
Presentation over Wi-Fi technologyPresentation over Wi-Fi technology
Presentation over Wi-Fi technologyRavi Rajput
 
UTU Syllabus for CSE & IT 2nd year
UTU Syllabus for CSE & IT 2nd yearUTU Syllabus for CSE & IT 2nd year
UTU Syllabus for CSE & IT 2nd yearRavi Rajput
 
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)Ravi Rajput
 
Computer network unit 1 notes
Computer network unit  1 notesComputer network unit  1 notes
Computer network unit 1 notesRavi Rajput
 

More from Ravi Rajput (20)

Audio visual round fun quiz competition
Audio visual round fun quiz competitionAudio visual round fun quiz competition
Audio visual round fun quiz competition
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hacking
 
Mozilla Firefox 10 Principles
Mozilla Firefox 10 PrinciplesMozilla Firefox 10 Principles
Mozilla Firefox 10 Principles
 
Presentation over Wi-Fi technology
Presentation over Wi-Fi technologyPresentation over Wi-Fi technology
Presentation over Wi-Fi technology
 
UTU Syllabus for CSE & IT 2nd year
UTU Syllabus for CSE & IT 2nd yearUTU Syllabus for CSE & IT 2nd year
UTU Syllabus for CSE & IT 2nd year
 
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
Syllabus cs and_IT 2nd year UTU( Uttarakhand technical university)
 
Computer network unit 1 notes
Computer network unit  1 notesComputer network unit  1 notes
Computer network unit 1 notes
 
Cs gate-2011
Cs gate-2011Cs gate-2011
Cs gate-2011
 
Gate-Cs 2010
Gate-Cs 2010Gate-Cs 2010
Gate-Cs 2010
 
Gate-Cs 2009
Gate-Cs 2009Gate-Cs 2009
Gate-Cs 2009
 
Gate-Cs 2008
Gate-Cs 2008Gate-Cs 2008
Gate-Cs 2008
 
Cs 2008(1)
Cs 2008(1)Cs 2008(1)
Cs 2008(1)
 
Gate-Cs 2007
Gate-Cs 2007Gate-Cs 2007
Gate-Cs 2007
 
Gate-Cs 2006
Gate-Cs 2006Gate-Cs 2006
Gate-Cs 2006
 
Cs 2003
Cs 2003Cs 2003
Cs 2003
 
Cs 2002
Cs 2002Cs 2002
Cs 2002
 
Cs 2001
Cs 2001Cs 2001
Cs 2001
 
gate-Cs 2000
gate-Cs 2000gate-Cs 2000
gate-Cs 2000
 
Gate-Cs 1999
Gate-Cs 1999Gate-Cs 1999
Gate-Cs 1999
 
Gate-Cs 1998
Gate-Cs 1998Gate-Cs 1998
Gate-Cs 1998
 

Basic html tutorial

  • 1. Basic HTML Tutorial by Robert Frank, Team 358 HTML Structure HTML, or hypertext markup language, is very simple to learn and very simple to use. HTML is used in most modern websites. HTML has two basic forms: <name attribute1="value1" attribute2="value2">Content of 'name'</name> and <name attribute1="value1" attribute2="value2"> After you learn the basic form of HTML, you are ready to do some HTML coding. And just so you know, the capitalization of the name's of the basic structure and the attributes does not matter, while the capitalization of the values and contents of them do. HTML pages always start with a DTD, or document type definition. This allows the web-browser to determine what type of HTML you are using as well as what language the characters are in. The type of DTD that I would recommend is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> After the DTD, you would continue with the HTML tag, like so: <HTML> ... </HTML> HTML pages are broken into two main sections: the HEAD and the BODY, both contained within the HTML tags. The head contains the title and sometimes meta tags. The body contains the main page that everyone sees. A typical website looks something like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> ... </HEAD> <BODY> ... </BODY> </HTML> Page Title The title is the most important element of a quality web page. The title allows people to know what they are visiting and represents the page. When search engines add your website to their database, they add the title as what you see when searching for what you want. Page titles are very useful for letting your guests know just what is on you website. There can only be one title per page, so only the first code read containing the title will be shown. In order to add a title use the following code: <TITLE>this is the title</TITLE> Please note that this is one of the tags that will go within the HEAD tags. Here is an example of a web page:
  • 2. Simple Headings There are six different simple headings that can be used (H1 to H6). Many websites use headings. You can use the following code to make headers. <H1>This is the Heading</H1> <H2>This is the Heading</H2> <H6>This is the Heading</H6> Of the six different headings, <H1> produces the biggest, and <H6> produces the smallest. You can also center the headings by using the align attribute, as you can see here: <H1 ALIGN="center">This is the centered Heading</H1> Paragraphs Paragraphs are very useful and should be used. They can be created by using the following code: <P>This is a paragraph.</P> <P>This is a second paragraph.</P> New Lines/Spacing New lines are very important for making any website. In order to create a new line you would add the following code: <BR> Spacing is also very important. When using HTML, you can use just a space, but only up to the first space. Beyond the first space, the web-browser will just ignore. In order to do any amount, you must use the following code for each space wanted: &nbsp; Horizontal rules Horizontal lines can be added by doing the following code: <HR> You can also change the width of the line as well as align them to the left or right, as can be seen here: <HR ALIGN="left" WIDTH="50%"> Please note that you can have the width in pixels instead of percentages as well. You can also change the height in pixels by doing the following: <HR SIZE="5"> Comments Comments are very useful for people that want to identify things in their HTML. They are used when multiple people update website. They are also used to "block" the HTML code. The user does not see a comment unless they view the source code. You can add a comment by doing the following: <!-- This is the comment -->
  • 3. Changing Font Color/Face/Size Changing the font color, face and size are all relatively simple, and are all contained within the same HTML function. In order to just change the color, you can do the following: <FONT COLOR="red">This is the text that the color applies to</FONT> This is the text that the color applies to Within the color field you may name a color, as shown, or you may use the HEX code of the color, which is the preferred method, as seen below: <FONT COLOR="#FF0000">This is the text that the color applies to</FONT> This is the text that the color applies to The color in hex code has a lot more ability and I would recommend that you use it so that you can have a unique website. The hex code of red then green and blue, all up to 255 but in hexadecimal code. Please note that not all monitors display all colors. Changing the face of a font is also very simple and useful. You can change the face of the font to whatever font you wish, but be careful, if a user does not have that font installed on their computer, then it will just show the default font. You can change the face by using the following code: <FONT FACE="Webdings">This is the text that it applies to</FONT>         Because people may not have the specific font type that you want it is a good idea to have backup font types separating them by commas, as seen here: <FONT FACE="BobsFont,Wingdings,Times New Roman,Times,Courier New">This is the text that it applies to</FONT>         You can change the font size using two basic methods. You can do it by using the size attribute, or by using the style attribute. The code for the size attribute: <FONT SIZE="5">This is the text that it applies to</FONT> This is the text that it applies to Using this method, you can change the font from 1 to 7. I would not recommend this method. You could also make the font change, compared to what it was right before as can be seen here: <FONT SIZE="+2">This is the text that it applies to</FONT> This is the text that it applies to As you can notice the font size increased by two font sizes from what it was right before. You can go from -7 to +7, where the -7 decreases the font size by seven and the positive increases it by seven. Another method of changing the font size it by using the following: <SMALL>The small text<SMALL> The small text <BIG>The big text<BIG> The big text The more commonly seen font size can be changed by using the font style attribute. You can use this code for modifying that: <FONT STYLE="Font-Size:20px;">This is the text that it applies to</FONT> This is the text that it applies to By using this, you can easily modify the font size from 1 and on. this is what most programs and websites use as their font size. Bolding/Italicizing/Underlining/Striking You may also want to bold, italicize, or underline some of you website. It is very good for making things stand out. You can bold something using the following code: <B>This is the text that it applies to</B> This is the text that it applies to
  • 4. Or you may bold by doing the following: <STRONG>This is the text that it applies to</STRONG> This is the text that it applies to Or you may italicize using the following: <I>This is the text that it applies to</I> This is the text that it applies to And another way to italicize is: <EM>This is the text that it applies to</EM> This is the text that it applies to Or you may underline using the following: <U>This is the text that it applies to</U> This is the text that it applies to Or you may strikethrough text by using the following: <STRIKE>This is the text that it applies to</STRIKE> This is the text that it applies to Making Links Links are extremely useful for bringing the user to another page that may be within your website, or may be another website that you think would be useful to others. You can create a simple link using the following code: <A HREF="tutorials.php">This is the text that it applies to</A> This is the text that it applies to There are several different types of links, for local pages, you would use something like the above. For links to other sites, you may use something like the following: <A HREF="http://bobbys.us/tutorials.php">This is the text that it applies to</A> This is the text that it applies to There are many different things that you can do besides just simple links, but this is still very useful. Making Links in new windows You may occasionally need to open a new window for the user because you may not want them to leave you website or another reason. Many people these days do not like new windows though, and will just block all new windows. In fact in many 'top ten website mistakes', people place having new windows within the list. But if you want to make new windows, you can use the following code: <A HREF="http://bobbys.us/tutorials.php" TARGET="_BLANK">This is the text that it applies to</A> This is the text that it applies to Making Links to email addresses Many times you may also want to have a link to your email address. I personally do not like the method and would recommend using a script to send the mail for you, but it is always a good thing to know. To add a link to ayou can use the following code: <A HREF="mailto:admin@bobbys.us">E-mail me</A> E-mail me Please be warned, it is dangerous to place your email address like this, there are many crawlers out there just looking for emails like this. Once crawlers collect emails, lists are sold to spammers. This is how many people get a lot of spam.
  • 5. Linking to somewhere in the page You may also have a large page and want to link to different pieces of the webpage. In order to do this, first you must make location to link to. You can do this by using the 'name' attribute on the 'A' element, as can be seen here: <A NAME="section1">Section One - Downloads</A> This would create a place to link to called 'section1'. You can link to it by using the following code: <A HREF="#section1">Go to downloads</A> or by putting the name of the HTML document, like so: <A HREF="tutorials.php#section1">Go to downloads</A> Adding images You may also want to create image. Images are simple to add, and are very useful for showing pictures or diagrams. To add an image you can use the following code: <IMG SRC="images/one.gif" ALT="alternate text"> Once you add an image, you may notice that there is a border when you make the image a link. In order to get rid of this you will have to change the border attribute. Here is an example of how to change the border to a size of 0: <IMG SRC="images/one.gif" ALT="alternate text" BORDER="0"> Centering Text When making your page, you may also want to center your header or whatever else. In order to center text you make use the following code: <CENTER>This is the text that it applies to</CENTER> This is the text that it applies to Special Characters In many cases you may find that you may need to insert special characters. They are very simple to insert, if you know what each character is. As you may remember we added a space by using &nbsp;. Other special characters can be added by doing & followed by the code for them, which can be found here (please note: this is not on my site), and then you would place a semi-colon afterwards. here are some examples: &#169; produces © &#38; produces & &#162; produces ¢ &#174; produces ® &#177; produces ± &#178; produces _ etc... Lists You may also have lists of items that you will need to add. There are several types of lists. The two most common ones are ordered and unordered lists. Ordered lists are called ordered lists because they have numbers for people to
  • 6. be guided by. Here is an example of an ordered list: <OL> <LI>Item one</LI> <LI>Item two</LI> <LI>Item three</LI> </OL> 1. Item one 2. Item two 3. Item three There are also different types of ordered lists. Here is an example of a specific type of ordered list: <OL TYPE="I"> <LI>Item one</LI> <LI>Item two</LI> <LI>Item three</LI> </OL> I. Item one II. Item two III. Item three The 'TYPE' attribute can contain one the following types: 1, a, A, i, or I. Unordered lists are similar to ordered lists, except that they have bullets instead of numbers. Here is an example of an unordered list: <UL> <LI>Item one</LI> <LI>Item two</LI> <LI>Item three</LI> </UL> • Item one • Item two • Item three Tables Tables are used in many websites. Although they are not always seen, tables are very good at aligning certain things. In fact, this website uses tables, but you probably cannot see them. Tables have many attributes that can be modified to fit exactly what you want. Simple tables can be added by doing the following: <TABLE BORDER="1"> <TR> <TD>top left</TD> <TD>top right</TD> </TR> <TR> <TD>bottom left</TD> <TD>bottom right</TD> </TR> </TABLE> top left top right bottom left bottom right Here is what it would look like without a border: <TABLE>
  • 7. <TR> <TD>top left</TD> <TD>top right</TD> </TR> <TR> <TD>bottom left</TD> <TD>bottom right</TD> </TR> </TABLE> top left top right bottom left bottom right You can simple add more rows by adding another <TR> with the columns. Here is an example with five rows: <TABLE BORDER="1"> <TR> <TD>top left</TD> <TD>top right</TD> </TR> <TR> <TD>row 2 - left</TD> <TD>row 2 - right</TD> </TR> <TR> <TD>row 3 - left</TD> <TD>row 3 - right</TD> </TR> <TR> <TD>row 4 - left</TD> <TD>row 4 - right</TD> </TR> <TR> <TD>bottom left</TD> <TD>bottom right</TD> </TR> </TABLE> top left top right row 2 - left row 2 - right row 3 - left row 3 - right row 4 - left row 4 - right bottom left bottom right You can also add columns by just adding a <TD> in each of the rows. Here is an example: <TABLE BORDER="1"> <TR> <TD>top left</TD> <TD>top - column 2</TD> <TD>top - column 3</TD> <TD>top right</TD> </TR> <TR> <TD>bottom left</TD> <TD>bottom - column 2</TD> <TD>bottom - column 3</TD> <TD>bottom right</TD>
  • 8. </TR> </TABLE> top left top - column 2 top - column 3 top right bottom left bottom - column 2 bottom - column 3 bottom right <TH> can be used instead of <TD>. The difference between the two is that TH is bolded and centered, whereas TD is left aligned and unbolded. There are also many more attributes for each column and row as well as the tables. Much more... There are also many more attributes and elements that I did not cover. You can visit http://www.w3.org/ to find all of the types of elements, now that you know the basics of HTML. One good HTMl cheatsheet is located at http://www.webmonkey.com/. And of course, look at what people have done on their website, by going to 'View Source,' it is a great way to learn HTML code. Validity of your page When you are done making your page, it is a good idea to make sure that it is valid. w3.org has created an online website validator. You can find their validator here: The W3C Markup Validation Service