既然不是仙吧 关注:18贴子:1,449

【自学笔记】html

只看楼主收藏回复

这帖请不要跟帖,我保存笔记用. 到"日记"那个帖子留言吧. 谢谢. :)
那个帖子应该改名叫"闲聊专贴" Orz


1楼2006-05-31 13:44回复
    HTML stands for Hyper Text Markup Language 

    ------------------------------------------
    eg)
    <html>
    <head>
    <title>Title of page</title>
    </head>
    <body>
    This is my first homepage. <b>This text is bold</b>
    </body>
    </html>

    注:将正文变大不要用<h>,用<b>
    ------------------------------------------

    Headings are defined with the <h1> to <h6> tags. <h1> defines the largest heading. <h6> defines the smallest heading.

    The<br>tag is used when you want to end a line, but don't want to start a new paragraph. The<br>tag forces a line break wherever you place it.

    <!-- This is a comment -->

    ----------------------------------------
    <p>
    To break<br>lines<br>in a<br>paragraph,<br>use the br tag.
    </p>

    显示:

    To break
    lines
    in a
    paragraph,
    use the br tag.

    ----------------------------------------


    2楼2006-05-31 13:52
    回复
      <p>
       My Bonnie lies over the ocean.
       My Bonnie lies over the sea.
       My Bonnie lies over the ocean.
       Oh, bring back my Bonnie to me.
      </p>

      显示:

      My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the ocean. Oh, bring back my Bonnie to me. 

      Note that your browser simply ignores your formatting!

      解决方法:Preformatted text

      <p>The pre tag is good for displaying computer code:</p>

      <pre>
      for i = 1 to 10
       print i
      next i
      </pre>

      显示:

      The pre tag is good for displaying computer code:

      for i = 1 to 10
       print i
      next i


      3楼2006-05-31 14:00
      回复
        <html>
        <body>

        <h1 align="center">This is heading 1</h1>

        <p>The heading above is aligned to the center of this page. The heading above is aligned to the center of this page. The heading above is aligned to the center of this page.</p>

        </body>
        </html>

        显示:

         This is heading 1(其实这个地方应该是大字体)
        The heading above is aligned to the center of this page. The heading above is aligned to the center of this page. The heading above is aligned to the center of this page.


        4楼2006-05-31 14:02
        回复
          Horizontal rule <hr>

          Background color:
          <html>
          <body bgcolor="yellow">
          <h2>Look: Colored Background!</h2>
          </body>
          </html>

          Basic HTML Tags Tag Description 
          <html> Defines an HTML document 
          <body> Defines the document's body 
          <h1> to <h6> Defines header 1 to header 6 
          <p> Defines a paragraph<br>Inserts a single line break 
          <hr> Defines a horizontal rule 
          <!--> Defines a comment


          5楼2006-05-31 14:06
          回复
            <html>
            <body>

            <b>This text is bold</b><br><strong>
            This text is strong
            </strong><br><big>
            This text is big
            </big><br><em>
            This text is emphasized
            </em><br><i>
            This text is italic
            </i><br><small>
            This text is small
            </small><br>This text contains
            <sub>
            subscript
            </sub><br>This text contains
            <sup>
            superscript
            </sup>

            </body>
            </html>


            6楼2006-05-31 14:07
            回复
              <html>
              <body>

              <code>Computer code</code><br><kbd>Keyboard input</kbd><br><tt>Teletype text</tt><br><samp>Sample text</samp><br><var>Computer variable</var><br><p>
              <b>Note:</b> These tags are often used to display computer/programming code.
              </p>

              </body>
              </html>


              7楼2006-05-31 14:09
              回复
                <html>
                <body>

                <abbr title="United Nations">UN</abbr><br><acronym title="World Wide Web">WWW</acronym>

                <p>The title attribute is used to show the spelled-out version when holding the mouse pointer over the acronym or abbreviation.</p>

                <p>This only works for the acronym element in IE 5.</p>

                <p>This works for both the abbr and acronym element in Netscape 6.2.</p>

                </body>
                </html>


                9楼2006-05-31 14:13
                回复
                  <html>
                  <body>

                  <p>
                  If your browser supports bi-directional override (bdo), the next line will be written from the right to the left (rtl):
                  </p>

                  <bdo dir="rtl">
                  Here is some Hebrew text
                  </bdo>

                  </body>
                  </html>

                  如果浏览器支持,则显示:

                  txet werbeH emos si ereH


                  10楼2006-05-31 14:16
                  回复
                    <html>
                    <body>

                    Here comes a long quotation:
                    <blockquote>
                    This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation. This is a long quotation.
                    </blockquote>

                    Here comes a short quotation:
                    <q>
                    This is a short quotation
                    </q>

                    <p>
                    With the block quote element, the browser inserts line breaks and margins, but the q element does not render as anything special.
                    </p>

                    </body>
                    </html>


                    11楼2006-05-31 14:18
                    回复
                      <html>
                      <body>

                      <p>
                      a dozen is 
                      <del>twenty</del> 
                      <ins>twelve</ins> 
                      pieces
                      </p>

                      <p>
                      Most browsers will overstrike deleted text and underline inserted text.
                      </p>

                      <p>
                      Some older browsers will display deleted or inserted text as plain text.
                      </p>

                      </body>
                      </html>

                      显示:
                      http://www.w3schools.com/html/tryit.asp?filename=tryhtml_del


                      12楼2006-05-31 14:19
                      回复
                        各类tag
                        http://www.w3schools.com/html/html_formatting.asp


                        13楼2006-06-01 14:08
                        回复
                          Some characters have a special meaning in HTML, like the less than sign (<) that defines the start of an HTML tag. If we want the browser to actually display these characters we must insert character entities in the HTML source.

                          A character entity has three parts: an ampersand (&), an entity name or a # and an entity number, and finally a semicolon (;). 

                          To display a less than sign in an HTML document we must write: < or < 

                          The advantage of using a name instead of a number is that a name is easier to remember. The disadvantage is that not all browsers support the newest entity names, while the support for entity numbers is very good in almost all browsers.

                          Note that the entities are case sensitive.


                          14楼2006-06-04 14:04
                          回复
                            Result |Description |Entity Name |Entity Number 
                             non-breaking space     
                            < less than < < 
                            > greater than > > 
                            & ampersand & & 
                            " quotation mark " " 
                            ' apostrophe ' (does not work in IE) ' 

                            ¢ cent ¢ ¢ 
                            £ pound £ £ 
                            ¥ yen ¥ ¥ 
                            § section § § 
                            © copyright © © 
                            ® registered trademark ® ® 
                            × multiplication × × 
                            ÷ division ÷ ÷


                            15楼2006-06-04 14:14
                            回复
                              <a href="lastpage.htm">
                              This text</a> is a link.

                              "This text"会显示为超链接.地址为:.../lastpage.htm

                              <a href="lastpage.htm">
                              <img border="0" src="buttonnext.gif" width="65" height="38">
                              </a>
                              超链接以图片显示


                              16楼2006-06-04 15:03
                              回复