How to add a border to an image using HTML: First add a stroke to the outside box, and add the stroke border directly to the img image tag; then modify the stroke size and color of the image.
The operating environment of this tutorial: windows7 system, html5 version, DELL G3 computer.
How to add borders to pictures using HTML:
1. As shown in the picture, in the code tool, first create several pictures, as shown in the picture here. The img picture is The div box contains; then set the width of the box and then float it; the picture fills the entire box size
2. The effect is like this, as shown in the figure
3. There are two ways to add a stroke effect to a picture. Add a stroke to the picture or add a stroke to the outside box. First, look at adding a stroke to the picture, as shown in the picture; that is, directly in Add a stroke border to the img image tag
4. As shown in the figure, the picture effect after adding a stroke
##5. If you want to change the stroke size and color of the picture, modify it here 6. Then if you are adding a stroke effect to the div box, and follow The method of adding to img is the same as the border attribute 7. Both methods can be successful. It depends on which method you are used to.Related learning recommendations:
The above is the detailed content of How to add borders to pictures using html. For more information, please follow other related articles on the PHP Chinese website!