📄 lesson3.html
字号:
<HTML>
<HEAD>
<TITLE>Lesson 3: Basic Tags and Formatting</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H2>Lesson 3: Basic Tags and Formatting</H2>
So you're probably thinking "Okay, I knew that stuff. Teach me something I <u>don't</u> know." Okay, be patient. I think this lesson will give you your fill.<p>
HTML is a language that is coded with <i>tags</i>. They are called tags because they tag parts of a webpage for formatting in a browser. HTML tags are very easy to spot in web page source. They are the things shown that start with a < and end with a >. Most HTML tags have an opening tag (<tag>) to start formatting text and a closing tag (</tag>) to end the formatting. <p>
There are some HTML tags that are absolutely necessary in an HTML page. Those tags are as follows:<p>
<HTML>' and </HTML>': Usually put at the top (<HTML>) and bottom (</HTML>) of an HTML page. This tag tells the browser that this page is an HTML page.<p>
<HEAD> and </HEAD>: This is where information about the entire page is placed.<p>
<TITLE> and </TITLE>: This tag needs to be put between the <HEAD> and </HEAD>. This tag gives a name for your page. The name won't be shown in the the text of the page, but rather in the top of the browser window.<p>
<BODY> and </BODY>: This tag defines the body portion of the page. Later we will learn how to use the <BODY> tag to add background colors, text colors, and margins.<p>
Now that we know the required tags, I'm going to put my text that I gathered in the <A HREF="lesson2.html">last lesson</A> in the proper web page format.<p>
<HTML><br>
<HEAD><br>
<TITLE>Justin's Homepage</TITLE><br>
</HEAD><p>
<BODY>
Welcome to Justin's Web Page!<p>
Hi, My name is Justin. I built this web page because I
love coding in HTML! I could do it all day long!<p>
I am a lover of programming languages, and love to design
and produce web content.<p>
Thanks for visiting my page!<p>
Yours Truly,<br>
-Justin
<p>
</BODY>
</HTML>
But wait 1 second! I typed that, and opened it with my browser, and it does'nt come out like that! What? Does it come out like this:<p>
Welcome to Justin's Web Page!
Hi, My name is Justin. I built this web page because I
love coding in HTML! I could do it all day long!
I am a lover of programming languages, and love to design
and produce web content.
Thanks for visiting my page!
Yours Truly,
-Justin
<p>
Yes? Ohmygod! We forgot the formatting tags!<p>
The <p> tag can add paragraph spacing to your page. The <BR> tag adds a single line break to your page.<p>
These tags do not need a <p> and </p>, or <BR> and </BR>, unlike the other tags.<p>
So now our page is coded like this:<p>
<HTML><br>
<HEAD><br>
<TITLE>Justin's Homepage</TITLE><br>
</HEAD><p>
<BODY><p>
Welcome to Justin's Web Page!<p><p>
Hi, My name is Justin. I built this web page because I
love coding in HTML! I could do it all day long!<p><p>
I am a lover of programming languages, and love to design
and produce web content.<p><p>
Thanks for visiting my page!<p><p>
Yours Truly,<BR><BR>
-Justin<p>
</BODY><BR>
</HTML><p>
Great! We have format! Now i'll bet you want that first line to be large, right? This can be accomplished by what's called a "header". The header is made by putting in <Hx> "header text goes here" </Hx>, where the "x" is a number from 1-6, the bigger the number the bigger the header. So in our page it looks like <H2>Welcome to Justin's Web Page!</H2>. Note that i removed the <p> tag, since header are already paragraph spaced!<p>
Go ahead and make your page, save it with a ".html" extension at the end (HTML pages all need either .htm or .html extensions) open it with your browser and meet me at the <A HREF="lesson4.html">next lesson!</A><p>
<A HREF="../main3.html">Back to Blacksun's Mainpage</A>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -