search
HomeWeb Front-endCSS TutorialA complete collection of web design css style codes, come and collect it!

Reduce a lot of unnecessary code, html css can easily layout the web page. Friends, keep it in your collection~

A complete collection of web design css style codes, come and collect it!

# 1. Text settings

1,

font-size: font size parameter

2,

font-style: font format

3,

font-weight: font thickness

4, color attribute


color: parameter

Pay attention to using web security colors

2. Hyperlink settings

text-decoration: 参数

The main purpose is Change the underline when the browser displays text links.

Parameter value range:

  • underline: underline the text

  • overline: underline the text

  • line-through: strikethrough the text

  • blink: use Text flashing

  • none: Do not display any of the above effects

3. Background

1. Background color


background-color: 参数

2. Background image

background-image: url(URL)

  • URL is the background The storage path of the image, none means none.

3. Background image repetition

background-repeat: 参数

Parameter value range:

  • no-repeat: Do not repeat the tiled background Picture

  • repeat-x: Make the picture tile only in the horizontal direction

  • repeat-y: Make the picture tile only in the vertical direction Paving

If you do not specify the background image repeat attribute, the browser defaults to the background image being tiled in both horizontal and vertical directions.

4. Background image fixed

Background image fixed controls whether the background image scrolls with the scrolling of the web page. If you do not set the background image fixed attribute, the browser's default background image will scroll with the scrolling of the web page. In order to avoid overly fancy background images from diverting the viewer's attention when scrolling, they are generally set to fixed

background-attachment: 参数

Parameter value range:

  • fixed: Web page scrolling When the web page is scrolled, the background image remains fixed relative to the browser window

  • scroll: When the web page is scrolled, the background image scrolls together relative to the browser window

##4. Block
1. Word spacing

word-spacing: 间隔距离

2. Letter spacing

letter-spacing: 字母间距
3. Text alignment

text-align: 参数

Parameter value:

    left: left alignment
  • right:right alignment
  • center:center alignment
  • justify:relative left and right alignment
  • 4. Vertical alignment

    vertical-align: Parameters
  • top:Top alignment
  • bottom: bottom alignment
  • text-top: relative text top alignment
  • text-bottom: relative text bottom alignment
  • baseline: Baseline alignment
  • middle: Center alignment
  • sub: Display in the form of subscript
  • super: Display in the form of superscript
  • 5. Text indentation
text-indent: 缩进距离

12px is equivalent to a text distance of

6. Space

white-space: 参数

    normal normal
  • pre reserved
  • nowrap no line break
  • 7. Display style

display: 参数
Parameter value range:

    block: block-level element, both before and after the object Line break
  • inline: No line breaks before and after the object
  • list-item: Line breaks before and after the object, increase Bullets
  • none: No display
##5. Box

  • height 高度

  • width 宽度

  • padding 内边距

  • margin 外边距

  • float(浮动):可以让块级元素在一行中排列,例如横向菜单。 

  • clear 清除浮动

六、边框   

1、样式

border-style 参数

边框样式的参数:

  • none:无边框 

  • dotted:边框为点线

  • dashed:边框为长短线

  • solid:边框为实线

  • double:边框为双线

2、宽度

border-width:参数

3、颜色

border-color:参数

七、列表   

list-style-type:列表样式

不同浏览器的列表符可能不相同,可能会影响到网页,所以网页中的列表大多都是由背景图片显示。

控制用户界面的样式

八、鼠标

cursor:鼠标形状参数

CSS鼠标形状参数表: 

鼠标形状:CSS代码

style="cursor:hand"      手形
style="cursor:crosshair"   十字形
style="cursor:text"      文本形
style="cursor:wait"      沙漏形
style="cursor:move"     十字箭头形:
style="cursor:help"      问号形
style="cursor:e-resize"    右箭头形
style="cursor:n-resize"    上箭头形
style="cursor:nw-resize"   左上箭头形
style="cursor:w-resize"    左箭头形
style="cursor:s-resize"    下箭头形 
style="cursor:se-resize"   右下箭头形 
style="cursor:sw-resize"   左下箭头形

总结:

用常用HTML+CSS的代码做一个漂亮简单的个人网页,小伙伴来试试。

推荐学习:CSS视频教程

The above is the detailed content of A complete collection of web design css style codes, come and collect it!. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:CSDN. If there is any infringement, please contact admin@php.cn delete
利用CSS怎么创建渐变色边框?5种方法分享利用CSS怎么创建渐变色边框?5种方法分享Oct 13, 2021 am 10:19 AM

利用CSS怎么创建渐变色边框?下面本篇文章给大家分享CSS实现渐变色边框的5种方法,希望对大家有所帮助!

css ul标签怎么去掉圆点css ul标签怎么去掉圆点Apr 25, 2022 pm 05:55 PM

在css中,可用list-style-type属性来去掉ul的圆点标记,语法为“ul{list-style-type:none}”;list-style-type属性可设置列表项标记的类型,当值为“none”可不定义标记,也可去除已有标记。

css与xml的区别是什么css与xml的区别是什么Apr 24, 2022 am 11:21 AM

区别是:css是层叠样式表单,是将样式信息与网页内容分离的一种标记语言,主要用来设计网页的样式,还可以对网页各元素进行格式化;xml是可扩展标记语言,是一种数据存储语言,用于使用简单的标记描述数据,将文档分成许多部件并对这些部件加以标识。

css3怎么实现鼠标隐藏效果css3怎么实现鼠标隐藏效果Apr 27, 2022 pm 05:20 PM

在css中,可以利用cursor属性实现鼠标隐藏效果,该属性用于定义鼠标指针放在一个元素边界范围内时所用的光标形状,当属性值设置为none时,就可以实现鼠标隐藏效果,语法为“元素{cursor:none}”。

css怎么实现英文小写转为大写css怎么实现英文小写转为大写Apr 25, 2022 pm 06:35 PM

转换方法:1、给英文元素添加“text-transform: uppercase;”样式,可将所有的英文字母都变成大写;2、给英文元素添加“text-transform:capitalize;”样式,可将英文文本中每个单词的首字母变为大写。

rtl在css是什么意思rtl在css是什么意思Apr 24, 2022 am 11:07 AM

在css中,rtl是“right-to-left”的缩写,是从右往左的意思,指的是内联内容从右往左依次排布,是direction属性的一个属性值;该属性规定了文本的方向和书写方向,语法为“元素{direction:rtl}”。

css怎么设置i不是斜体css怎么设置i不是斜体Apr 20, 2022 am 10:36 AM

在css中,可以利用“font-style”属性设置i元素不是斜体样式,该属性用于指定文本的字体样式,当属性值设置为“normal”时,会显示元素的标准字体样式,语法为“i元素{font-style:normal}”。

怎么设置rotate在css3的旋转中心点怎么设置rotate在css3的旋转中心点Apr 24, 2022 am 10:50 AM

在css3中,可以用“transform-origin”属性设置rotate的旋转中心点,该属性可更改转换元素的位置,第一个参数设置x轴的旋转位置,第二个参数设置y轴旋转位置,语法为“transform-origin:x轴位置 y轴位置”。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!