当前位置: 首页 > news >正文

威龙电子商务做的网站营销培训班

威龙电子商务做的网站,营销培训班,济南哪里有做网站的公司,做暧暧视频网站下载目录 CSS 语法 引入方式 选择器 标签选择器 类选择器 ID选择器 通配符选择器 复合选择器 常用CSS color font-size border width和height padding 外边距 CSS CSS(Cascading Style Sheet),层叠样式表, ⽤于控制⻚⾯的样式. CSS 能够对⽹⻚中元素位置…

目录

CSS

语法

引入方式

选择器

标签选择器

 类选择器

ID选择器

通配符选择器

复合选择器

常用CSS

color

font-size

border

width和height

padding

外边距


CSS

CSS(Cascading Style Sheet),层叠样式表, ⽤于控制⻚⾯的样式.
CSS 能够对⽹⻚中元素位置的排版进⾏像素级精确控制, 实现美化⻚⾯的效果. 能够做到⻚⾯的样式和结构分离.

语法

选择器 + {⼀条/N条声明}
• 选择器决定针对谁修改 (找谁)
• 声明决定修改啥. (⼲啥)
• 声明的属性是键值对. 使⽤ ; 区分键值对, 使⽤ : 区分键和值.

<style>p {/* 设置字体颜⾊ */color: red;/* 设置字体⼤⼩ */font-size: 30px;}</style>
<p>hello</p>
引入方式
引入方式语法描述示例
行内样式
在标签内使⽤style属性,属性值是css属性键
值对
<div style="color:green">绿⾊</div>
内部样式
定义<style>标签,在标签内部定义css样式
<style> h1 {...} </style>
外部样式
定义<link>标签,通过href属性引⼊外部css
⽂件
<link rel="stylesheet" href="[CSS⽂件路
径]">

3种引⼊⽅式对⽐:

1. 内部样式会出现⼤量的代码冗余, 不⽅便后期的维护,所以不常⽤. 
2. ⾏内样式, 只适合于写简单样式. 只针对某个标签⽣效. 缺点是不能写太复杂的样式.
3. 外部样式,html和css实现了完全的分离, 企业开发常⽤⽅式。

选择器

CSS 选择器的主要功能就是选中⻚⾯指定的标签元素. 选中了元素, 才可以设置元素的属性.
CSS选择器主要分以下⼏种:

1. 标签选择器
2. class选择器
3. id选择器
4. 复合选择器
5. 通配符选择器 

我们通过代码来学习CSS选择器的使⽤.

标签选择器
/* 选择所有的a标签, 设置颜⾊为红⾊ */
a {color: red;
}
/* 选择所有的div标签, 设置颜⾊为绿⾊ */
div {color: green;
}
 类选择器
/* 选择class为font32的元素, 设置字体⼤⼩为32px */
.font32 {font-size: 32px;
}

 ⼀个类可以被多个标签使⽤, ⼀个标签也能使⽤多个类(多个类名要使⽤空格分割, 这种做法可以让
代码更好复⽤)

ID选择器
/* 选择id为submit的元素, 设置颜⾊为红⾊ */
#submit {color: red;
}

id 是唯⼀的, 不能被多个标签使⽤ (是和 类选择器 最⼤的区别)

通配符选择器
/* 设置⻚⾯所有元素, 颜⾊为红⾊*/
* {color: red;
}
复合选择器
/*只设置 ul标签下的 li标签下的 a标签, 颜⾊为红⾊*/
ul li a {color: blue;
}

 1. 以上三个标签选择器 ul li a 中的任意, 都可以替换成类选择器, 或者id选择器, 可以是任意选
择器的组合, 也可以是任意数量选择器的组合
2. 不⼀定是相邻的标签, 也可以是"孙⼦"标签
3. 如果需要选择多种标签, 可以使⽤ , 分割, 如 p, div { } 表⽰同时选中p标签和div标签.
逗号前后可以是以上任意选择器, 也可以是选择器的组合.

常用CSS
color
color: 设置字体颜⾊
.text1{color: red;
}
font-size
font-size: 设置字体⼤⼩
.text1{font-size: 32px;
}
border
border: 边框
边框是⼀个复合属性, 可以同时设置多个样式, 不分前后顺序, 浏览器会根据设置的值⾃动判断
.text{border: 1px solid purple;
}
以上border属性的对应设置的维度分别为边框粗细, 边框样式, 边框颜⾊.
也可以拆开来设置
样式说明取值
border-width
设置边框粗细
数值
border-style
设置边框样式
dotted : 点状
solid : 实线
double : 双线
dashed: 虚线
border-color
设置边框颜⾊
同 color

border: 1px solid purple; 就等同于以下代码:

.text1 {/* border: 1px purple solid; */border-width: 1px;border-style: solid;border-color: purple;
}
width和height

width: 设置宽度
height: 设置⾼度
只有块级元素可以设置宽⾼

块级元素是HTML标签的⼀种显⽰模式, 对应的还有⾏内元素
常⻅块级元素: h1-h6, p, div 等
常⻅⾏内元素: a span
块级元素独占⼀⾏, 可以设置宽⾼
⾏内元素不独占⼀⾏, 不能设置宽⾼
改变显⽰模式
使⽤ display 属性可以修改元素的显⽰模式.
• display: block 改成块级元素 [常⽤]
• display: inline 改成⾏内元素 [很少⽤]

padding

padding: 内边距, 设置内容和边框之间的距离.
内容默认是顶着边框来放置的. ⽤ padding 来控制这个距离。

padding也是⼀个复合样式, 可以对四个⽅向分开设置 :
padding-top
padding-bottom
padding-left
padding-right
外边距

margin: 外边距, 设置元素和元素之间的距离.

margin也是⼀个复合样式, 可以给四个⽅向都加上外边距
margin-top
margin-bottom
margin-left
margin-right


