博主信息
博文 48
粉丝 2
评论 3
访问量 47110
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
4月3日作业—jQuery常用的选择器函数
黑猫警长的博客
原创
633人浏览过

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes">
	<title>祈福供香,孩子平安吉祥!</title>
	<style type="text/css">
		*{ margin:0;padding: 0; font-weight: normal;}
		a{ text-decoration: none; }
		body{ font-size:14px;font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;}
		header{height: 250px; overflow: hidden; }
		.top{ background:#d75847; height: 70px;border-bottom-left-radius: 50%; border-bottom-right-radius: 50%; text-align: center;}
		.top span{ width: 80px; margin:0 auto; display: block; }
		.top span img{ width: 100%;height: 100%; border-radius: 50%; margin-top:40px; }
		.top h2{color: #393939; margin: 30px 0 10px 0px;}
		.top p{ color: #808080 }

		.content{ width: 90%; margin: 0 auto; overflow: hidden; text-align: center;padding-top: 10px; border-top:1px solid #f5f5f5;}
		
		/*.content ul li { float: left; display: block; width:25%;padding:7% 0; border:2px solid #d75644;margin-left:6%;margin-bottom: 5%; color: #d75644; border-radius: 5px; overflow: hidden;}*/
		.content ul li:hover{ background: #d75644; cursor: pointer; color: #fff;}
		/*.content ul li:nth-child(3) ~ *{ margin-bottom: 0;}*/
		.content ul li em{ font-size: 25px; padding:0 10px; }
		.other{ text-align: center; padding:20px 0 0 0;}
		footer{ text-align: center; margin:10% 0 0 0; }
		footer p {margin-top:10px;color: #cdcdcd;}
	</style>
	


</head>

<body>
	<header>
		<div class="top">
			<span><img src="http://43d.cc/front/0401/images/fozu.jpg"></span>
			<h2>随喜支持</h2>
			<p>祈福供香,孩子平安吉祥!</p>
		</div>
	</header>
	<div class="content">
		<ul id="test">
			<li><em>8</em></li>
			<li><em>66</em></li>
			<li><em>88</em></li>
			<li><em>168</em></li>
			<li><em>518</em></li>
			<li><em>888</em></li>
			<li><em><img src="http://43d.cc/front/0330/images/3.jpg"></em></li>
			<li><img src="http://43d.cc/front/0330/images/4.jpg"></li>
			<img src="http://43d.cc/front/0330/images/1.jpg">
		</ul>
	</div>
	<div class="other">其他金额</div>
	<footer>
		<p>赞赏是为了表示鼓励对平台的无偿赠与</p>
	</footer>
</body>
</html>

<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
	$('li').get(1).style.background = 'lightyellow' //索引
	$('li').eq(4).css('color','red') //索引

	$('li').first().css('border-color','#666')
	$('li').last().css('border','none')
	$('ul').find('img').css('width','200')
	var li = $('li').toArray()
	for(var i=0;i<li.length-2;i++){
		li[i].style.float = 'left'
	}
	$('li').each(function(){
		$(this).css('display','block')
		$(this).css('width','25%')
		$(this).css('height','20%')
		$(this).css('padding','7% 0')
		$(this).css('border','2px solid #d75644')
		$(this).css('margin-left','6%')
		$(this).css('margin-bottom','5%')
		$(this).css('border-radius','5px')
		$(this).css('color','#d75644')
		$(this).css('overflow','hidden')
	})
	$('img').filter(':last()').css('width','100%')
</script>

运行实例 »

点击 "运行实例" 按钮查看在线实例


批改状态:合格

老师批语:
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学