练习 | css页面练习案例

纸质卡片

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			div.card{
				width:250px;
				text-align: center;
				box-shadow: 0 4px 8px 0 rgba(0,0),0 6px 20px 0 rgba(0,0,0,0.3); 
				border:3px solid gold ;
				margin:30px 40px;
			}
			div.header{
				background-color: darkgreen;
				color:white;
				padding:10px;
				font-size: 40px;
			}
			div.container{
				padding:10px;
			}
		</style>
	</head>
	<body>
		<div class="card">
			<div class="header">
				<h1>9</h1>
			</div>
		
		<div class="container">
			<p>June 9,2021</p>
		</div>
		</div>
	</body>
</html>

随便练习

好久没看代码了,可怕的是css我都忘完了,也才半年啊2023.12.12

 

 

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#square{
				width:400px;
				height:400px;
				background-color:green;
			}
			#circle{
				width:200px;
				height: 200px;
				border-radius:50%;
				background-color:white;
				margin:100px;
				display: inline-block;
			}
		</style>
	</head>
	<body>
		<div id="square">
			<div id="circle"></div>
		</div>
	</body>
</html>

 

页面布局

菜鸟教程在线编辑器

疯了,代码不小心删了

响应式表格练习

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
		table th{
			width:140px;
			border-collapse: collapse;
		}
		table,th,tr,td{
			border:1px solid #000000;
		    text-align: center;
			border-spacing: 0px;
		}
		/* 屏幕宽度和表格宽度不一致,加上滑动出现的效果 */
	 	@media screen and (max-width:500px){
				.table-container{
				    overflow-x: scroll; 
				}
				table {
					width:800px;
				}	
		} 
		</style>
	</head>
	<body>
		<div class="table-container">
		<table>
			<th>姓名</th>
			<th>年龄</th>
			<th>爱好</th>
			<th>月薪</th>
			<th>大学学校</th>
			<th>最高学历</th>
			<th>是否入党</th>
			<th>健康码</th>
			<th>是否需要核酸检测</th>
			<th>最近活动轨迹</th>
	    <tr>
			<td>王小二</td>
			<td>12</td>
			<td>放牛</td>
			<td>5元</td>
			<td>暂时没有</td>
			<td>小学</td>
			<td>少先队员</td>
			<td>黄码</td>
			<td>需要</td>
			<td>家-学校-家-放牛</td>
		</tr>
	    <tr>
	 	   <td>李小明</td>
		   <td>15</td>
		   <td>跟小樱一起念书</td>
		   <td>4000元</td>
		   <td>暂时没有</td>
		   <td>初中</td>
		   <td>团员</td>
		   <td>绿码</td>
		   <td>不需要</td>
		   <td>家-学校-家 其他地方等&l
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值