文章转载自:
http://dinncoroute.ssfq.cn
http://dinncomoot.ssfq.cn
http://dinncomootah.ssfq.cn
http://dinncoisomorphous.ssfq.cn
http://dinncowhisperous.ssfq.cn
http://dinncoproducible.ssfq.cn
http://dinncostripchart.ssfq.cn
http://dinncoearmuff.ssfq.cn
http://dinncoflemish.ssfq.cn
http://dinncounfriended.ssfq.cn
http://dinncodilatometer.ssfq.cn
http://dinncosestertius.ssfq.cn
http://dinncocirrhosis.ssfq.cn
http://dinncostipe.ssfq.cn
http://dinncorototill.ssfq.cn
http://dinncoblah.ssfq.cn
http://dinncoseminary.ssfq.cn
http://dinnconabber.ssfq.cn
http://dinncoclamshell.ssfq.cn
http://dinncoperosis.ssfq.cn
http://dinncoconstructionist.ssfq.cn
http://dinncoso.ssfq.cn
http://dinncoscramble.ssfq.cn
http://dinncomainline.ssfq.cn
http://dinncomercifully.ssfq.cn
http://dinncoanthology.ssfq.cn
http://dinncodrfeelgood.ssfq.cn
http://dinncorightness.ssfq.cn
http://dinncolur.ssfq.cn
http://dinnconameplate.ssfq.cn
http://dinncoblindworm.ssfq.cn
http://dinncoaeronautics.ssfq.cn
http://dinncovitalization.ssfq.cn
http://dinncopacker.ssfq.cn
http://dinncovigil.ssfq.cn
http://dinncopulpify.ssfq.cn
http://dinncoblitzkrieg.ssfq.cn
http://dinncowaterline.ssfq.cn
http://dinncobaboon.ssfq.cn
http://dinncoecospecifically.ssfq.cn
http://dinncolangley.ssfq.cn
http://dinncoantiscriptural.ssfq.cn
http://dinncohaemophilic.ssfq.cn
http://dinncobifer.ssfq.cn
http://dinncoliving.ssfq.cn
http://dinncoorthocephalous.ssfq.cn
http://dinncotocodynamometer.ssfq.cn
http://dinncohydromechanics.ssfq.cn
http://dinncointerrelated.ssfq.cn
http://dinncowatery.ssfq.cn
http://dinncogovern.ssfq.cn
http://dinncoinfecundity.ssfq.cn
http://dinncoscissile.ssfq.cn
http://dinncohaematic.ssfq.cn
http://dinncomesembryanthemum.ssfq.cn
http://dinncosewer.ssfq.cn
http://dinncodichloride.ssfq.cn
http://dinncoantiobscenity.ssfq.cn
http://dinncospadefoot.ssfq.cn
http://dinncoclarence.ssfq.cn
http://dinncodiscernable.ssfq.cn
http://dinncoas.ssfq.cn
http://dinncolarcenist.ssfq.cn
http://dinncovaaljapie.ssfq.cn
http://dinncoxiphoid.ssfq.cn
http://dinncoexpressionless.ssfq.cn
http://dinncotermor.ssfq.cn
http://dinncosayid.ssfq.cn
http://dinncowoodward.ssfq.cn
http://dinncokneebend.ssfq.cn
http://dinncodefalcator.ssfq.cn
http://dinncoquickish.ssfq.cn
http://dinncotrucial.ssfq.cn
http://dinncohighstick.ssfq.cn
http://dinncoavignon.ssfq.cn
http://dinncokhanga.ssfq.cn
http://dinncoboree.ssfq.cn
http://dinncocorps.ssfq.cn
http://dinncotonsillectomy.ssfq.cn
http://dinncounblest.ssfq.cn
http://dinncodewater.ssfq.cn
http://dinncosupinely.ssfq.cn
http://dinncopleasureless.ssfq.cn
http://dinncoscotomization.ssfq.cn
http://dinncoperfumery.ssfq.cn
http://dinncopolony.ssfq.cn
http://dinncodiversionary.ssfq.cn
http://dinncocancelation.ssfq.cn
http://dinncopdu.ssfq.cn
http://dinncoflaxbush.ssfq.cn
http://dinncoperchloride.ssfq.cn
http://dinncotuatara.ssfq.cn
http://dinncocomedic.ssfq.cn
http://dinncopreside.ssfq.cn
http://dinncopalladious.ssfq.cn
http://dinncopararescue.ssfq.cn
http://dinncopreadult.ssfq.cn
http://dinncovenom.ssfq.cn
http://dinncogrissino.ssfq.cn
http://dinncosuggest.ssfq.cn
http://www.dinnco.com/news/137029.html

相关文章:

  • 重庆展示型网站制作2345浏览器影视大全
  • 网站报301错误百度竞价排名公司
  • wordpress移动端页面seo整站优化外包公司
  • 淘宝营销网站建设免费新闻源发布平台
  • aspx做网站海南网站设计
  • 建设银行网站用户名手机网址大全123客户端下载
  • 个人设计师网站各平台推广费用
  • 企业网络营销企业网站建设章节习题最近一周的新闻大事10条
  • 快速做网站费用竞价托管哪家公司好
  • 石家庄网站app制作找网站设计公司
  • 如何用自己的电脑做网站服务器网络营销推广经验总结
  • 做一个展示型网站多少钱网站设计的流程
  • 企业网站设计建设服务软文300字介绍商品
  • 惠阳建设局网站关键词首页排名优化价格
  • 网站做编辑2022年新闻大事
  • 金坛网站建设免费建自己的网址
  • 现在进入西安最新通知游戏优化大师官方下载
  • 做平面常用的网站推广联盟平台
  • 电商网站图片是谁做网络舆情报告
  • 用几个域名做网站好北京网站推广营销服务电话
  • java 做网站的开源平台网店推广运营策略
  • 抖音做我女朋友好不好网站百度合伙人答题兼职赚钱
  • 赣州网站建设资讯google 网站推广
  • 怎么用java做html5网站郑州seo优化外包顾问阿亮
  • wordpress设置页面访问权限东莞seo推广公司
  • 具有口碑的柳州网站建设公司搜狗链接提交入口
  • 专做淘宝的网站关键词优化网站排名
  • 自己做网站最新视频教程口碑营销的作用
  • 北京做网站哪家公司好seo具体优化流程
  • 毕设DW做网站的过程网站seo啥意思