html body { margin-top: 50px !important; } #top_form { position: fixed; top:0; left:0; width: 100%; margin:0; z-index: 2100000000; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; border-bottom:1px solid #151515; background:#FFC8C8; height:45px; line-height:45px; } #top_form input[name=url] { width: 550px; height: 20px; padding: 5px; font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif; border: 0px none; background: none repeat scroll 0% 0% #FFF; }
for paragraphs, for bold, for italic, and HTML Classes HTML Classes HTML Tags Ex: <b><i>welcome</i></b> <br> is an empty element without a closing tag (it defines a line break). In XHTML, XML, and future versions of HTML, all elements must be closed. Ex: <br/> HTML Attributes <html> This tag is used to indicate that this is a HTML document. Most HTML documents should start and end with this tag. <head> This tag is used to indicate the header section of the HTML document, which typically includes the <title> and <meta> tags, and is <title> The title is what is displayed on the upper left corner of your browser when you view a web page.. <meta> The <meta> tag information is not directly displayed when the page is rendered on the browser. Rather, this is <body> The <body> tag may contain several attributes are listed below: Attribute Description link <body background="background.jpg"> <html> o/p>-------------------------- Heading Styles </body> 0/p>--------------------------------------------------- This is heading 1 This is heading 4 This is heading 5 This is heading 6 <html> </body> o/p>-------------------------------------------------- <pre> <pre> </body> o/p>-------------------------------- for i = 1 to 10 <html> <code>Computer code</code> <p> </body> p/p>----------------------------------------- <html> <address> </body> o/p>-------------------------------------------- Tag Description <q> The <q> tag is supported in all major browsers, except Internet Explorer. Ex: </body> o/p>----------------------------------------------------------------------------- UN The title attribute is used to show the spelled-out version when holding the mouse pointer over the acronym or The <bdo> tag allows you to specify the text direction and override the bidirectional algorithm. <html> <p> <bdo dir="rtl"> </body> If your browser supports bi-directional override (bdo), the next line will be written from the right to the left (rtl): <html> <var>Variable</var><br /> <cite>Citation</cite> </body> 1) Ordered List 1) Ordered List:- list with numbers( 1,2,3 (or) a,b,c,.. (or) A,B,C,.. (or) i,ii.iii,… (or) I,II,III,…) <body> Example for Ordered List with Start Number and/or Type attributes: <body> <body> Note : In Unordered list Default bullet is Disk. We can write OL in UL. We can write OL in OL. We can write UL <html> <head> </head> <body> <ol> <ul> </ul> </ol> </body> </html> Definition List <body bgcolor=violet> <strong> Drinks </strong> <hr color=brown> <dl> <dt> Pepsi</dt> <dd>Health Drink</dd> <dd>Contains Chocolate</dd> </dl> </body> Images If both html file and image in the same folder then no need to give path Example <html> <body> </body> </html> Setting the height adjusts width and vice-versa. Pick the Image from Different Folder In your Folder Example <html> <body> </body> </html> Example Pick the Image from Different Folder which is out of your Folder <html> <body> </body> </html> Links Using anchor <a> tags we can establish the links form one page to another Page. Example red.html <hr/> </body> green.html <hr> <hr> </body> <body bgcolor=yellow> <hr> </body> Target = "_self” Opens the target Page in same page. (It is Default ) . Example <html> <head> </head> <body> </body> </html> <html> <head> </head> <body> </dody> </html> Example <body> </body> Example <html> <head> </head> <body> </body> </html> EX: Frames Example <html> <head> </head> <frameset rows="20%,50%,30%"> <frame src="a.html"> <frame src="b.html"> <frame src="c.html"> </frameset> </html> Example <html> <head> </head> <frameset rows="50%,50%"> <frameset cols="50%,50%"> <frame src="b.html"> </frameset> </frameset> </html> Note : If the browser is not supporting frames then <noframes> will Execute. <noframes> <body> </body> </noframes> Target <html> <head> </head> <frameset cols="50%,50%"> <frame src="links.html"> </frameset> </html> Links.html <html> <head> </head> </body> </html> Inline Frame Example <html> <head> </head> <body> <p>This is a Paragraph</p> <ol> </ol> </body> </html> Designing Tables Example <html> <head> <body > <table border=1> <tr> </tr> <tr> </tr> </table> </body> </html> Example <html> <head> </head> <body > <tr> </tr> <tr> <td> 1 </td> </tr> <tr> <td> 2 </td> </tr> </table> </body> </html> Example <html> <head> </head> <body > <tr> <td> 1 </td> </tr> </tfoot> <tr> <td> 2 </td> </tr> <thead> <tr> </tr> </thead> <tbody> <tr> <td> 3 </td> </tr> </table> </body> </html> Table Attributes Bgcolor Background Border Height Width Examples If you give both bgcolor and background for a single table then high Priority is given for background Valign will not work in HTML so we have to write CSS coding instead of Valign Attributes of TD Bgcolor Background Width Height Col span Row span Example 1 <tr> </tr> <tr> <td> 2 </td> </tr> </table> For Height complete Row will be affected. For Width complete Column will be affected Example 2 <table border=10> <tr> </tr> <tr> </tr> </table> Example 3 <tr> </tr> <tr> </tr> </table> <html> <head> </head> <body > <tr> <tr> </tr> <tr> </tr> </table> </td> </tr> <tr> </tr> </table> </body> </html> Designing Forms <html> <body> <br> <select name=country> </select> <br> </select> <br> </form> </body> </html> Note : In text box we can give attribute maxlength to restrict the length of text. In a Text Box Maximum we can give 160 characters. In XHTML consists of all the elements in HTML 4.01, combined with the strict syntax of XML. Why XHTML? The following HTML code will work just fine if you view it in a browser (even if it does NOT follow the HTML rules): <html> <body> <h1>Bad HTML </body> XML is a markup language where everything must be marked up correctly, which results in "well formed" documents. XML is designed In HTML, some elements can be improperly nested within each other, like this: In XHTML, all elements must be properly nested within each other, like this: Note: A common mistake with nested lists, is to forget that the inside list must be within <li> and </li> tags. <ul> <li>Coffee</li> <li>Tea <ul> <li>Black tea</li> <li>Green tea</li> </ul> <li>Milk</li> </ul> <ul> <li>Coffee</li> <li>Tea <ul> <li>Black tea</li> <li>Green tea</li> </ul> </li> <li>Milk</li> </ul> Notice that we have inserted a </li> tag after the </ul> tag in the "correct" code example. XHTML Elements must be Closed. Nonempty This is wrong <p>This is a paragraph This is correct <p>This is a paragraph</p> Empty Elements Must Also Be Closed. Empty elements must also be closed. This is wrong A break: <br> This is correct This is wrong: <BODY> <P>This is a paragraph</P> </BODY> This is correct: <body> <p>This is a paragraph</p> </body> All XHTML elements must be nested within the <html> root element. Child elements must be in pairs and correctly nested within their <html> </html> and
for unordered and ordered lists. HTML documents also use tags like
Uploaded by
Jeremiah EliorUploaded by
Jeremiah EliorHTML
(Hyper Text Markup Language)
HTML is a language for describing web pages.
A markup language is a set of markup tags
HTML uses markup tags to describe web pages HTML tags are keywords surrounded by angle brackets like <html>
HTML tags normally come in pairs like <b> (start tag) and </b> (end tag)
HTML tags are not case sensitive: <P> means the same as <p>.Editing HTML Files:
Notepad
Dreamweaver
FrontPage
HTML BulderHTML File Extension:
To save an HTML file, we can use either the .htm or the .html extension. With new software it is perfectly safe to use
.html.Nested HTML Elements
Most HTML elements can be nested (can contain other HTML elements).Empty HTML Elements
HTML elements without content are called empty elements. Empty elements can be closed in the start tag. Attributes provide additional information about the element
Attributes are always specified in the start tag
Attributes come in name/value pairs like: name="value"
HTML Comments: Comments are ignored by the browser and are not displayed .Ex: <! This is a comment >
Basic HTML Tags: <html>, <title>, <meta> and <body>
not displayed in the main window of the browser. <title> tag indicate what the page content is.
used for the author of the HTML page to record information related to this page. Two common attributes are
name and content.The <body> tag includes the HTML body of the document.
alink The color of the links.
Specifies the color of an active link in a documentbackground Specifies a background image for a document
bgcolor Specifies the background color of a document
Specifies the default color of unvisited links in a document
text Specifies the color of the text in a documentvlink Specifies the color of the visited links in a document
Ex: <body bgcolor="#ffffff" text="yellow">
So, in general, all HTML documents have the following format:
<head>
<title>
Here is the title of the HTML document.
</title>
<meta name="Ganesh " content="Sample HTML " />
</meta>
</head>
<body bgcolor="ff00ff”>
Here is the body of the HTML document.
</body>
</html>
Here is the body of the HTML document.
<html>
<body><h1 align=”center”>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</html>
This is heading 2
This is heading 3* <h1 style="text-align:center">This is heading 1</h1>
* <body style="background-color:yellow"> background
HTML Formatting Text Examples
<p> tag used for Paragraph.
<body><p><b>This text is bold </b></p>
<p><strong>This text is strong </strong></p>
<p><big>This text is big</big></p>
<p><em>This text is emphasized</em></p>
<p><i>This text is italic</i></p>
<p><small>This text is small</small></p>
<p>This is<sub> subscript</sub> and <sup>superscript</sup></p>
</html>This text is bold
This text is strong
This text is big
This text is emphasized
This text is italic
This text is small
This is subscript and superscript
<pre>:Preformatted text (how to control line breaks and spaces)
<html>
<body>
This is
preformatted text.
It preserves both spaces
and line breaks.
</pre><p>The pre tag is good for displaying computer code:</p>
for i = 1 to 10
print i
next i
</pre>
</html>
This is
preformatted text.
It preserves both spaces
and line breaks.The pre tag is good for displaying computer code:
print i
next iDifferent computer-output tags:-
Line Breaks: <br/> tag.Horizontal rule: <hr/>
Attributes: align, width, size, color
<body>
<br>
<kbd>Keyboard input</kbd>
<br>
<tt>Teletype text</tt>
<br>
<samp>Sample text</samp>
<br>
<var>Computer variable</var>
<br>
<b>Note:</b> These tags are often used to display computer/programming code.
</p>
</html>
Computer code
Keyboard input
Teletype text
Sample text
Computer variable
Note: These tags are often used to display computer/programming code.
<body>
Millennium Software Solutions<br>
Dwarakanagar<br>
Vizag<br>
INDIA
</address>
</html>
Millennium Software Solutions
Dwarakanagar
Vizag
INDIAText Formatting Tags
<b> Defines bold text
<big> Defines big text
<em> Defines emphasized text
<i> Defines italic text
<small> Defines small text<strong> Defines strong text
<sub> Defines subscripted text
<sup> Defines superscripted text
<ins> Defines inserted text
<del> Defines deleted text
<s> Deprecated. Use <del> instead
<strike> Deprecated. Use <del> instead
<u> Deprecated. Use styles instead
Citations, Quotations, and Definition Tags
Tag Description<abbr> Defines an abbreviation
<acronym> Defines an acronym
<address> Defines an address element
<bdo> Defines the text direction
<blockquote> Defines a long quotation
Defines a short quotation
<cite> Defines a citation
<dfn> Defines a definition term
<html>
<body><abbr title="United Nations">UN</abbr>
<br />
<acronym title="World Wide Web">WWW</acronym>
<p>The title attribute is used to show the spelled-out version when holding the mouse pointer over the acronym or
abbreviation.</p>
</html>
WWW
abbreviation<bdo> stand for bidirectional override.
<body>
If your browser supports bi-directional override (bdo), the next line will be written from the right to the left (rtl):
</p>
Here is some Hebrew text
</bdo>
</html>
o/p>-----------------------------------------------------------Here is some Hebrew text
<body><em>Emphasized text</em><br />
<strong>Strong text</strong><br />
<dfn>Definition term</dfn><br />
<code>Computer code text</code><br />
<samp>Sample computer code text</samp><br />
<kbd>Keyboard text</kbd><br />
</html>
O/P>-----------------------------------------------
Emphasized text
Strong text
Definition term
Computer code text
Sample computer code text
Keyboard text
Variable
CitationHTML List are of 3 Types
2) Unordered List
3) Definition List
<ol> tag (Order list)
<li> tag (List Item)Example for Ordered List:
<ol >
<li> Java </li>
<li> ASP </li>
<li> PHP </li>
</ol>
</body>
<ol start=10>
<li> Java </li>
<li> ASP </li>
<li> PHP </li>
</ol>
</body>Example for Ordered List with type of Numbering
<html>
<head>
</head>
<body>
<ol Type="A">
<li> Java </li>
<li> ASP </li>
<li> PHP </li>
</ol>
</body>
</html>Note : You can use a,i,I for the Type.
Unordered List with 3 types :
Circle
Square
DiskExample for Un-Ordered List with type of Bullet
<ul Type="circle">
<li> PHP </li>
<li> JAVA </li>
</ul>
</body>
in OL. We can write UL in UL.Example for Un-Ordered List within Ordered List
<li> Databases </li>
<li> Oracle </li>
<li> SQL Server </li>
<li> Programming </li>
<li> Testing </li>A definition list is not a list of single items. It is a list of items.
A definition list starts with a <dl> tag (definition list).
Each term starts with a <dt> tag (definition term).
Each description starts with a <dd> tag (definition description).
Example using Definition List
<dd>Cool Drink </dd>
<dd>Contains Alcohol </dd>
<dt> Boost </dt>
<img src=”path of file”>
<img src=”path of file” alt=”This is an Image”>
If the Browser can not display Image with any reasons then Alternative text will display.<img src="sunset.jpg" alt="Sunset Image" border="10" width=250 height=300 align=right>
<img src="Images/roses.jpg" alt="Rose Flower" border="10">
Absolute Path : Path According to Drivers
Relative Path : Path According to Reference File
<img src="../roses.jpg" alt=" Rose Flower " border="10">
Syntax : <a href = " Path of HTML file"> text </a>
<body bgcolor=red text=yellow>
<Hr/>This is Red file
<body bgcolor=green text=blue>
This is green file
Color.html (main file)
<a href="red.html"> Red Page </a> <br>
<a href="green.html"> Green Page </a>
Target is an attribute of anchor Tag.
Target = "_blank” Opens the target Page in new page.
<a href="a.html" target="_blank"> Page A </a> <br>
<a href="b.html" target="_self"> Page B </a>
Note : Images can also be taken as Links
Example <a href="b.html"> <img src="sunset.jpg" height=70 > </a>
Links With in Same Page
<a href="#c1" name="abc"> Chapter 1 </a> <br>
<a href="#c2" > Chapter 2 </a> <br>
<a href="#c3" > Chapter 3 </a> <br>
MSS Homepage <br>
<a name="c1"> welcome to Chapter 1 </a> <br>
<a name="c2"> welcome to Chapter 2 </a> <br>
<a name="c3"> welcome to Chapter 3 </a> <br>
<a href="#abc"> TOP </a>
Using links Directly we can go to Required Page and Chapter.
<a href="ex1.html#c3"> Link to chapter3 </a>
<font> TAG:-<font color="#0000FF" face="Arial" size="5" > WELCOME </font>
Used to Open multiple html pages in a single browser window.
Frames should not be written in <body>
<frame src="a.html" noresize="noresize">
<frame src="c.html"> <p> Upgrade your browser to see this information </p>
<frame src="c.html" name="abc">
<body> <a href="a.html" target="abc"> Page A </a> <br>
<a href="b.html" target="abc"> Page B </a>
We can design a frame in body with using inline frame.
<li> Oracle </li>
<li> Informix </li>
<iframe src="a.html" width=200 height=50> </iframe>
</head> <td> cell1 </td>
<td> cell2 </td>
<td> cell3 </td>
<td> cell4 </td>
Height and width are attributes of <table>
<table border=1 height=400 width=400>
Table Heading : Table heading will display in bold and in center
<table border=1 >
<caption > Employee Table </caption>
<th> Eno </th>
<th> Ename </th> <th> Esal </th>
<td> Janardhan </td>
<td> 20000 </td>
<td> Madhu </td>
<td> 25000 </td>
Other Table Tags
<thead> will display on Top
<tbody> will display in the Center
<tfoot> will display Last <table border=1 >
<tfoot> <td> Janardhan </td>
<td> 20000 </td>
<td> Madhu </td>
<td> 25000 </td>
<th> Eno </th>
<th> Ename </th>
<th> Esal </th>
<td> Suresh </td>
<td> 3000 </td>
</tbody>Cell padding ( Displacement between border & content)
Cell spacing ( Displacement between Individual cells)
Align ( Control table Position Horizontally)
Valign ( Control table Position Vertically)
1) <table bgcolor=red >
2) <table background="sunset.jpg" >
<table bgcolor=red background="sunset.jpg" >
<table border=10 >
<table border=10 cellpadding=50 >
<table border=10 cellspacing=50 >
<table border=10 align=right ><table border=10 align=center >
EX : <table border=10 style="position:absolute;top:200;left:150" >
Align ( left , right , center )
Valign ( Top , middle , bottom)
<table border=10 >
<td bgcolor=red> 1 </td>
<td background="sunset.jpg"> Siva </td>
<td height =200 width = 200> 20000 </td>
<td> Brahma </td>
<td> 25000 </td> <td bgcolor=red> 1 </td>
<td background="sunset.jpg"> Vishnu </td>
<td height =200 width = 200> 20000 </td>
<td align=right height=100 width=100> 2 </td>
<td align=center width=100> Lakshmi </td>
<td valign=top width=100 > 25000 </td>
<table border=1 height=300 width=300 >
<td> Cell1 </td>
<td colspan=2> Cell2 </td>
<td rowspan=2> Cell4 </td>
<td> Cell5 </td> <td> Cell6 </td>
<tr> <td colspan=2> Cell7 </td> </tr>
Table with in Table
<table border=1 height=300 width=300>
<td> <table border=1>
<td> cell5 </td>
<td> cell6 </td>
<td> cell7 </td>
<td> cell8 </td> <td> cell2 </td>
<td> cell3 </td>
<td> cell4 </td>
<form method=POST action=a.php>
Username : <input type=text name=user id=u value=Ram> <br>
Password : <input type=password name=pwd id=p > <br>
Age: <input type=text size=2 name=age id=a><br>
Sex: <input type=radio name=sex id=s1 value=M>Male
<input type=radio name=sex id=s2 value=F>Female<br>Choose your Favourite Sport
<input type=checkbox name=interest id=v1 value=crick>Cricket
<input type=checkbox name=interest id=v2 value=tenis>Tennis
Select your Country
<option value=ind> India </option>
<option value=uk> England </option>
<option value=us> USA </option>
<option value=aus> Australia </option>
Favourite Holiday Spot <br>
<select multiple size=3 name=hspot>
<option value=africa> America </option>
<option value=europe> Europe </option>
<option value=asia> Switzerland </option>
<option value=australia> Australia </option>
Complete Address <br><textarea name=addrs rows=5 cols=50></textarea> <br>
Resume : <input type=file name=resume id=res> <Br>
<input type=reset name=clear id=c value=Reset>
<input type=submit value="Continue">
<input type=button name=close id=s value=close>
List Box we can select multiple items with using attribute multiple. Every Object should have name , id ( names can be same but id s
must be unique). If you select radio buttons or check boxes or combo boxes or list boxes then the value will be returned, so value
attribute is recommended for these objects.XHTML (XHTML stands for EXtensible HyperText Markup Language)
XHTML is almost identical to HTML 4.01
XHTML is a stricter and cleaner version of HTML
XHTML is HTML defined as an XML application
XHTML is a combination of HTML and XML (EXtensible Markup Language).
Many pages on the internet contain "bad" HTML.
<head><title>This is bad HTML</title>
to describe data, and HTML is designed to display data. Some browsers run on computers, and some browsers run on mobile phones or
other small devices. mobile phones or other small devices do not have the resources or power to interpret a "bad" markup language.
Therefore by combining HTML and XML, and their strengths, we got a markup language that is useful now and in the future is XHTML.
Get Ready For XHTML. XHTML is not very different from the HTML 4.01 standard. So, bringing your code up to the 4.01 standard is a
good start. In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER skip closing tags (like </p>).The most important differences between HTML and XHTML
XHTML elements must be properly nested
XHTML elements must always be closed
XHTML elements must be in lowercase
XHTML documents must have one root element
XHTML Elements Must Be Properly Nested<b><i>This text is bold and italic</b></i>
<b><i>This text is bold and italic</i></b>
Invalid Method writing the script
This is correct:
elements must have a closing tag.<p>This is another paragraph
<p>This is another paragraph</p>
A horizontal rule: <hr>
An image: <img src="happy.gif" alt="Happy face">
A break: <br />
A horizontal rule: <hr />
An image: <img src="happy.gif" alt="Happy face" />
XHTML Elements Must Be In Lower CaseTag names and attributes must be in lower case.
XHTML Documents Must Have One Root Element
parent element.The basic document structure is:
<head> ... </head>
<body> ... </body>
You might also like