[关闭]
@Sarah 2015-12-25T23:03:39.000000Z 字数 13233 阅读 1525

HTML II (codecademy)

HTML


以下部分先是review

What you'll be making

Before we ask you to write a bunch of code, we think it's helpful for you to see exactly what you'll be making in this project.

Check out the index.html file and the Result tab for an example—we've made our very own webpage.

Instructions
Hit Save & Submit Code to start building your own!

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Result</title>
  5. </head>
  6. <body><h1>YEAH SANDWICHES</h1>
  7. <img src="http://bit.ly/RhrMEn" />
  8. <p>I like eggs.</p>
  9. <p>And ham!</p>
  10. <p>But mostly sandwiches.</p>
  11. </body>
  12. </html>

Every house needs a frame

An HTML page is sort of like a house: it needs a certain number of essential structures in order to work.

Just like a house, an HTML page needs a frame. In this case, your frame is made of , , , and tags.

Instructions
Your webpage is blank as the day it was born! Let's add five things:

The tag
Your < html> tags
Your < head> tags
< title> tags (with any title you like!) between your head tags
Your tags

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title> </title>
  5. </head>
  6. <body>
  7. </body>
  8. </html>

It's better with a header

Your webpage could use an < h1> header between the body tags to let everyone know that the page is about you.

Instructions
Create an < h1> tag inside your body tags. Between your opening < h1> and closing < /h1> tags, type your name for all to see!

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title> </title>
  5. </head>
  6. <body>
  7. <h1>Sarah will finish this</h1>
  8. </body>
  9. </html>

Great! There's only one problem: your webpage is like a house with no doors. There's no way to get in or out! We'll fix that by adding a couple of links.

Once you successfully add your links and hit Run, you've finished! Revel in the glory of your newly created webpage.

If it still looks a little basic to you, don't worry. We'll soon teach you CSS to make your webpages look sharp!

Instructions
Add at least two links to your webpage. You can turn an image or a bit of text into a link; you can even turn part of the text inside your

tags into a link!

Check out the Hint if you've forgotten how the tag works.

?

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title> </title>
  5. </head>
  6. <body>
  7. <h1>Sarah will finish this</h1>
  8. <img src="http://7xinhd.com1.z0.glb.clouddn.com/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202015-11-30%20%E4%B8%8B%E5%8D%8810.03.11.png" />
  9. <p> well hahahahhahahaha this is the first paragraph
  10. </p>
  11. <a href="http://www.baidu.com"><p> 把这段话变成链接了
  12. </p>
  13. </a>
  14. <a href="http://www.baidu.com"><img src="http://7xinhd.com1.z0.glb.clouddn.com/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202015-11-30%20%E4%B8%8B%E5%8D%8810.03.30.png" />
  15. </a>
  16. <p> well qqqqqqqqqqq
  17. </html>

HTML BASIC II

Introduction

Let's continue learning more HTML. You've already covered a lot: how to set up and tags, how to make headings and paragraphs, and how to add images and links.

In this course, we'll take it to the next level:

a. Making ordered and unordered lists
b. Changing font size, color and type
c. Changing the background color
d. Aligning the text

Instructions
Let's get warmed up by adding a in the .
In the body, create a paragraph (using

). Write anything you like!

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>aaaaa</title>
  5. </head>
  6. <body>
  7. <p>
  8. paragraph1
  9. </p>
  10. </body>
  11. </html>

Indentation is your friend

Now is a good time to quickly mention indentation—that is, the amount each line is spaced in from the margin. You'll notice that when we place tags inside of other tags, we indent them more. This really helps make your code more readable!

Check out our indentation in the editor to the right. Try to follow this indentation style when you're writing HTML so you don't get confused.

Instructions
Hit Save & Submit Code to continue.

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. </head>
  6. <body>
  7. </body>
  8. </html>

Ordered lists

Good! Now let's learn how to make ordered lists. An ordered list is simply a list that is numbered, like the one below.

On line 8, we begin the ordered list with the opening tag

    .
    On lines 9 – 11, we wrap (i.e. surround) each individual item with
  1. and
  2. tags.
    Because each listed item is only on one line, we put the entire element on one line.
    On line 13, we finish the ordered list with the closing tag

Instructions
On line 14, create an

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注