css背景边框列表链接

ife2018 第四天,背景边框列表链接和更复杂的选择器

课程目标

掌握 CSS 稍微复杂的一些选择器,还有背景,边框等一些 CSS 样式属性。

background属性

background-color: #fff;
background-image: url(img/background.jpg)
background-repeat: no-repeat;
background-attachment: fixed;
background-position: top left;

backgorund-repeat

no-repeat -停止完全重复背景。
repeat-x —水平重复。
repeat-y —垂直重复。
repeat—默认值;双向重复。

background-attachment

注意:background-position的值和 background-attachment息息相关,background-position的位置是相对于整个页面的位置。以下是属性值
inherit: 继承父级
fixed : 固定在页面上
scroll: 随着页面滚动

background-position

在这里插入图片描述

CSS3中的background-size

表示铺满整个屏幕

background-size: 100% 100%;

background 的简写形式:

background: [background-color] [background-image] [background-repeat] [background-attachment] [background-position] / [ background-size] [background-origin] [background-clip];

例如:规定背景图片,不重复,固定在左上角

background: url() no-repeat fixed top left;

渐变gradient

线性渐变 linear-gradient
.linear-gradient {
  background: linear-gradient(to right,
      red, orange, yellow, green, blue, indigo, violet);
}
径向渐变 radial-gradient

径向渐变从中心点(原点)开始逐渐过渡颜色。它们是通过radial-gradient()函数生成的。

.radial-gradient {
  background: radial-gradient(red, yellow, rgb(30, 144, 255));
}

边框border

border属性中的border-style.
在这里插入图片描述
例如:

div{width:200px;height:200px;background:#3388ff; border: 0.5rem outset #296ece;

在这里插入图片描述
更多border属性在MDN中查看。

列表list

常见三种列表类型。
<ol><li>item1</li><li>item2</li></ol>//有序列表
<ul><li>item1</li><li>item2</li></ul>//无序列表
<dl><dt>item1<dd></dd><dd>item2</dd></dt></dl>//描述性列表 dt里允许有多个dd
列表样式

更多 list css 属性细节在MDN中查看。

参考地址:
https://developer.mozilla.org/en-US/docs/Web/CSS/border

https://www.w3school.com.cn/cssref/pr_border-style.asp

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值