div+css (ul li) implements list layout with text above the picture
css style sheet code:
html layout code:
Rendering:
In the html layout part, you can add the corresponding div according to your needs.
1. Explanation of CSS key style words
1), ul.imglist{ margin:0 auto; width:536px; overflow:hidden}
Use margin:0 auto to center the ul structure layout;
Use overflow:hidden, because the use of float attributes by the children of ul will produce Float, so use clear children and use float to cause the problem that the parent cannot be opened;
Use width width: 536px; fixed width allows the child li to accurately row only 3 effects
2), ul.imglist li{ float:left; padding:4px 8px; width:160px}
float:left, let li start juxtaposition from the left;
padding:4px 8px set the spacing between li and li boxes;
width :160px The li width must be set and fixed (the width value is measured through the slicing tool of ps software)
3), ul.imglist li img{ display:block; width:160px; height:90px}
display:block sets an exclusive line for the image;
width:160px; height:90px The image height and width must be fixed
4), ul.imglist li span{ display:block; width:100%; height:30px; line-height:30px; background:#F6F6F6}
display:block allows span to set the width and height to take effect while occupying one line;
width:100%; height:30px; Set the width and height. A width of 100% will inherit the width of the parent li and is equal to the setting (160px width. The advantage of setting a 100% width is that the 100% width is automatically calculated with the parent width. Keep the width consistent);
line-height:30px; Set the text to be vertically centered in 30px;
background: #F6F6F6 Set the span background color
2. HTML key points
Use ul li combined list tag layout. Each li box contains pictures + text title content. The li box directly uses a hyperlink tag to wrap the picture and text content. Use the img tag to introduce pictures and span. The label and img form two boxes, and the CSS sets the style (display:block) of an exclusive row of functional effects to avoid text and pictures being arranged in a row instead of a top-down structure.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.
