Студопедия

КАТЕГОРИИ:

АвтоАвтоматизацияАрхитектураАстрономияАудитБиологияБухгалтерияВоенное делоГенетикаГеографияГеологияГосударствоДомЖурналистика и СМИИзобретательствоИностранные языкиИнформатикаИскусствоИсторияКомпьютерыКулинарияКультураЛексикологияЛитератураЛогикаМаркетингМатематикаМашиностроениеМедицинаМенеджментМеталлы и СваркаМеханикаМузыкаНаселениеОбразованиеОхрана безопасности жизниОхрана ТрудаПедагогикаПолитикаПравоПриборостроениеПрограммированиеПроизводствоПромышленностьПсихологияРадиоРегилияСвязьСоциологияСпортСтандартизацияСтроительствоТехнологииТорговляТуризмФизикаФизиологияФилософияФинансыХимияХозяйствоЦеннообразованиеЧерчениеЭкологияЭконометрикаЭкономикаЭлектроникаЮриспунденкция

The next command is the paragraph command.




Introduction

In order to make a perfect web page you must understand all of the commands in HTML that are at your disposal. Armed with this knowledge you can do exactly what you want. Sometimes people’s web pages do not turn out exactly how they wanted them to be because they did not know the command that did exactly what they wanted. In HTML, just as in any other programming language, there are specified commands that “tell” the web browser how to display the document. These commands are be sent to the browser in the form of source code which is translated into what you see when you “surf” the net.

There are a great deal of commands in HTML which do a variety of different things. Once you finish this book you will be acquainted with all of these commands and you will be told exactly what they do and how to incorporate them into your web page.

The Head Command

The most basic command, and the first one we will learn, is the head command. Anything on your web page that is not going to appear in the body of your browser will be contained in the head command. The body of the browser is the area that contains the main page, normally the area that has a scroll bar and so on. For example, if you put a title on your web page it will appear in the head command because it does not effect the body of the document. Certain Javascript programs appear in the head of the document because they, possibly, do not run a program that deals with an action that happens in the body of the document. However, you do not always need to use the head command on your page. If, for example, you only have a title and everything else appears in the body of the document then the browser will be able to understand where the title is supposed to go.

In order to use the head command on your page you must enter a command that tells the web browser where the head information begins and ends. The command that tells the browser where the head is begins is an angle bracket “<“ followed by the word HEAD followed by an angle bracket “>”. After you have entered this command you will then enter anything that is going to go in the head of your page. Once you have entered the items that are going to appear in the head you will then need to make sure that you enter the command that tells the web browser that you are done entering the items that are going to appear in the head and ready to start on something else. This command is an angle bracket “<“ followed by a slash “/” followed by the word HEAD followed by an angle bracket “>”. The final source code for the most basic head, which is one that contains nothing in it because we have not learned any other commands yet, would look like this: (Note that the items that would appear in the head would go in between the opening and the closing head command.)

 

<HEAD>

</HEAD>

The Title Command

The next command we will explore is the title command. This command will give your web page a title when a person views it. If you do not put this command on your web page then the person will just see the address of your web page at the top of their browser. On the other hand if you have a title the person will see that at the top of their browser. This will provide the person a quick, to the point description of your page. If they put your page in their “bookmarks” that title will appear in their bookmarks pull down menu so that the person will remember what your page is and what it is about. If you do not have a title your address will be put in the “bookmarks” and the person will have no idea what your page is about and mostly likely discourage them from visiting your web page.

My web page has the title “Justin Weber’s Computing Center,” in order to incorperate this into my page I put the commands necessary at the TOP of my HTML document. (You will want to write this document in a Text editor because they are very easy to use to write your page, just remember to save the document as *.html or *.htm.) The title command is designated by an angle bracket (all HTML codes are designated beginning and ending with an angle bracket) “<“ then the word TITLE (this is not case sensitive so you may write it like this: title, or this: TITLE, or this: TiTlE, either way they will do the same thing) then another angle bracket “>”. Then you type your title.

 

NOTE: When selecting a title use one that accurately describes your web page, unless your page is a joke :). My page is about operating systems and computers so I chose the title Justin Weber’s Computing Center, respectively.

 

To end the title you type an angle bracket “<“ then a slash “/” then the word TITLE then an angle bracket “>”. Here is what my title looks like in the HTML code:

 

 

