LESSON 10 - RESOURSESHTML is a widely used mark-up language that helps to build web pages. It is however just the beginning of it all. There is a bunch of other programming languages for web designing. Also, HTML (either of the types) helps you in designing a website. It is the foundation of all other web programming languages. However, there are bunches of resouses online few of which i would highlight shortly. As a web designer, it is needful to have the knowledge of colors and its combination. |
Tuesday, 27 November 2012
LESSON 9: USING FRAMESWhat Frames AreFrames is one of the newer features of HTML which is only implemented on the newest browsers (Netscape 2.0 and higher, and the new Internet Explorers, and many others) which allows a single browser window to be divided into multiple sections, each with an independent HTML page loaded inside it, and these HTML pages can interact with each other. Each page loaded within each section of the frames window is a separate HTML document. Example of the code to a simple frames page...
<html> <head><title>testing frames...</title></head> <frameset cols="25%,75%"> <frameset> <frame src="test.html" name="indexbar"> </frameset> <frameset> <frame src="main.html" name="main"> </frameset> </frameset> <noframes> This page requires a frames-capable browser... please get one! </noframes> </html> The frames page itself in most cases does not actually contain any content, all content is placed on the separate HTML pages loaded within each frame (section). Instead, the frames page acts as a guide, defining which page to be loaded into each frame, and the frame attributes themselves. As you may have noticed, a frames page closely resembles a normal HTML page, except that the body is replaced withframeset, and an additional noframes tag is added. Using The Frameset TagThe frameset tags are used to define the characteristics of the frames, and the noframes tags are used to define what a browser that is not frames-enabled will see. Because the frameset tags are ignored by a non-frames browser, anything within the noframes tags will be considered a normal HTML page. So after the <noframes> tag should be placed the <body> tag, and then any content and tags, then concluded with the </body> tag, followed by the </noframes> tag. The noframes content will not be seen by someone using a frames-enabled browser unless they choose 'view source'.The frameset tag will be used multiple times throughout a single frames page. The first frameset tag is used to define the number of separate frame columns within the browser window, and what width each of those windows will be. The next set of frameset tags will be used to define how many frame rows will be in the browser window, and each one's height. The row attribute is set separately for each column, for example, your first column may have 4 frames, and your second column may have 2 frames, etc. There is no specific limit on the number of frames you may have within a single browser window, but you must realize that your page will be viewed in different resolutions, from 640 x 480 pixels to 1024 x 768 pixels and greater. My advice is to limit your page to no more than 4 frames within a single browser window. Defining ColumnsThe first frameset tag should read <frameset cols="SIZE_OF_COLUMN_1,SIZE_OF_COLUMN_2,ETC">. This first tag will be closed with a </frameset> tag, but only after the frameset rows for each column are also defined. The SIZE_OF_COLUMN can be one of three numbers...
So a frameset reading <frameset cols="20%,80%"> would mean that the first column is the browser window will take up 20% of the browser window's width, and that the second column will take up 80% of the total browser's width. Another example is <frameset cols="120,*"> in which the first column is exactly 120 pixels wide, and the second column takes up all remaining width. Only one column is required, and there is no limit on how many columns can be defined. Defining RowsWithin the column defining frameset opening and closing tag are the row defining frameset tags. The number of row defining frameset tags is directly dependent on the number of columns defined in the column defining frameset tag. If there are two columns defined, there will be two separate row defining frameset tags, if three columns are defined, there will be three row defining frameset tags.The row frameset tag should read <frameset rows="SIZE_OF_ROW_1,SIZE_OF_ROW_2,ETC">. The SIZE_OF_ROW is defined almost identically to the SIZE_OF_COLUMN... x% is the percent of available browser height, x is a defined pixel value in height, and * is all remaining space. Rows are defined top to bottom, and Columns are defined left to right. Defining FramesWithin each row frameset tag comes the frame tag, which defines which page is to be loaded in that frame and a few attributes on that frame. The simple frame tag reads <frame src="document_to_load.html">, where document_to_load is the name of the web page that is to be loaded in that frame, and the frame tag has no closing tag. The frame tag has some other useful attributes:
<frame src="document_to_load.html" SCROLLING="no"> or if you want resizing to be disabled just use the code: <frame src="document_to_load.html" NORESIZE> Example of a complex frames page... <html> <head><title>testing complex frames</title></head> <frameset cols="33%,33%,33%"> <frameset rows="*,100"> <frame src="page1.html" NAME="index"> <frame src="page2.html" NORESIZE> </frameset> <frameset> <frame src="main.html" NAME="main"> </frameset> <frameset rows="50%,50%"> <frame src="page3.html"> <frame src="page4.html" SCROLLING="no"> </frameset> </frameset> <noframes><body> This page requires a frames-enabled browser! </body></noframes> </html> What this frames page looks like... ![]() Using the TARGET attributeWhat if you have a page in one frame with a link, but when the user clicks the link, you want it to be loaded into one of the other frames you defined? This is what the TARGET attribute is for. The TARGET attribute is part of the <a href> tag. The a href tag used with the TARGET attribute reads:<a href="page_to_load.html" TARGET="target_frame">text</a> Where page_to_load.html is the name of the file which should be loaded in the frame, target_frame is the defined name you gave to the frame that you wish the link to load into, and text is the anchored text of the link. If you link without a target, the linked page will load into the current frame. There are also a few other special magic targets which can be used where target_frame is:
Your own HTML pageCreate a new file, called "frames.htm", which contains the following:<html> <head><title>My Home Page</title></head> <!-- The page will have one row with two columns, one row with one column --> <!-- The first frameset defines the rows: two rows, the second one is narrower --> <frameset rows="85%,15%"> <!-- The second frameset defines the columns in the first row --> <frameset cols="15%,85%"> <!-- Specify the two files to display in the first row --> <!-- The first file will contain an index for your home pages --> <frame src="indexbar.htm" name="indexbar"> <!-- The second file is Home.htm: the file you have been working on so far --> <frame src="Home.htm" name="mainframe"> </frameset> <!-- Specify the file to display in the second row --> <!-- This file contains copyright information --> <frame src="copyright.htm" name="copyright"> </frameset> <!-- Define what to display to browsers which aren't frames-capable --> <noframes> This page requires a frames-capable browser... please get one! </noframes> </html> Create another new file, called "indexbar.htm", which contains the following: <html> <body background="bgnd.gif"> <!-- The index page contains links to the main home page, and a feedback page --> <!-- Those pages will load into the "main" target --> <a href="Home.htm" target="mainframe">Home</a> <a href="feedback.htm" target="mainframe">Feedback</a> </body> </html> Create yet another new file, called "copyright.htm", which contains the following: <html> <body background="bgnd.gif"> <!-- The copyright page contains copyright information for your web pages --> <center>Copyright © 2012 YOURNAME</center> </body> </html> Create an essentially blank file, called "feedback.htm". We will complete this file later. <html> <body background="bgnd.gif"> </body> </html> |
LESSON 8: FORMSFormsForms allow you to add interactivity to your web documents by way of the <FORM> tag. With the form tag you can add to your web pages a guestbook, order forms, surveys, get feedback or whatever. The basic construction of a html form is this...
<FORM> begin a form
<INPUT TYPE=TEXT> Every input needs a NAME. <INPUT TYPE=TEXT NAME="ADDRESS"> When the user types in his address (for example 2 Victory Lane), it will become the input's value and be paired with ADDRESS so the end result after running it through Mailto Formatter will beADDRESS=2 Victory Lane. We can if we want, type in a VALUE. <INPUT TYPE=TEXT NAME="ADDRESS" VALUE="Victory Lane"> This will automatically pair the value Victory Lane with the name ADDRESS, unless the user changes it. Note- be sure to use quotes where I've specified. We can specify the size of the text input box. <INPUT TYPE=TEXT NAME="ADDRESS" VALUE="Victory Lane" SIZE=10> <INPUT TYPE=TEXT NAME="ADDRESS" VALUE="Victory Lane" SIZE=20> <INPUT TYPE=TEXT NAME="ADDRESS" VALUE="Victory Lane" SIZE=30> The default value is 20. If we want, we can specify how many characters a user can input. <INPUT TYPE=TEXT NAME="ADDRESS" SIZE=30 MAXLENGTH=10> Very similar to the TYPE=TEXT is the TYPE=PASSWORD. It is exactly the same, except it dispays *** instead of the actual input. The browser will send you the input, it just won't display it. <INPUT TYPE=PASSWORD> Remember that each <INPUT> must have a NAME. <INPUT TYPE=PASSWORD NAME="USER PASSWORD"> SIZE, VALUE, and MAXLENGTH modifiers/attributes work here also. By the way, a <TAG> tells the browser to do something.
Radio buttons allow the user to choose one of several options. Check Boxes allow the user to choose one or more or all of the options. <INPUT TYPE=RADIO NAME="POSITION"> Now add 2 more. <INPUT TYPE=RADIO NAME="POSITION"> Hmmm... I suppose we should put a line break after each one. <INPUT TYPE=RADIO NAME="POSITION"><BR> Note that each input has the same name. The reason will become apparent very shortly. Each of the Radio Buttons must be assigned a VALUE. <INPUT TYPE=RADIO NAME="POSITION" VALUE="PB"><BR> Now label each button. <INPUT TYPE=RADIO NAME="POSITION" VALUE="A"> hp<BR> You can also modify these labels with other html tags if you wish. Essentially your Radio Buttons are done. You can tidy things up by adding a statement above the buttons, and if you want, choose a default selection (optional). What is your position within the company?<BR> The user of course can only choose 1 option. Their choice will be returned to you as the name/value pair POSITION=A (or whichever they pick). Building Check Boxes is pretty much the same thing. Start with this. <INPUT TYPE=CHECKBOX NAME="A"> Add 3 more, but this time give each one a different NAME. (Also add in line breaks if you want) <INPUT TYPE=CHECKBOX NAME="A"><BR> Each Check Box gets the same VALUE. <INPUT TYPE=CHECKBOX NAME="A" VALUE="YES"><BR> Note- For Check Boxes the NAME changes and the VALUE stays the same and with Radio Buttons, the VALUE changes but the NAME stays the same. Don't feel bad, my simple mind still gets confused.
OK, let's label each box. <INPUT TYPE=CHECKBOX NAME="A" VALUE="YES"> hp<BR> And lastly, you may want to add a little something above your check boxes and maybe pick a couple defaults. What positions do you occupy within the company?<BR> The user can choose 1, 2, none or all of the options. Their choices will be returned to you as the name/value pairs...
A=YES YOUR HTML PAGE !!!Add this as a feedback.htm form.<html> <body background="bgimage.png" bgcolor=#FFFFFF> <center><h1>Feedback Form</h1></center> <br> <form> <b>My name is: </b><input type=text name="name"> <p> <b>I work as a:</b><br> <input type=radio name="position" value="Developer" checked>Developer<br> <input type=radio name="position" value="ProjMan">Project Manager<br> <input type=radio name="position" value="TechMan">Technical Manager<br> <input type=radio name="position" value="NOTA">None of the above </p> <p> <b>When it comes to web browsers:</b><br> <input type=checkbox name="Netscape" checked>I use Netscape Navigator<br> <input type=radio name="NetscapeVer" value="2.0">version 2.0<br> <input type=radio name="NetscapeVer" value="3.0" checked>version 3.0<br> <input type=checkbox name="IExplorer">I use Microsoft Internet Explorer<br> <input type=radio name="IEVer" value="2.0">version 2.0<br> <input type=radio name="IEVer" value="3.0">version 3.0<br> </p> </body> </html> Save the file.
Pull Down and Scrolling ListsThe next type of input is a Pull Down List. With this type you use <SELECT> instead of <INPUT> and it has a closing tag. <SELECT> Don't forget to give it a name. <SELECT NAME="POSITION"> Next add a few options. <SELECT NAME="POSITION"> And give each <OPTION> a VALUE. <SELECT NAME="POSITION"> The default option is the one that is listed first. We can specify a default other than the first option in the list. <SELECT NAME="POSITION"> A Scrolling List is very similar in construction to a Pull Down List. We'll add a few more options first. Then, all we do to turn it into a Scrolling List is add a SIZE attribute to the <SELECT> tag. <SELECT NAME="POSITION" SIZE=4> The SIZE is simply how many options show in the window. Again, the default value is the first <OPTION>, and again we can change that by selecting one. <SELECT NAME="POSITION" SIZE=4> TextareaA very useful type of input is <TEXTAREA>.<TEXTAREA NAME="COMMENTS"> You control the size of the box like so... <TEXTAREA NAME="COMMENTS" ROWS=6 COLS=50> ROWS is the height, COLS is the width. A good attribute to include in <TEXTAREA> is WRAP. Some browsers do not understand it, but if that's the case, they will just ignore it. Go ahead and type in the boxes... <TEXTAREA NAME="COMMENTS" ROWS=3 COLS=30 WRAP=VIRTUAL> WRAP=VIRTUAL means that the text in the box wraps, but it is sent as one long continuous string. <TEXTAREA NAME="COMMENTS" ROWS=3 COLS=30 WRAP=PHYSICAL> WRAP=PHYSICAL means that the text in the box wraps, and it is sent that way too. <TEXTAREA NAME="COMMENTS" ROWS=3 COLS=30 WRAP=OFF> This is the default. YOUR FIFTH HTML PAGE !!!Open Notepad, and add the following. <html><body background="bgimage.jpg"> <center><h1>Feedback Form</h1></center> <br> <form> <b>My name is: </b><input type=text name="name"> <p> <b>I work as a:</b><br> </p> <p> <b>When it comes to web browsers:</b><br> . </p> <b>I rate your site as:</b><br> <select name="Rating"> <option value="Wow">Wow! How did you do it? <option value="good">Really good <option value="interesting">Interesting <option value="hmmm">Hmmm - seen better <option value="tryagain">Try again bud! </select> </p> <p> <b>Comments:</b><br> <textarea name="comments" rows="6" cols="50" wrap="physical"> </textarea> </p> </body> </html> Save the file. Submit and Reset ButtonsLast on the list are the SUBMIT and RESET buttons. They really are very simple... <INPUT TYPE=SUBMIT> SUBMIT of course, sends the data and RESET, clears the form. <INPUT TYPE=RESET> We can easily change what the buttons say. <INPUT TYPE=SUBMIT VALUE="Send it away Ray!"><BR> If necessary, the SUBMIT button can also have a NAME. You would need this if, for whatever reason, you had more than one SUBMIT button. Next we must tell the browser where to send the data we gather and how to send it. There are two basic things you can do: Note- Microsoft's Internet Explorer 3.0 does not support mailto forms. When you try to submit the information, the new mail message window pops up. Explorer does however support forms sent to a CGI script. <FORM METHOD=POST ACTION="mailto:eidzeiaiti@gmail.com" ENCTYPE="application/x-www-form-urlencoded"> When you put a mailto form on your page and someone sends you information, you'll notice that it is sent with a default Subject. If your visitor was using Netscape you'd get the default Subject "Form posted from Mozilla". Other browsers might send "Form Response", etc.
You can change this by editing what's in the <FORM> tag as follows... <FORM METHOD=POST ACTION="mailto:eidzeiaiti@gmail.com?subject=Company feedback form" ENCTYPE="application/x-www-form-urlencoded"> YOUR FIFTH HTML PAGE !!!Open Notepad, and add the following.<html> <body background="bgimage.jpg"> <center><h1>Feedback Form</h1></center> <br> <form method=post action="mailto:YOUREMAILADDRESS?subject=Feedback" enctype="text/plain"> <b>My name is: </b><input type=text name="name"> <p> <b>I work as a:</b><br> </p> <p> <b>When it comes to web browsers:</b><br> </p> <b>I rate your site as:</b><br> </p> <p> <b>Comments:</b><br> </p> <p> <input type="submit" value="Send it!"><br> <input type="reset" value="Clear it!"> </p> </body> </html> Save the file. |
LESSON 7: Tables |
LESSON 6: CLEAN CODE, COMMENTS, AND ESCAPE CODESClean CodeClean code means that your HTML coding follows all specifications. Here are a few ways to keep your code clean:
The Comment TagIf you are writing an HTML document, sometimes you may want to put little reminders to yourself with your code so that you will be able to interpret your coding better. A comment will not appear in a web browser when the page is displayed... it is only visible when the source code is viewed. You start commented text with <!-- and end it with -->. YOUR FIFTH HTML PAGE !!!Add the following to your HTML page ("index.htm"):<html> <head><title>My Home Page</title></head> <center><font color="Blue"><h1>This is a Heading 1</h1></font></center> <hr> This is the home page of <a href="mailto:YOUR EMAIL ADDRESS"><img src="myImage.png" border=0><b>YOURNAME</b>.<img src="myImage.png" border=0></a> <p>Type something about yourself here. Describe briefly who you are and what you do for a living. Remember to use bold and italic text, for emphasis.</p>> <hr> <h2>My favourite Web Sites</h2> <br> <!-- This list is an unordered list --> <ul> <li> <a href="http://www.cuatdtop.blogspot.com">The Reformers : Web Design</a> </li> <li> <a href="http://www.microsoft.com">Microsoft</a> </li> <li> <a href="http://www.xencon.com">Xenon Web Design</a> </li> <li> <a href="http://www.hp.com">Hp</a> </li> </ul> </body> </html> Save the text file as "index.htm". |
LESSON 5: LISTThe UNORDERED LIST
The Unnumbered List is the first of the three types of lists. This is probably the most common list you will use.
Example of an Unordered List...
<ul>
<li>pencils</li>
<li>pens</li>
<li>erasers</li>
<li>paper</li>
<li>glue</li>
</ul>
The <ul> tag is the opening Unordered List Tag. Therefore, the </ul> is the closing tag. Between these two tags you place LIST ITEMS, each one having an individual <li> opening tag, and an optional</li> closing tag. There is no limit to the number of List Items you may have in a single list. The ORDERED LISTThe Ordered List, also known as the Numbered List, is very similar in structure to the unordered list, except each list item has a number in front of it, instead of a bullet. Also, the opening tag for the list is <ol>instead of <ul>, and the closing tag is </ol> instead of </ul>. List Items within the list still use the same tags. Example of an Ordered List...
<ol>
<li>pencils</li>
<li>pens</li>
<li>erasers</li>
<li>paper</li>
<li>glue</li>
</ol>
The Definition ListThis type of list is a little more complicated, but still very easy to use. This list starts with the <dl> opening tag, and ends with the </dl> closing tag. This has another tag known as <dt> for Definition Term, and <dd> for Definition Definition. These two tags do not need closing tags. Example of a Definition List...
Now here is the HTML code for this Definition List... <dl> <dt>alliance <dd>A union, relationship, or connection by kinship, marriage, or common interest. <dt>alligator <dd>Large amphibious reptile with very sharp teeth, powerful jaws. <dt>alliterate <dd>To arrange or form words beginning with the same sound. </dl> YOUR FIFTH HTML PAGE !!!Add the following to your HTML page ("index.htm"):<html> <head><title>My Home Page</title></head> <center><font color="Blue"><h1>This is a Heading 1</h1></font></center> <hr> This is the home page of <a href="mailto:YOUR EMAIL ADDRESS"><img src="myImage.png" border=0><b>YOURNAME</b>.<img src="myImage.png" border=0></a> <p>Type something about yourself here. Describe briefly who you are and what you do for a living. Remember to use bold and italic text, for emphasis.</p> <hr> <h2>My favourite Web Sites</h2> <br> <ul> <li> <a href="http://www.cuatdtop.blogspot.com">The Reformers : Web Design</a> </li> <li> <a href="http://www.microsoft.com">Microsoft</a> </li> <li> <a href="http://www.xencon.com">Xenon Web Design</a> </li> <li> <a href="http://www.hp.com">Hp</a> </li> </ul> </body> </html> Save the text file as "index.htm". |

LESSON 4: LINKS AND IMAGESAnchored LinksWithout Links, the World Wide Web wouldn't be a web at all! To add a link... you will use the <a href="location"> opening tag and </a> closing tag. Whatever appears between these two tags will become underlined and colored, and if you click on the underlined text it will send the browser to the location within the quotes.
Example of a link... Visit THE REFORMERS: WEB DESIGNING! Visit <a href="http://www.cuatdtop.blogspot.com/"> THE REFORMERS: WEB DESIGNING </a>! Note: Although Links are usually used to send people to other web pages, you may also use it to send email to a specific address by using a location of mailto:user@host. Example of a Mailto: Link... Send email to Me! Send email to <a href="mailto:eidzeiaiti@gmail.com">Me</a>! In-line ImagesYou may also add images (pictures) to your web page, as long as the image is in the .gif or .jpg (or .jpeg) file formats. You will not be able to use .bmp format files! The basic tag for in-line images in <img src="location">. It is also recommended to add HEIGHT and WIDTH attributes to the IMG tag, which will allow the image to take proper proportions on a browser that is not currently viewing images. It is also recommended to use the ALT="what picture is" to tell a person what a picture is in case it is still loading or they are not viewing images. (The IMG tag has no closing tag!) Example of a basic in-line image...![]() Combining Links and ImagesMany times you may want to have an image that is linked, so that if someone clicks the image, they will be taken to another page. This is rather simple- you just need to place the IMG tag within the A HREFtags. (<a href="location_of_link"><img src="location_of_image"></a>) You may also use the ALIGN tags with images! <a href="http://www.cuatdtop.blogspot.com/"><img src="News.png" align=right border=0></a> YOUR FOURTH HTML PAGE !!!Look for a picture on your computer and save it in the same folder where you have your index.html web page so as to make it possible and easier for the browser to read it. Save it as myImage.png
YOU WOULD HAVE SOMETHING LIKE THIS
|
LESSON 3: EXTENDED FONTS AND TEXT COLORExtended FontsThe newest version of many browsers supports extended fonts, in which you can choose to have the document fonts be other than the normal one. This is accomplished by adding the FACE="font_name"attribute to the <FONT> tag. The most commonly supported fonts are Verdana, Arial, Helvetica, Impact, Comic Sans MS, and a few others. It is not recommended to make your page font dependent, because the older versions of many browsers don't yet support this feature.
Example of Extended Fonts... <font size=+2 face="Verdana">Verdana</font> Verdana <font size=+2 face="Arial">Arial</font> Arial <font size=+2 face="Helvetica">Helvetica</font> Helvectica <font size=+2 face="Impact">Impact</font> Impact <font size=+2 face="Comic Sans MS">Comic Sans MS</font> Comic Sans MS Note: If you don't see one or more of the above fonts, then your browser probably doesn't support the extended fonts. Text ColorYou can change the color of the text by setting the COLOR="font_color" attribute in the <FONT> tag. The Color is usually set by using the hexadecimal system (#000000 black to #FFFFFF white) but can also be set in newer browsers by using the simple word of the color. (Red for Red, Blue for Blue, etc.) Example of Text Color...<font color="Blue">Hey I'm Blue!</font> Hey I'm blue! <font size=+2 face="Impact" color="Green">Hey I'm green and in Impact Font!</font> Hey I'm green and in Impact Font! <font color="Red">Hey I'm red!</font> Hey I'm red! ![]() Your own HTML page... ![]() |
LESSON 2: THE COMMON TAGSHeadings
Headings are some of the most important tags within the BODY of your HTML document. You will usually use a heading to tell what the following section of your page is about. The opening tag for a heading is <hy> and the closing tag is </hy> with y being the size of the heading... from 1 to 6. (1 being largest, and 6 being smallest)
Example of heading tags... H1: Bob fell over the chicken.
<h1>H1: Bob fell over the chicken.</h1>
H2: Bob fell over the chicken.
<h2>H2: Bob fell over the chicken.</h2>
H3: Bob fell over the chicken.
<h3>H3: Bob fell over the chicken.</h3>
H4: Bob fell over the chicken.
<h4>H4: Bob fell over the chicken.</h4>
H5: Bob fell over the chicken.
<h5>H5: Bob fell over the chicken.</h5>
H6: Bob fell over the chicken.
<h6>H6: Bob fell over the chicken.</h6>
Horizontal Ruled Lines...
Horizontal Ruled Lines are used to separate different areas of a web page. The tag for a horizontal ruled line is <hr>. The horizontal ruled line DOES NOT have a closing tag. You may also add certain attributes to the <hr> tag, such as WIDTH=n (for fixed pixel width) or WIDTH=n% for a certain percentage of the screen wide, SIZE=n to make the line a certain pixel amount thick, and NOSHADE to turn the line's shading off. A plain <hr> with no attributes will make the line the full width of the screen. Example of horizontal ruled lines...
<hr width=50>
<hr width=50%>
<hr size=7>
<hr noshade>
You may also use several attributes within one tag...
<hr width=50% size=10 noshade>
Paragraphs... You will often use paragraphs in HTML, just as you do when you write stories. The opening tag for a paragraph is <p>, and the closing tag is </p>. The closing tag for a paragraph is not always needed, but I recommend using it anyway. Example of a paragraph...
Bob starts to chase the chicken around. Bob trips over a string and goes flying into the pig's mud pit! eww! What a pity!
<p>Bob starts to chase the chicken around. Bob trips over a string and goes flying into the pig's mud pit! eww! What a pity!</p>
Text Formatting Properties...
If you had an entire web page without formatted text, it would look rather dull and boring. This is why we use text formatting tags. Some common text formatting tags are: <b> and </b> for bold, <i> and </i> for italics, <u> and </u> for underlined, and <tt> and </tt> for typewriter. Text Formatting Properties...Font Tags The <font size=n> and </font> tags come in handy. n is the number of font points by which to change the size of the current font. n can be positive or negative: a positive number will increase the font size, and a negative number will decrease it. n can also be an absolute number, indicating an absolute size for the font (not a relative size). Example of font tags... Bob is a Cool Guy isn't he? <font size=+1>Bob</font> <font size=+2>is</font> <font size=+3>a</font> <font size+2>Cool</font> <font size=+1>Guy</font> isn't <font size=-1>he?</font> ALIGN attributesMany tags support ALIGN attributes... if you want something to be aligned from the left margin, from the center, or from the right margin. The ALIGN attribute is placed in the opening tag before the >. Left Align
<h1 align=left>Left Align</h1>
Center Align
<h1 align=center>Center Align</h1>
Right Align
<h1 align=right>Right Align</h1>
The Line BreakWhen your HTML document is viewed, normally the text will do a word-wrap at the end of a line. If you want to have the text BREAK (go to another line) you will use the <br> tag. This tag has no closing tag. Example WITHOUT line Break Sentence One. Sentence Two. Sentence Three. Example WITH line Break Sentence One. Sentence Two. Sentence Three. Sentence One. Sentence Two. Sentence Three. Sentence One.<br> Sentence Two.<br> Sentence Three.<br> Preformatted TextIf you wish to have text line up properly (a.k.a. fixed width text) that will include line breaks without the use of the <br> you may find the <pre> and </pre> tags helpful. Example of text WITHOUT preformatting The cat ran after the dog. ^ ^-verb ^noun ^-noun The cat ran after the dog. ^ ^-verb ^noun ^-noun
HTML ignores the extra line breaks, so the text does not line up properly.
Example of text WITH preformatting.
The cat ran after the dog. ^ ^-verb ^noun ^-noun
<pre> The cat ran after the dog. ^ ^-verb ^noun ^-noun </pre> YOUR SECOND WEB PAGE !!!Add the following to your HTML page ("index.htm"), between the lines <body> and </body>:<h1>This is a heading 1</h1> <hr> This is the home page of <b>YOURNAME</b>. <p>Type something about yourself here. Describe briefly who you are and what you do for a living. Remember to use bold and italic text, for emphasis.</p> Save the text file as "index.htm". YOU WOULD HAVE SOMETHING LIKE THIS ![]() The CENTER tagThe center tag pretty much explains itself. The opening center tag is <center> and the closing center tag is </center>. Whatever you put between will be centered on the current line! Example of CENTER tag... Center Works
<center><h1>Center Works</h1></center>
The BODY attributesThe BODY tag has many attributes... here are a the most useful ones...
YOUR THIRD WEB PAGE !!!Select a picture from your computer and save it in the same folder with your index.htm file. Save it as bgimage.png or any other extension like jpeg, jpg e.t.c.. Mine is a jpg file..Add the following to your HTML page ("idex.htm"): (the blue text is what to add) <html> <head><title>My Home Page</title></head> <body background="bgimage.jpg"> <center><h1>This is a heading 1</h1></center> <hr> This is the home page of <b>YOURNAME</b>. <p>Type something about yourself here. Describe briefly who you are and what you do for a living. Remember to use bold and italic text, for emphasis.</p> </body> </html> Save the text file as "index.htm". YOU WOULD HAVE SOMETHING LIKE THIS ![]() |






