Html Study Notes 3. html Study Notes

Source: Internet
Author: User

Html Study Notes 3. html Study Notes
1. Table title and header:

<Table> <caption> transcript </caption> <tr> <th> name </th> <th> Chinese </th> <th> English </th> <th>> mathematics </th> </tr> <td> 100 </td> <td> 100 </td> <td> 100 </td> </tr> </table>


2. Merge rows:
<Table> <! -- Row 1st --> <tr> <td> name: </td> <td> James </td> </tr> <! -- Row 2nd --> <tr> <td rowspan = "2"> favorite fruit: </td> <td> Apple </td> </tr> <! -- Row 3rd --> <tr> <td> banana </td> </tr> </table>

3 label


File address of the src Image
Prompt text when the alt image cannot be displayed
Title text with the mouse over the image

<Html xmlns = "http://www.w3.org/1999/xhtml"> 

4. relative and absolute paths of images
I. "webpage 1" references pictures of one piece
If you reference the image "one piece" on "webpage 1", there are two ways to write the image path:


Statement 1:
Statement 2:
The above two methods can achieve the effect. Why? This is the problem of relative paths and absolute paths.


1. Relative Path
The "relative path" method is used to locate the location of different files on the same website. We can analyze that the "webpage 1" and images folders are located under the root directory of the website BookTest, while the one piece picture is located under the images folder, so src should be "images/one piece .jpg ".


Some may ask, in section 2, how do I write "webpage 1" to reference the relative path of the one piece image?





Relative Path


The answer should be: . At this time, webpage 1 and the one piece picture are located in the same directory.
2. absolute path

For Statement 2, the "absolute path" method is used. The so-called absolute path is the complete path.

(2) "webpage 2" references pictures of one piece

Let's go back to the directory content in Figure 1. If the image "one piece" is referenced in page 2, there are two ways to write the image path:

  • Statement 1:
  • Statement 2:
1. Relative Path

Similarly, one is relative path, and the other is absolute path. We can analyze that webpage 2 is located in the test folder, while the one piece image is located in the images folder. Therefore, compared with "webpage 2", the image of one piece is located in the images folder under the level-1 directory on "webpage 2. Therefore, src is written as "../images/one piece .jpg" alt = "one piece ". "../" Indicates a directory of the upper level. You must understand this method.

Now we can summarize the relative path writing method. The relative path is first used to analyze the relationship between the current webpage location and the image location, and then express the relative relationship between them in one way.

2. absolute path

The second method is the "absolute path" method, which is the same as the method used to reference the image of one piece on "webpage 1. Absolute path. As long as your image is not moved to another place, the path of all webpages referencing the image is the same. You can understand it with a bit of thought.

Reference: http://www.lvyestudy.com/les_hj/hj_7.2.aspx



5. Three bitmap formats: .jpg?##.png=##.gif ".

(1) JPG format
JPG can be used to process large-area images, such as photos and webpages.


(2) PNG format
PNG supports transparent information. The so-called transparent, that is, the image can appear on other page files or page images, 1. It can be said that PNG is an image specially created for the web. Most page designers usually choose to use PNG when adding lLogo or some small embellishment images to the page.


Due to the large size of the JPG format, it is impossible to use a large range of jpg format images on the webpage while ensuring that the images are clear and realistic. PNG images are small in size and lossless compression, which ensures the speed of opening webpages. Therefore, PNG images are a good choice.


Thanks to the excellent features of PNG, PNG images can be called "specialized Webpage Design Formats ".


(3) GIF format
GIF only supports images of less than 256 colors. Therefore, the effect of GIF images is poor. However, the biggest feature of GIF is that it can be used for animation. The image author uses the image processing software to set static GIF images to single frames, connect these single frames, set the interval between the image and the next image, and save the image as GIF. It can be said that this is a simple frame-by-frame animation. Animation in this format is widely used on the Internet.






Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.