024.1-css基础

css

2021年4月26日

23:47

  • 告诉浏览器布局

  • 颜色

@[toc]


构成

P{ColorRed}
select/

Property=colorValue=red

——-

添加方法

外部样式表v

  • css保存在.css文件

  • html中<link/>引用

Style.css

1
    <link  href="./css/style.css">

内部样式表v

  • 不使用外部文件

  • 放在html的<style>文件

H1{

color: red;

}


内联样式x

  • 一个元素的css

  • 元素的<style>

<h1 style=>


.box

<div class >

<pClass=“paragraph”Id=“paral”Lorem

Selector=pSelector=paragrahpSelect=paral
class有很多html确保独一无二

https://developer.mozilla.org/cn-Zh/docs/learn/CSS 选择器、color_value


参数

  • Background-color:

  • color

  • width

  • margin: auto

  • 颜色


颜色

Hsl(色相,饱和度,亮度)
0~360°0~100%0~100%
不同颜色灰~全色黑~白

-——

字体

Font-family:字体名参数
指定字体有空格要加引号serif(衬线)
size大小 weight粗细 Font: nomal 16px ziti,canshu也可以
img
monospace(等宽)

Styling_text

Cssfontstack.com

Fonts.google.com

Thetype.com

-——–

代表整个页面

Body {

未指定用body

}

-——

盒子模型

img

ContentHeightWidthPaddingBorderMargin
图片、文字占地内边距:内容和边框的距离边框:p&h没有边框,但可指定外边距:与外面元素的距离

盒子间只有一个最大边距

盒子的边距

p{上右下佐顺时针

Margin-top:

Margin-r

Bottom

L

}

上,右,下,左

上下,左右

上,左右,下

Solid 线

dotted点线

Double

……

吴宇信要好好学习HTML https://blog.csdn.net/wuyxinu/article/details/103515157

CSS https://blog.csdn.net/wuyxinu/article/details/103583618

JS https://blog.csdn.net/wuyxinu/article/details/103642800

JS-下 https://blog.csdn.net/wuyxinu/article/details/103646041

还有jQuery的 https://blog.csdn.net/wuyxinu/article/details/103669718

Node.js + Gulp 知识点汇总 https://blog.csdn.net/wuyxinu/article/details/103774211

来自 https://www.bilibili.com/video/BV1bW411R7hg

CTRL-/