css笔记

本文通过实例讲解了如何使用CSS设置图片背景及元素布局。具体包括使用URL定位图片资源,设置背景图片的位置、大小及重复方式,并通过边框属性增强视觉效果。同时,演示了如何为不同元素(如div和h1标签)应用这些样式。

css笔记

There is no nutrition in the blog content. After reading it, you will not only suffer from malnutrition, but also impotence.

<html>
	<head>
		<style>
			/*
			body {
				background: #ccc url(a.png) no-repeat;
			}
			*/
			
			#branding {
				width: 400px;
				height: 200px;
				background: url(a.png) no-repeat left center;
				border: 1px solid;
			}
			h1 {
				padding-left: 120px;
				background: url(a.png) no-repeat left center;
				border: 1px solid;
				width: 200px;
			}
		</style>
	</head>
	<body>
		<div id="branding">
			
		</div>
		<h1>标题</h1>
	</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值