CSS Image Gallery
Use CSS to create an image gallery:
is displayed as follows




##
php.cn
Code explanation:
CSS picture gallery, each display uses 2 layers of divs; the outer css class is img, including an tag, in ; The
div.img, . is the css class Selector, defining the attributes of the "img" class:
Margin: 2px;
Border: 1px, solid line, color;
Height: automatic;
Width: automatic;
Left Floating;
Center alignment of text;
div.img (img tag is an inline element)
Inline element; its own independent space, which exists attached to other block-level elements, therefore, for Setting attributes such as height, width, inner and outer margins for inline elements is invalid;
Margin: 3px;
Border: 1px, solid line, color;
div.desc
Font weight: Normal
Width: 120px
Margin: 2px
div .img a:hover img {border: 1px solid #0000ff;}





