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

被折叠的 条评论
为什么被折叠?



