The Realm Welcome to The Realm ~ Provehito In Altum |
| | HTML Codes | |
| | Author | Message |
---|
Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: HTML Codes Sun Sep 09, 2007 2:27 am | |
| What is an HTML File? * HTML stands for Hyper Text Markup Language * An HTML file is a text file containing small markup tags * The markup tags tell the Web browser how to display the page * An HTML file must have an htm or html file extension * An HTML file can be created using a simple text editor Do You Want to Try It? If you are running Windows, start Notepad. If you are on a Mac, start SimpleText. In OSX start TextEdit and change the following preferences: Open the the "Format" menu and select "Plain text" instead of "Rich text". Then open the "Preferences" window under the "Text Edit" menu and select "Ignore rich text commands in HTML files". Your HTML code will probably not work if you do not change the preferences above! Type in the following text: - Code:
-
<html> <head> <title>Title of page</title> </head> <body> This is my first homepage. <b>This text is bold</b> </body> </html> Save the file as "mypage.htm". Start your Internet browser. Select "Open" (or "Open Page") in the File menu of your browser. A dialog box will appear. Select "Browse" (or "Choose File") and locate the HTML file you just created - "mypage.htm" - select it and click "Open". Now you should see an address in the dialog box, for example "C:\MyDocuments\mypage.htm". Click OK, and the browser will display the page. Example Explained The first tag in your HTML document is <html>. This tag tells your browser that this is the start of an HTML document. The last tag in your document is </html>. This tag tells your browser that this is the end of the HTML document. The text between the <head> tag and the </head> tag is header information. Header information is not displayed in the browser window. The text between the <title> tags is the title of your document. The title is displayed in your browser's caption. The text between the <body> tags is the text that will be displayed in your browser. The text between the and tags will be displayed in a bold font. HTM or HTML Extension? When you save an HTML file, you can use either the .htm or the .html extension. We have used .htm in our examples. It might be a bad habit inherited from the past when some of the commonly used software only allowed three letter extensions. With newer software we think it will be perfectly safe to use .html. Note on HTML Editors: You can easily edit HTML files using a WYSIWYG (what you see is what you get) editor like FrontPage or Dreamweaver, instead of writing your markup tags in a plain text file. However, if you want to be a skillful Web developer, we strongly recommend that you use a plain text editor to learn your primer HTML. Frequently Asked Questions Q: After I have edited an HTML file, I cannot view the result in my browser. Why? A: Make sure that you have saved the file with a proper name and extension like "c:\mypage.htm". Also make sure that you use the same name when you open the file in your browser. Q: I have edited an HTML file, but the changes don't show in the browser. Why? A: A browser caches pages so it doesn't have to read the same page twice. When you have modified a page, the browser doesn't know that. Use the browser's refresh/reload button to force the browser to reload the page. Q: What browser should I use? A: You can do all the training with all of the well-known browsers, like Internet Explorer, Firefox, Netscape, or Opera. However, some of the examples in our advanced classes require the latest versions of the browsers. Q: Does my computer have to run Windows? What about a Mac? A: You can do all your training on a non-Windows computer like a Mac. - Code:
-
Basic HTML Tags Tag Description <html> Defines an HTML document <body> Defines the document's body <h1> to <h6> Defines header 1 to header 6 <p> Defines a paragraph <br> Inserts a single line break <hr> Defines a horizontal rule <!--> Defines a comment - Code:
-
Text Formatting Tags Tag Description <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 - Code:
-
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 <q> Defines a short quotation <cite> Defines a citation <dfn> Defines a definition term An anchor can point to any resource on the Web: an HTML page, an image, a sound file, a movie, etc. The syntax of creating an anchor: - Code:
-
Link Tags Tag Description <a> Defines an anchor - Code:
-
<a href=" url "> Text to be displayed </a> The - Code:
-
<a> tag is used to create an anchor to link from, the href attribute is used to address the document to link to, and the words between the open and close of the anchor tag will be displayed as a hyperlink. Frames With frames, you can display more than one HTML document in the same browser window. Each HTML document is called a frame, and each frame is independent of the others. The disadvantages of using frames are: * The web developer must keep track of more HTML documents * It is difficult to print the entire page The Frameset Tag * The <frameset> tag defines how to divide the window into frames * Each frameset defines a set of rows or columns * The values of the rows/columns indicate the amount of screen area each row/column will occupy The Frame Tag * The <frame> tag defines what HTML document to put into each frame In the example below we have a frameset with two columns. The first column is set to 25% of the width of the browser window. The second column is set to 75% of the width of the browser window. The HTML document "frame_a.htm" is put into the first column, and the HTML document "frame_b.htm" is put into the second column: - Code:
-
<frameset> <frame> <frame> </frameset>' - Code:
-
Frame Tags Tag Description <frameset> Defines a set of frames <frame> Defines a sub window (a frame) <noframes> Defines a noframe section for browsers that do not handle frames <iframe> Defines an inline sub window (frame) More info will follow! | |
| | | valhalla Banned
Number of posts : 1456 Age : 37 Location : the underworld Points : Registration date : 2007-08-03
| Subject: Re: HTML Codes Sun Sep 09, 2007 6:07 am | |
| wow. that's cool. i've wanted to know how to doOo html coding, this guide is pretty helpful | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: Re: HTML Codes Sun Sep 09, 2007 7:04 am | |
| I will add more codes later | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: Re: HTML Codes Sun Sep 09, 2007 8:21 am | |
| Part 2 With HTML you can create tables. Tables Tables are defined with the - Code:
-
<table> tag. A table is divided into rows (with the tag), and each row is divided into data cells (with the tag). The letters td stands for "table data," which is the content of a data cell. A data cell can contain text, images, lists, paragraphs, forms, horizontal rules, tables, etc.
- Code:
-
<table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> Tables and the Border Attribute
If you do not specify a border attribute the table will be displayed without any borders. Sometimes this can be useful, but most of the time, you want the borders to show.
To display a table with borders, you will have to use the border attribute:
- Code:
-
<table border="1"> <tr> <td>Row 1, cell 1</td> <td>Row 1, cell 2</td> </tr> </table>
Headings in a Table
Headings in a table are defined with the <th> tag.
Example:
- Code:
-
<table border="1"> <tr> <th>Heading</th> <th>Another Heading</th> </tr> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> Note that the borders around the empty table cell are missing (NB! Mozilla Firefox displays the border).
To avoid this, add a non-breaking space ( ) to empty data cells, to make the borders visible: '
- Code:
-
<table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td> </td> </tr> </table>
- Code:
-
Table Tags Tag Description <table> Defines a table <th> Defines a table header <tr> Defines a table row <td> Defines a table cell <caption> Defines a table caption <colgroup> Defines groups of table columns <col> Defines the attribute values for one or more columns in a table <thead> Defines a table head <tbody> Defines a table body <tfoot> Defines a table footer
HTML supports ordered, unordered and definition lists.
Unordered Lists
An unordered list is a list of items. The list items are marked with bullets (typically small black circles).
An unordered list starts with the tag. Each list item starts with the - tag.
- Code:
-
<ul> <li>Coffee</li> <li>Milk</li> </ul> Inside a list item you can put paragraphs, line breaks, images, links, other lists, etc.
Ordered Lists
An ordered list is also a list of items. The list items are marked with numbers.
An ordered list starts with the tag. Each list item starts with the - tag.
- Code:
-
<ol> <li>Coffee</li> <li>Milk</li> </ol>
Definition Lists
A definition list is not a list of items. This is a list of terms and explanation of the terms.
A definition list starts with the <dl> tag. Each definition-list term starts with the <dt> tag. Each definition-list definition starts with the <dd> tag.
- Code:
-
<dl> <dt>Coffee</dt> <dd>Black hot drink</dd> <dt>Milk</dt> <dd>White cold drink</dd> </dl>
inside a definition-list definition (the <dd> tag) you can put paragraphs, line breaks, images, links, other lists, etc.
- Code:
-
List Tags Tag Description <ol> Defines an ordered list <ul> Defines an unordered list <li> Defines a list item <dl> Defines a definition list <dt> Defines a definition term <dd> Defines a definition description <dir> Deprecated. Use <ul> instead <menu> Deprecated. Use <ul> instead
| | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: Re: HTML Codes Sun Sep 09, 2007 1:54 pm | |
| HTML Forms are used to select different kinds of user input. Forms A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form. A form is defined with the - Code:
-
<form> tag. - Code:
-
<form> <input> <input> </form>
Input The most used form tag is the - Code:
-
<input> tag. The type of input is specified with the type attribute. The most commonly used input types are explained below. Text Fields Text fields are used when you want the user to type letters, numbers, etc. in a form. - Code:
-
<form> First name: <input> <br> Last name: <input> </form>
Note that the form itself is not visible. Also note that in most browsers, the width of the text field is 20 characters by default. Radio Buttons Radio Buttons are used when you want the user to select one of a limited number of choices. - Code:
-
<form> <input> Male <br> <input> Female </form>
Note that only one option can be chosen. Checkboxes Checkboxes are used when you want the user to select one or more options of a limited number of choices. - Code:
-
<form> I have a bike: <input> <br> I have a car: <input> <br> I have an airplane: <input> </form>
The Form's Action Attribute and the Submit Button When the user clicks on the "Submit" button, the content of the form is sent to another file. The form's action attribute defines the name of the file to send the content to. The file defined in the action attribute usually does something with the received input. - Code:
-
<form> Username: <input> <input> </form>
If you type some characters in the text field above, and click the "Submit" button, you will send your input to a page called "html_form_action.asp". That page will show you the received input. - Code:
-
Form Tags Tag Description <form> Defines a form for user input <input> Defines an input field <textarea> Defines a text-area (a multi-line text input control) <label> Defines a label to a control <fieldset> Defines a fieldset <legend> Defines a caption for a fieldset <select> Defines a selectable list (a drop-down box) <optgroup> Defines an option group <option> Defines an option in the drop-down box <button> Defines a push button <isindex> Deprecated. Use <input> instead
With HTML you can display images in a document. The Image Tag and the Src Attribute In HTML, images are defined with the - Code:
-
<img> tag. The - Code:
-
<img> tag is empty, which means that it contains attributes only and it has no closing tag. To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src attribute is the URL of the image you want to display on your page. The syntax of defining an image: - Code:
-
<img src="url">
The URL points to the location where the image is stored. An image named "boat.gif" located in the directory "images" on "www.google.com" has the URL: http://www.google.com/images/boat.gif. Note that this is only an example. The browser puts the image where the image tag occurs in the document. If you put an image tag between two paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph. The Alt Attribute The alt attribute is used to define an "alternate text" for an image. The value of the alt attribute is an author-defined text: - Code:
-
<img src="boat.gif" alt="Big Boat">
The "alt" attribute tells the reader what he or she is missing on a page if the browser can't load images. The browser will then display the alternate text instead of the image. It is a good practice to include the "alt" attribute for each image on a page, to improve the display and usefulness of your document for people who have text-only browsers. Basic Notes - Useful Tips If an HTML file contains ten images - eleven files are required to display the page right. Loading images take time, so my best advice is: Use images carefully. - Code:
-
Image Tags Tag Description <img> Defines an image <map> Defines an image map <area> Defines a clickable area inside an image map
| |
| | | valhalla Banned
Number of posts : 1456 Age : 37 Location : the underworld Points : Registration date : 2007-08-03
| Subject: Re: HTML Codes Mon Sep 10, 2007 11:47 am | |
| ah cool. you put some more code in. awsome | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: Re: HTML Codes Mon Sep 10, 2007 2:58 pm | |
| | |
| | | valhalla Banned
Number of posts : 1456 Age : 37 Location : the underworld Points : Registration date : 2007-08-03
| Subject: Re: HTML Codes Mon Sep 10, 2007 3:13 pm | |
| wow there is more?. how many more are there | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: Re: HTML Codes Mon Sep 10, 2007 3:20 pm | |
| A lot more. Like I promised: Part 4 A good background can make a Web site look really great. Backgrounds The - Code:
-
<body> tag has two attributes where you can specify backgrounds. The background can be a color or an image. Bgcolor The bgcolor attribute specifies a background-color for an HTML page. The value of this attribute can be a hexadecimal number, an RGB value, or a color name: - Code:
-
<body bgcolor="#000000"> <body bgcolor="rgb(0,0,0)"> <body bgcolor="black">
The lines above all set the background-color to black. Background The background attribute specifies a background-image for an HTML page. The value of this attribute is the URL of the image you want to use. If the image is smaller than the browser window, the image will repeat itself until it fills the entire browser window. - Code:
-
<body background="clouds.gif"> <body background="http://www.google.com/clouds.gif">
The URL can be relative (as in the first line above) or absolute (as in the second line above). Note: If you want to use a background image, you should keep in mind: * Will the background image increase the loading time too much? * Will the background image look good with other images on the page? * Will the background image look good with the text colors on the page? * Will the background image look good when it is repeated on the page? * Will the background image take away the focus from the text? Basic Notes - Useful Tips The bgcolor, background, and the text attributes in the - Code:
-
<body> tag are deprecated in the latest versions of HTML (HTML 4 and XHTML). The World Wide Web Consortium (W3C) has removed these attributes from its recommendations. Style sheets (CSS) should be used instead (to define the layout and display properties of HTML elements). Colors are displayed combining RED, GREEN, and BLUE light sources. Color Values HTML colors can be defined as a hexadecimal notation for the combination of Red, Green, and Blue color values (RGB). The lowest value that can be given to one light source is 0 (hex #00) and the highest value is 255 (hex #FF). W3C Standard Color Names W3C has listed 16 color names that will validate with an HTML validator. The color names are: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. Cross-browser Color Values Some years ago, when most computers only supported 256 different colors, a list of 216 Web Safe Colors was suggested as a Web standard. The reason for this was that the Microsoft and Mac operating system used 40 different "reserved" fixed system colors (about 20 each). We are not sure how important this is now, since most computers today have the ability to display millions of different colors, but the choice is left to you. The 216 cross-browser color palette was created to ensure that all computers would display the colors correctly when running a 256 color palette | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: Re: HTML Codes Tue Sep 11, 2007 3:23 am | |
| And now a few HTML colors: HTML Color Names
The table below provides a list of the color names that are supported by all major browsers.
Note: If you want your pages to validate with an HTML or a CSS validator, W3C has listed 16 color names that you can use: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow. If you want to use other colors, you must specify their RGB or HEX value.
Color Name Color HEX AliceBlue #F0F8FF AntiqueWhite #FAEBD7 Aqua #00FFFF Aquamarine #7FFFD4 Azure #F0FFFF Beige #F5F5DC Bisque #FFE4C4 Black #000000 BlanchedAlmond #FFEBCD Blue #0000FF BlueViolet #8A2BE2 Brown #A52A2A BurlyWood #DEB887 CadetBlue #5F9EA0 Chartreuse #7FFF00 Chocolate #D2691E Coral #FF7F50 CornflowerBlue #6495ED Cornsilk #FFF8DC Crimson #DC143C Cyan #00FFFF DarkBlue #00008B DarkCyan #008B8B DarkGoldenRod #B8860B DarkGray #A9A9A9 DarkGrey #A9A9A9 DarkGreen #006400 DarkKhaki #BDB76B DarkMagenta #8B008B DarkOliveGreen #556B2F Darkorange #FF8C00 DarkOrchid #9932CC DarkRed #8B0000 DarkSalmon #E9967A DarkSeaGreen #8FBC8F DarkSlateBlue #483D8B DarkSlateGray #2F4F4F DarkSlateGrey #2F4F4F DarkTurquoise #00CED1 DarkViolet #9400D3 DeepPink #FF1493 DeepSkyBlue #00BFFF DimGray #696969 DimGrey #696969 DodgerBlue #1E90FF FireBrick #B22222 FloralWhite #FFFAF0 ForestGreen #228B22 Fuchsia #FF00FF Gainsboro #DCDCDC GhostWhite #F8F8FF Gold #FFD700 GoldenRod #DAA520 Gray #808080 Grey #808080 Green #008000 GreenYellow #ADFF2F HoneyDew #F0FFF0 HotPink #FF69B4 IndianRed #CD5C5C Indigo #4B0082 Ivory #FFFFF0 Khaki #F0E68C Lavender #E6E6FA LavenderBlush #FFF0F5 LawnGreen #7CFC00 LemonChiffon #FFFACD LightBlue #ADD8E6 LightCoral #F08080 LightCyan #E0FFFF LightGoldenRodYellow #FAFAD2 LightGray #D3D3D3 LightGrey #D3D3D3 LightGreen #90EE90 LightPink #FFB6C1 LightSalmon #FFA07A LightSeaGreen #20B2AA LightSkyBlue #87CEFA LightSlateGray #778899 LightSlateGrey #778899 LightSteelBlue #B0C4DE LightYellow #FFFFE0 Lime #00FF00 LimeGreen #32CD32 Linen #FAF0E6 Magenta #FF00FF Maroon #800000 MediumAquaMarine #66CDAA MediumBlue #0000CD MediumOrchid #BA55D3 MediumPurple #9370D8 MediumSeaGreen #3CB371 MediumSlateBlue #7B68EE MediumSpringGreen #00FA9A MediumTurquoise #48D1CC MediumVioletRed #C71585 MidnightBlue #191970 MintCream #F5FFFA MistyRose #FFE4E1 Moccasin #FFE4B5 NavajoWhite #FFDEAD Navy #000080 OldLace #FDF5E6 Olive #808000 OliveDrab #6B8E23 Orange #FFA500 OrangeRed #FF4500 Orchid #DA70D6 PaleGoldenRod #EEE8AA PaleGreen #98FB98 PaleTurquoise #AFEEEE PaleVioletRed #D87093 PapayaWhip #FFEFD5 PeachPuff #FFDAB9 Peru #CD853F Pink #FFC0CB Plum #DDA0DD PowderBlue #B0E0E6 Purple #800080 Red #FF0000 RosyBrown #BC8F8F RoyalBlue #4169E1 SaddleBrown #8B4513 Salmon #FA8072 SandyBrown #F4A460 SeaGreen #2E8B57 SeaShell #FFF5EE Sienna #A0522D Silver #C0C0C0 SkyBlue #87CEEB SlateBlue #6A5ACD SlateGray #708090 SlateGrey #708090 Snow #FFFAFA SpringGreen #00FF7F SteelBlue #4682B4 Tan #D2B48C Teal #008080 Thistle #D8BFD8 Tomato #FF6347 Turquoise #40E0D0 Violet #EE82EE Wheat #F5DEB3 White #FFFFFF WhiteSmoke #F5F5F5 Yellow #FFFF00 YellowGreen #9ACD32 | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: Re: HTML Codes Wed Sep 12, 2007 11:52 am | |
| HTML Quick List. Print it, fold it, and put it in your pocket. HTML Basic Document - Code:
-
<html> <head> <title>Document name goes here</title> </head> <body> Visible text goes here </body>
</html> Heading Elements <h1>Largest Heading</h1>
<h2> . . . </h2> <h3> . . . </h3> <h4> . . . </h4> <h5> . . . </h5>
<h6>Smallest Heading</h6> Text Elements <p>This is a paragraph</p> <br> (line break) <hr> (horizontal rule) <pre>This text is preformatted</pre> Logical Styles <em>This text is emphasized</em> <strong>This text is strong</strong> <code>This is some computer code</code> Physical Styles <b>This text is bold</b> <i>This text is italic</i> Links, Anchors, and Image Elements <a href="http://www.example.com/">This is a Link</a> <a href="http://www.example.com/"><img src="URL" alt="Alternate Text"></a> <a href="mailto:webmaster@example.com">Send e-mail</a>
A named anchor: <a name="tips">Useful Tips Section</a> <a href="#tips">Jump to the Useful Tips Section</a> Unordered list <ul> <li>First item</li> <li>Next item</li> </ul> Ordered list <ol> <li>First item</li> <li>Next item</li> </ol> Definition list <dl> <dt>First term</dt> <dd>Definition</dd> <dt>Next term</dt> <dd>Definition</dd> </dl> Tables
<table border="1"> <tr> <th>someheader</th> <th>someheader</th> </tr> <tr> <td>sometext</td> <td>sometext</td> </tr> </table> Frames
<frameset> <frame> <frame> </frameset> Forms <form>
<input> <input> <input> <input> <input> <input> <input>
<select> <option>Apples <option>Bananas <option>Cherries </select>
<textarea></textarea>
</form> Entities < is the same as <gt> © is the same as © Other Elements
<This>
<blockquote> Text quoted from some source. </blockquote>
<address> Address 1<br> Address 2<br> City<br> </address>
| |
| | | record4 Senior Member
Number of posts : 251 Age : 53 Location : Raleigh, NC Points : Registration date : 2007-08-05
| Subject: Re: HTML Codes Fri Sep 21, 2007 2:14 am | |
| | |
| | | Nessa Admin
Number of posts : 7028 Age : 111 Life : Points : Mood : Registration date : 2007-07-20
| | | | record4 Senior Member
Number of posts : 251 Age : 53 Location : Raleigh, NC Points : Registration date : 2007-08-05
| Subject: Re: HTML Codes Fri Sep 21, 2007 5:00 am | |
| | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| Subject: Re: HTML Codes Fri Sep 21, 2007 6:17 am | |
| A form is a box in which you can add something that you want. For example: You used a form when you registered on this forum. remember that you wrote your username,password, e-mail address when you registered for this forum. Every box that you filled with your data is a form. Forms are directed to another page in which all informations are gathered(in this case,the forum, they are stored up in a SQL database.That is why every time you log in, you access data from the SQL database which has your username,password, e-mail address and all the other things that you said.The database also keeps a record of your numbers of posts,the link to your avatar, and everything about you.
Another form is the Quick reply box right bellow the last post on every topic. | |
| | | Luky Admin
Number of posts : 4090 Age : 35 Location : Bucharest, Romania Life : Points : Mood : Registration date : 2007-08-01
| | | | Sponsored content
| Subject: Re: HTML Codes | |
| |
| | | | HTML Codes | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |
|