CSS/HTML 简单样式配合PS做一个小实例(Html+Css)

这篇博客通过课后作业的形式,详细介绍了CSS中的相对定位和绝对定位概念。相对定位允许元素在其原始位置基础上进行偏移,但仍然保留其原有空间;而绝对定位则将元素从正常文档流中移除,不占用空间,基于最近的已定位祖先元素进行定位。文中通过代码示例和解释帮助读者理解这两种定位方式,并提醒了绝对定位可能与其他元素重叠的问题,强调了z-index属性在控制堆叠顺序中的作用。
摘要由CSDN通过智能技术生成

课后作业1

在这里插入图片描述

代码:

<!doctype html>
<html>
<head>
<meta charset=“utf-8”>
<title>无标题文档</title>
<style>
#title{
width:277px;
height:206px;
}
 #title-1{
width:277px;
height:206px;
background:url(img/wether.gif) no-repeat;
}
     #title-2{
width:277px;
height:39px;
background:#0664d6 url(img/sun.gif) no-repeat 228px 8px;
border-bottom:1px solid #0e2599;
}
 #title-3{
width:277px;
height:39px;
background:#0664d6 url(img/winter.gif) no-repeat 228px 8px;
border-top:#08aaf5 solid 1px;
border-bottom:1px solid #0e2599;
}
#title-4{
width:277px;
   height:39px;
background:#0664d6 url(img/winter.gif) no-repeat 228px 8px;
border-top:#08aaf5 solid 1px;
}
</style>
</head>

<body>
        <div id=“title”>
       <div id=“title-1”></div>
       <div id=
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值