HTML Basics--Site Image display page

Source: Internet
Author: User

1. Picture Label

Property:
SRC: Refers to the path where the picture is displayed (location)
Absolute path: D:\Pictures\Saved Pictures
Relative path:
① Same level: Write file name directly or./File name
② upper level:.. /File name
③ Next Level: Write the directory name/file name
Width: Specifies how wide the picture is, whether the value can be a pixel value, or it can be a percentage
Height: Specifies the height of the image, which can be either a pixel value or a percentage
ALT: A hint when the picture is not displayed correctly (the property is displayed in relation to the browser and browser version)

2, first prepare two pictures placed in the IMG folder,

The code is as follows:

1 <!DOCTYPE HTML>2 <HTML>3     <Head>4         <MetaCharSet= "UTF-8">5         <title>Page Image Display page</title>6     </Head>7     <Body>8         <imgsrc=".. /img/logo2.png "width= "260px"Height= "45px"alt= "logo image"/>9         <imgsrc=".. /img/header.png "width= "300px"Height= "45px"alt= "header Picture"/>Ten     </Body> One </HTML>

The results are as follows:

3, if the picture is placed in the case two: the Website picture information folder, relative path directly write path name, src= "Logo2"

If the picture location and path are inconsistent, the picture does not display properly, and the contents of Alt are displayed as follows:

HTML Basics--Site Image display page

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.