CSS 图片
这个问题太泛泛了吧,怎么区分大小图片呢?
下面假设小图以_s结尾。
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <style type="text/css"> img[src$='_s.jpg'] { border:1px solid #ccc; } </style></head><body><img src="http://img4.cache.netease.com/cnews/2013/5/14/20130514124124343269bf.jpg" / alt="??一下 CSS ??器 可以?? 大于一定 尺寸的图片??_html/css_WEB-ITnose" ><img src="http://img4.cache.netease.com/cnews/2013/5/14/20130514124124343269bf_s.jpg" / alt="??一下 CSS ??器 可以?? 大于一定 尺寸的图片??_html/css_WEB-ITnose" ></body></html> 不行,不过可以用这种方法遍历
$("img").each(function(){
if($(this).width>200){
$(this).addClass("big");
}else{
....
}
})
大约如此.
if($(this).width ()
不行,不过可以用这种方法遍历
$("img").each(function(){
if($(this).width>200){
$(this).addClass("big");
}else{
....
}
})
大约如此.
if($(this).width ()
这个问题太泛泛了吧,怎么区分大小图片呢?
下面假设小图以_s结尾。
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <style type="text/css"> img[src$='_s.jpg'] { border:1px solid #ccc; } </style></head><body><img src="http://img4.cache.netease.com/cnews/2013/5/14/20130514124124343269bf.jpg" / alt="??一下 CSS ??器 可以?? 大于一定 尺寸的图片??_html/css_WEB-ITnose" ><img src="http://img4.cache.netease.com/cnews/2013/5/14/20130514124124343269bf_s.jpg" / alt="??一下 CSS ??器 可以?? 大于一定 尺寸的图片??_html/css_WEB-ITnose" ></body></html>
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号