By Alain Lareau
Objectives this Lesson:
The above Header, which is not really a Header, the Unordered
List and this little paragraph
are placed in the center by wrapping it all between 'center' tags. This is a
fine way to do it
and can be quite handy but it is already become Old School, the new
method uses
the tags set <div>, </div>. These tags are designated 'Block
Level' Elements because they
are designed to act to control position like the 'center' tag but in a more
versatile way.
Let me show the code I just used by employing the 'pre' tag.
<center>
<p><font color="blue" size="6"><u>Objectives this Lesson</u>:</font></p> <ul> <li><font size="4">Gi...</font></li> <li>... ... ...</li> <li><font size="4">Us... <em>STYLE</em></font></li>
</ul> <p><font size="4">The above Header,... ...becoming <em>Old School</em>, the new method uses... ...employing the 'pre' tag. </font> </p> </center> <pre>... ...
This Different Way: - using the code below has some benefit. The 'div' tag can hold many things but not just text like the 'p' tag. <p>text only</p> This table is nested within the 'div' tags and centered by the container, the 'table' tag has a width attribute with a value of 674 pixels. The cell tag 'td' also has a width value, (674 - 4) = 670, this is to accommodate for the border that is there even if the border value of the 'table' tag is set to "0" or "1". For this demo let's use border="2" |
<DIV align="center"> <font color="blue" size="6"><u>Objectives this Lesson</u>:</font> <br> <font size="4">(skipping the list)</font> <table border="2" width="674"> <tr> <td width="670"> <font size="4">This Different Way: ...</font> </td> </tr> </table><br> </div>
So while we are on the subject of borders, this display begins with a new set of 'div' tags with a table nested in it. width="866" The first row ( 'tr' tag ) has two cells ( 'td' tags ) nested in it. the second cell on the right in turn has a table nested in it, it is this second table that has its border set to a value of 7 which makes it wider. In turn, this table has only one row but two cells, its left side having a different background color and contains a column of links. |
|
||
Now to make this come out right we must do a little math. // 2 + width + 2 + 7 + width + 2 + width + 7 + 2 // Total width minus 8 (2x4) minus 14 (7x2) equals w1 plus w2 plus w3 ,,, 866 - 22 = 844 // 414+ 110 + 320 Remember the cell walls and the table edges have a value of 2 regardless if you see them or not. One other note, see how this cell in this row under the stuff we are talking about, it spans under. In order to do that this 'td' tag needs an attribute 'colspan' in it set to a value of 2,<td colspan="2"> because this row sits below a row that has two sets of <td>, </td> tags even though one of those cells has cells nested in it. The Anchor ELEMENT / TagMight I be allowed to be a little jealous of my lesson plan and wish to keep this page open in your view while I send afield to look at other resources. Can I make the link open a new tab or window instead of loading on top of this one? Yes, I can by assigning the value '_blank' and specifying the attribute 'target' in the 'a' tag like this:<a href="www.xxx.htm" target="_blank">the link</a> which I will do now -- here are two, they will open a new tab or window Learning HTML / For Kids! and leave 'this' tab in place. Enjoy now I close off the 'font' (see the change in type hight) but this part is still inside of a table cell ,,, chapter1 chapter8 now in this next part goes back to larger font because I place a tag [ font size="4" } and it will stay that way until the browser sees a tag [ /font ] Now let's chat about that column of links, my little Site Map. The hot spot or Hyper Text displayed C05C is created with this 'a' tag: <a href="https://metaphorman.tripod.com/000/005.html">C05C</a> If the value of the 'href' attribute in that tag were: href="005.html" it would work just the same. This is because the page you are -- on now https://metaphorman.tripod.com/000/004.html sits in the same folder, on the same server, under the same Domain Name, I.E. the URLs have the same base. // ( Uniform Resource Locater ) The point I would like to draw out is your HTML file talks to a 'Browser' not a person and the code tells the browser what to do. The program that you use on your computer to view Web sites (HTML documents) is called a browser. Bear with me, I know it is highly likely that you already know this. You are probably not using Netscape ( got sucked up by AOL ) Mosaic or Lynx, all old and all gone but they were the first. The thing we call the URL is even older and those early browsers did not need to see anything close to an http:// at the beginning which was just one of many Transfer Protocols. difference between ftp and telnet link 1 www.differencebetween.net/technology/internet/difference-between-ftp-and-telnet/File_Transfer_Protocol link 2 wiki.filezilla-project.org/File_Transfer_ProtocoUsenet link 3 usenethelp.codeccorner.com/usenet.html In Use Examples;
Well, There It Is ,, mostly just a history lesson really The best place to start your first page is the NOTEPAD that comes with your Operating System. Well! What if you wish to point your browser to a file on your own computer that you saved with Notepad? Yes you can do that in the value of the 'href' attribute. This is what it would look like: <a href="file:///C:/filename.html">stuffYouPutBetweeTheA tagsToShowUpAsHyper-TextOnYourPage</a> Or it could end with .htm instead of .html, years ago with Windows 3.1 the file extensions were limited to three characters. When you save your file using Notepad with the file extensions .htm or better .html instead of .txt your browser will recognize it as a web page. We might be ready for the proverbial dumb question, here goes,,, Q: Is there an easy way to convert a text file to a Web Page? A: Yes! In fact that is a good way for you to see why I use the 'pre' tags to show you code. |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <TITLE>Name of your Web Page</TITLE> </HEAD> <BODY> <BASEFONT SIZE="4"> <PRE> ---the text file with CRs--- </PRE> </BODY> </HTML> |
This cell is a spacer set in place with width= "82" |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <TITLE>Name of your Web Page</TITLE> </HEAD> <BODY> <P><FONT size="4"> --the long line of text-- </FONT></P> </BODY> </HTML> |
If you mouseover and highlight the above preformated text, copy and paste to Notepad you will see that it keeps its shape,
that is the line brakes (the <br>s) that are rendered to you via the HTML translate to CRs (Carriage Returns) in the Notepad file
AND the 'angle brackets' come though as 'angle brackets' even as they are actually < & > in the HTML.
So, for me it is a good way to show code to you and it is a good way for you to copy it while in the lesson plan.
You may get the idea that any notepad file having all the CRs/line brakes already present can be rendered to a web page
just by sticking in between the 'pre' tags of this little templet. If however if you copy to a Notepad file from a source that
does not translate the line brakes what you paste may end up as a straight line of words, in that case use the templet/template at right.
The 'p' tags do the job for you.
You have covered a lot and soon you will be ready to go full bore after we clear up a few things in the next Three lessons.
Meanwhile please think about all the HTML tags/ELEMENTS you have encountered thus far and divide them into Two groups in Three different ways:
Method - this page The method of this page is:
Style-in Head, this page<style rel="stylesheet" type="text/css"> i { color: blue } em { color: black; font-weight: bold } h1 { color: black } pre { font-size: 11pt; color: #cc0033; text-align: left; font-weight: bold } td#box { font-size: 14pt; color: #006633; text-align: center } div.pref { font-size: 14pt; color: #006633; text-align: center } dl#protocol { font-size: 14pt; color: #003300 } </style> Design notes, this page<!--
|
Back to Top
-------------------- Next Lesson
Copyright © 2011 - Alain Lareau
All Rights Reserved unless with Writen Request.
alainelj@yahoo.com this page B04C
https://metaphorman.tripod.com/000/004.html