In HTML, the image is defined by <IMG> tags. <IMG> is an empty label, which means that it only contains attributes and does not close the tag (but end directly with/>). To display images on the page, you need to use the source attribute (SRC). SRC refers to Source. The value of the origin is the URL address of the image. The syntax of the definition of the image is: <img src = url />, URL refers to the location of the storage image. The browser displays the image where the image label appears in the document
<! --- IMG-> <IMG SRC = Images /bjpowerNode.jpg />2. <IMG> other attributes of the label
ALT attribute: used to define a string of replaceable text for images. When the picture cannot be displayed, the text defined by the alt attribute will be displayed. When the picture is normal, there will be suspended prompts on the mouse, such as clicking Check the big picture. Adding textual attributes (ALT) to the images on the page is a good habit, which helps better display information, and it is very useful for those who use pure text browsers. Moreover, the XHTML 1.0 standard has been forced to use the ALT attribute. When the <IMG> label does not have an alt attribute, there will be the following prompts in VS.
Title attribute: The text used to display when the mouse is placed on the picture is the explanation of the picture explanation text. For example, many websites now have clicks and jump to the next page.
The difference between Alt attributes and title attributes: <IMG> The ALT attribute of the label is a replacement language made by browsing users due to the browser compatibility, failure of loading, or an error of the address. ; The Title attribute of the IMG tag is to express some additional information of the picture. Its properties are a kind of remarks or annotations. The text is displayed in the past.
Border attribute: Specify the border, border = 0 does not display the frame.
Width (width) and height (height) attributes: specify the display size of the picture, if it is not specified, it is the original size of the picture. It is best to specify Width and Height, even if the original size is, because if the size is not specified, the picture will not occupy the page position. After downloading the picture, the size is adjusted, which will cause the page layout to be messy. If width, height is specified, even if the picture is not loaded, the position will be presented first.
<IMG SRC = Images/1499417200939140562.jpg/> <!-Specify the picture of Alt attributes-> <IMG SRC = Images/1499417200939140562.jpg <! ES /xxxx.gif <!-RGB color value-> <body bgcolor = black> <!-color name->2. Background (background)
The background attribute sets the background to the image. The attribute value is the URL of the image. If the image size is smaller than the browser window, the image will be copied in the entire browser window. Note: In order to speed up the display speed of the webpage and improve the friendship of the website, the size of the background image should not exceed 10K.
<body background = Clouds.gif> <!-Compared with url-> <body background = http://www.bjpowerNode.com /Clouds.gif> <!-Absolute URL->
Note: Among the new standards, the background color of the HTML element (BGCOLOR) and the background image (Background) attributes have been abandoned, but the background color and background picture of the element are set with CSS.
Third, color (color)1. Color
Color (Color) is mixed with red (red), green (green), and blue. Color value: The color is defined by a hexadecimal symbol. This symbol consists of red, green, and blue values (RGB). The minimum value of each color is 0 (hexadecimal:#00). The maximum value is 255 (hexadecimal: #ff). For example, the black color is called Black, and the hexadecimal is represented by#000000, and the RGB value is RGB (0,0,0).
2. Color name
Only 16 color names are supported by the HTML4.0 standard of W3C. They are: AQUA (light green), Black (black), blue (blue), fuchsia Dark blue), olive (olive), Purple (purple), red (red), silver (silver), team (cyan), white (white), YELLOW (yellow). If you need to use other colors, you need to use the color value of hexadecimal.
3.Web security color
A few years ago, when most computers supported only 256 colors, a series of 216 web security colors were recommended as the web standard. The reason is that Microsoft and Mac operating systems use 40 different retained fixed system colors (about 20 species of both sides each use). 4.216 cross -platform color
Initially, 216 cross -platform Web security color was used to ensure that when the computer uses a 256 -colored color plate, all computers can correctly display all colors.