html5-css简介和属性:border、background、font
来源:互联网 发布:嵌入式网络编程 编辑:程序博客网 时间:2024/06/18 05:59
8月8日
Css(层叠样式)和html结合有三种常用的,一种不常用的结合方法:
1、内联样式表:在html标签中使用style属性使用样式表
2、嵌入样式表:在html中使用<style></style>
3、外部样式表:使用后缀为.css的文件html
引入<link rel=””type=””href=””/>
4、输入样式表:将一个css文件导入到另外的css文件中
(1)在css文件中头部写@import url(“name.css”)html文件再引入这个css文件
(2)或在html文件中<style>@import url(name.css)</style>
属性:
background-img:url(“”);背景图片,inherit(继承,该继承父类的背景图片,在div中孙子类页可以继续图片,在table中<tr>下的<td>设置的背景图片是不会继续body或者是table,tr不是table的子类)
background-attachment:fixed;背景图片不会随滚动条滚动,而是固定
aackground-repeat:repeat(默认)repeat-x(y)、no-repeat 、inherit(从父元素继承该属性)
background-color:背景颜色
background-position:背景图片的起始位置x轴y轴(top left、top center、bottom left、center left)
background-size:背景图片的大小。设置方法1、px定义宽高,第一个值为宽,只设一个,第二个为auto 2、以父元素的百分比设置% 3、cover使背景图片扩展至足够大,以使背景图像完全覆盖背景区域。
4、contain把图像图像扩展至最大尺寸,以使其宽度和高度完全适应内容区域在background中设置以上全部值
background:#fff url(name.jpg) repeat-x fixed top left;
border和outline属性
整一个边框的设置
border:width、style、color
border-color:边框颜色
border-style:dotted(点状)、solid(实线)、double(双线)、dashed(虚线)inherit(继承)
border-width:边框宽度
四边边框,border-bottom、border-left、border-top、border-right
border-bottom:width、style、color
border-bottom-widht:宽度border-bottom-style:样式border-bottom-color:颜色
左右上,同上。
outline声明轮廓属性,绘制元素周围的一条线,位于边框边缘外围
outline:color、style、width
outline-color:颜色、
outline-style:solid、dotted、dashed(同border-style)
outline-width:宽度(thick)
border-radius:px、%;(定义边框四角的形状)
border-bottom-left-radius定义边框的左下角形状
border-bottom-right-radius定义边框的右下角的形状
border-top-left-radius:边框的左上角形状
border-top-right-radius:边框右上角形状
border-image:url(“图片路径”)slice(向内偏移) width(边框宽度) outset(图像超出边框的量) repeat
border-image-outset:边框图像区域超出边框的量
border-image-repeat:图像边框是否应平铺(repeated)、铺满(rounded)或拉伸(stretched)。
border-image-source:用在边框的图片路径
border-image-slice:图片边框向内偏移
border-image-width:图片边框的宽度
box-shadow:
font:声明字体的属性
font-family:字体系列如宋体、微软雅黑
font-size:字体尺寸
font-style:字体的样式,normal(默认,浏览器中标准的字体样式)、italic(‘斜体‘’字体样式,属于一种字体family)
oublique(倾斜的字体样式,是将文本中的字体倾斜)、inherit(继承父元素)
font-weight:字体的粗细,normal(默认)、bold(粗体)、bolder(更粗)、lighter(更细)
100~900(没有px)、inherit(继承)
font-stretch:收缩或拉伸当前的字体系列(所有浏览器都暂不支持)wider(伸展) narrower(收缩)
font-variant:规定是否以小型大写字母的字体显示文本。small-caps(显示小型大写)
- html5-css简介和属性:border、background、font
- [转]css属性font text color background box margin border
- CSS属性总结(一):background, border, outline
- css 属性总结(一):background, border, outline
- 常用border\background\font的缩写详解
- CSS中(font和background)的简写形式
- html5中cellpadding和cellspacing属性不被支持,用css border-collapse:collapse来代替
- 关于css里的@font-face 和font-family属性
- CSS padding margin border属性和布局
- HTML5基础加强css样式篇(css属性border圆角:border-radius)(三十五)
- [CSS]CSS background属性
- HTML5基础加强css样式篇(font-family,font-size, font-style,font-variant, font-weight , font 简写属性 )(五)
- jquery的css()对组合的属性无法获取(background,font,margin,padding)(ie6、7)
- css中的border属性
- CSS border 属性
- CSS border-collapse 属性
- CSS border-width 属性
- 重温CSS:Border属性
- 文字滚动形成
- POJ 3077-Rounders
- c语言学习---基本命令
- 初学Redis(4)——简单实现Redis缓存中的排序功能(转载)
- C#正则表达式校验,判断文件是否存在,复制保存
- html5-css简介和属性:border、background、font
- 框架-框架的侵入性-解释
- 强烈推荐!教你测试手机网页的五大方法
- ubuntu 15.04 系统中如何启用、禁用客人会话
- 数据结构实验之二叉树的建立与遍历
- 111
- App系列------如何把文件放到assets目录下
- [DP]Composite设计模式
- Docker学习