css 这样效果怎么搞_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:31:02
Original
1138 people have browsed it

        <li style='width:150px'>            <img    style="max-width:90%" src=" " / alt="css 这样效果怎么搞_html/css_WEB-ITnose" >            <span class="del">删除</span>            <span class="addordernum">排序</span>            <span class="minusordernum">排序</span>        </li>
Copy after login


希望实现 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="http://img.baidu.com/img/image/3bf33a87e950352a5947ae485143fbf2b2.jpg" / alt="css 这样效果怎么搞_html/css_WEB-ITnose" >            <span class="del">删除</span>            <span class="addordernum">排序</span>            <span class="minusordernum">排序</span>        </li></ul></body></html>
Copy after login

楼上正解  真热心

告诉LZ,其实很多标签都可以用 div 代替。。
li 标签我用过,老实说很不灵活,而且兼容性也不好。。
就比如table标签,不同浏览器下显示效果都不一样。。。
能用div的就尽量用div替代。。img图像,a 超链接都可以用div替代呢。。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template