<TITLE>Justin Weber’s Computing Center</TITLE>

 

That completes the section on the head portion of the web page.

The Body Command

The next command that we will explore is the Body command. This command tells the browser where the body of the HTML document begins and ends. Most of the time the body of the document is anything that you see in the window of the web browser. The body command can contain several modifiers which will change items such as background color, text color, background images, and link color.

When selecting a certain set of colors for use in you web page make sure that they do not conflict with each other. For example, I have stumbled upon web pages that have light green text and plain gray background. This combination of colors makes the page very difficult to view and could turn people away from your web page.

 

On my web page I use a white background, I actually have an image for a background but that will be discussed later, with blue text. I decided not to include any special color for links so they will be blue as well. In order to tell the browser that I want this done the command in my script must begin with an angle bracket “<“. After the angle bracket I will need to insert the word BODY. After the word BODY I then enter my list of preferences. The first preference I want to input is the background color. My background is going to be white. This is distinguished by the letters FFFFFF (For a list of all colors and the letters that represent them, see the appendix). I will insert the modifier BGCOLOR=”FFFFFF”. That is all I need to do to change the color. But I am not done, I want the text of my document to be blue. This is distinguished by the code 0000FF. I will insert the modifier TEXT=”0000FF”. If I wanted to specify red for the visited link, so that if a person has already gone here they will know it, I would insert the command VLINK=”FF0000”. And if I wanted the links to be a different color from the text, let’s say black, I would insert the command LINK=”000000”. Then I must end this list with another angle bracket “>”. At the bottom of the body I will have to insert a command telling browser that I am done with the body. That command would be an angle bracket “<“ followed by a slash “/” followed by the word BODY followed by an angle bracket “>”. Here is what the final source of my web page would look like:

 

 

<BODY BGCOLOR=”FFFFFF” TEXT=”0000FF”>

The body of my code

</BODY>

 

The final source of the web page with everything I described above would look like:

 

<BODY BGCOLOR=”FFFFFF” TEXT=”0000FF” VLINK=”FF0000” LINK=”00000”>

The body of the code

</BODY>

 

The next modifier that can be used is the command to add a background. The first thing that we will need to do is find a background. A background is normally a gif file that contains an image that will be repeated over and over again when the browser downloads it. It is not a good idea to have a very big background or have one that is not a design. Next the command for the background must be entered into the top body section of parameters. The command for a background is simply the word BACKGROUND. If you have a gif called background.gif you would enter BACKGROUND=”background.gif”. It is not necessary to have a background color if you have a background image.

Here is what the final source of the web page above would look like, with the BACKGROUND command inserted where the BGCOLOR command would be:

 

 

<BODY BACKGROUND=”background.gif” TEXT=”0000FF” VLINK=”FF0000” LINK=”00000”>

The body of the code

</BODY>

 

NOTE= Be sure to upload the background separately to your web server.

The Paragraph Command

The next command is the paragraph command. This command tells the web browser the paragraph that you are typing has ended. In order to type something in HTML you just type it directly into the source. When you enter the paragraph command this tells the web browser to make skip a small space between what you are typing before the paragraph command and after the paragraph command. Unlike most commands you only need a paragraph command at the end of the paragraph. If you start typing on your web page you would type then, at the end of your paragraph, put the paragraph command then continue typing. The paragraph command may also be used to make a small space between other things like pictures if the break command make too big of a space. (The break command will be discussed later.)

The paragraph command is designated by an angle bracket “<“ then a P then another angle bracket “>”. When typing, only insert the paragraph command at the end of the paragraph because it will make a space that will be unsightly if the page is not at the end of a paragraph.

 

The next command is the paragraph command.

<P>

The paragraph command is designated by an angle bracket “<“ then a P then another angle bracket “>”.

 

NOTE= There is no need to enter a tab, a tab key is usually entered before a paragraph in a word processor to create five spaces, before a paragraph in HTML because the internet does not use that manner for paragraph typing.

The Block Quote Command

If it is needed to make the paragraph indented because it is a quote a command can be used to do this. This command is an angle bracket “<“ followed by the word BLOCKQUOTE followed by an angle bracket “>”. Then you would insert the items that you want indented so that it stands out from the rest of the text in an essay. After you have done that you need to tell the browser to convert all text after that back to normal. This command is an angle bracket “<“ followed by a slash “/” followed by the word BLOCKQUOTE followed by an angle bracket “>”. The final source code for a paragraph that is indented would look like this:

 

<BLOCKQUOTE>

This is a paragraph <P>

</BLOCKQUOTE>

The Address Command

The next command we will discuss is the command which will allow you to put a link to someone else’s page on your page. This feature will also be used to put links on your page to software, images, etc. This command is the A HREF command. In order to use this command you will first need to find another web page, software, an image, or have your page consist of multiple documents. For now we will use my web page’s address, http://computing.net.

When putting a link to other information on the internet you should first and most importantly make sure that the link is correct. I have gone to many pages on the internet that have had incorrect or outdated links and it is very annoying. The second thing that you should do is make sure that the page contains information that is relevant to your web page. For example you don’t want a link to Sun Microsystems on a page about dog psychology, unless your web server is made by Sun but that is another story. Third, you will want to choose a good title for the link. Normally this will be the title of the page, but it could also be a brief description of the page. For example, if you put a link to my page you may want to title the link “Justin Weber’s Computing Center” or you may want to title it “A cool page where one can find some computer help.” The decision on how to title the page is up to you.

 

The command for the A HREF command is designated by an angle bracket “<“ then the words A HREF then a equal sign “=” then the link that you want to put on your page, let’s say my page for now, “http://computing.net” then an angle bracket “>” then a title for the link then an angle bracket “<“ then a slash “/” then a A then an angle bracket “>”.

 

If you wanted the title for the link to my web page to be Justin Weber’s Computing Center, the final source code will look like this:

 

 

<A HREF=”http://computing.net”>Justin Weber’s Computing Center</A>

 

There are modifiers that can be put into the A HREF command that do different things. For example, there are some javascripts that allow a extra command to put a special title in the link location at the bottom. Normally when you hold your mouse over a link the browser will say the location of the link at the bottom, but if you use one of these javascripts it will put whatever you want at the bottom and replace the location. There are probably other javascripts out there that do other unique things with this A HREF command and the javascript will probably explain exactly how to use it with the A HREF command in it’s help file.

It is also probable that you will need to use the A HREF command to link to other sections of your web page. Because of enhancements to HTML throughout it’s existence you do not need to insert the entire address for this. Let’s say the help file on my page is in the same directory as the page that is begin viewed and that the help file is called help.html. I would not need to type http://computing.net/help.html in the A HREF command I would just need to insert help.html:

 

 

<A HREF=”help.html”>Help Me!</A>

 

Basically a link that is on your server has an address relative to your page. Let’s say the windows95 file on my page is in a directory called windows95 and the file is called windows95.html all that I need to insert is:

 

<A HREF=”windows95/windows95.html>Windows95</A>

 

Another useful idea is that if you have a link that is in the parent directory to the directory your document is in all you have to do is enter ../ then the title. Let’s say I have a link to the help page on my windows95 page all I need to do to accomplish this is:

 

<A HREF=”../help.html”>Help Me!</A>

 

NOTE= If you have links on your page that are not to pages made by you you may want to frequently check them to make sure that they are valid. If they become outdated and you leave them on your page this could generate complaints from people that are viewing your page.

 

The next command that we will discuss is the command that is used to link to a certain part of a page. Because pages have been getting larger there is a need to be able to have links to certain parts of them. For example if you had a page that was 1000 lines long and on another page you wanted to have a link to the subject in the last 10 lines if would not be desired to put a link to the top of the page (where a default link with the A HREF command would go) but it would be preferable to put a link to just that section of that page.

 

In order to do this you would need to put a command on the page that you want the link to go to telling the browser the name of that section of the page and where that section starts. You can have multiple sections on a page but I will just talk about having one section. First you must scroll down to the section in the source code where you want the named section to be. After you have done that you would then enter the name of that section. We will name this section Test. In order to name the section a command must be entered. This command is an angle bracket “<“ followed by the letters A NAME followed by an equal sign “=” followed by the name of the section followed by an angle bracket “>”. This name will not be apparent when looking at the document in a browser and will only be used if the browser is told to look for that name on that page. The final source code for the name of the section would look like this:

 

 

<A NAME=”Test”>










Последнее изменение этой страницы: 2018-06-01; просмотров: 214.

stydopedya.ru не претендует на авторское право материалов, которые вылажены, но предоставляет бесплатный доступ к ним. В случае нарушения авторского права или персональных данных напишите сюда...