<li style='width:150px'> <img src="/static/imghwm/default1.png" data-src=" " class="lazy" style="max-width:90%" / alt="css 这样效果怎么搞_html/css_WEB-ITnose" > <span class="del">删除</span> <span class="addordernum">排序</span> <span class="minusordernum">排序</span> </li>
希望实现 span 能贴到 li 标签的 右上角/左下角/右下角
不用 position:relative; 有其他的办法吗,, 这个属性要算半天偏移量,扩展性也差,,,,,,
回复讨论(解决方案)
li设置相对定位,然后span绝对定位到四个角,没什么可计算的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style>ul{margin:100px auto;padding:0;width:500px;}img{width:500px;height:400px;}li{ position:relative; list-style:none;}.del{position:absolute;right:0;top:0;}.addordernum{position:absolute;left:0;bottom:0;}.minusordernum{position:absolute;right:0;bottom:0;}</style></head><body><ul><li> <img src="/static/imghwm/default1.png" data-src="http://img.baidu.com/img/image/3bf33a87e950352a5947ae485143fbf2b2.jpg" class="lazy" / alt="css 这样效果怎么搞_html/css_WEB-ITnose" > <span class="del">删除</span> <span class="addordernum">排序</span> <span class="minusordernum">排序</span> </li></ul></body></html>
楼上正解 真热心
告诉LZ,其实很多标签都可以用 div 代替。。
li 标签我用过,老实说很不灵活,而且兼容性也不好。。
就比如table标签,不同浏览器下显示效果都不一样。。。
能用div的就尽量用div替代。。img图像,a 超链接都可以用div替代呢。。

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 using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

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.

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

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

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

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.

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit


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

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

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

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor
