css常用小记

本文深入探讨网页设计中的字体、颜色、大小、字形、间距等关键元素,以及背景、边框等视觉效果,同时提供简洁的CSS代码示例,帮助开发者实现美观且响应式的页面布局。

字型

文字顏色

color: #000;

文字大小

font-size: 8pt;

文字字體

font-family: “arial”, dotum;

文字斜體

font-style: italic;

小字體

font-variant: small-caps;

字間距離

letter-spacing: 1pt;

行高

line-height: 15px; (亦可為百分比)

文字粗體

font-weight: bold;

加底線

text-decoration: underline;

加刪除線

text-decoration: line-through;

加頂線

text-decoration: overline;

刪除連線底線

text-decoration: none;

首字大寫

text-transform: capitalize;

英文大寫

text-transform: uppercase;

英文小寫

text-transform: lowercase;

文字靠左

text-align: left;

文字靠中

text-align: center;

文字靠右

text-align: right;

文字分散對齊

text-align: justify;



背景

背景顏色

background: #e9e9e9;

背景圖片不重複

background: url(圖片位址) no-repeat;

背景重複

background: url(圖片位址) repeat;

背景Y軸重複

background: url(圖片位址) repeat-y;

背景X軸重複

background: url(圖片位址) repeat-x;

背景浮水印固定

background: url(圖片位址) fixed;

背景置中

background-position: center;

背景靠左

background-position: left;

背景靠右

background-position: right;

背景靠上

background-position: top;

背景靠下

background-position: bottom;

簡易寫法

background: url(位址) no-repeat top center fixed #fff;

●備註:位址請記得不是複製上方的網址,而是在圖片上方按右鍵內容裡的那個網址!


框線

全框線

border: 1px solid #000;

上框線

border-top: 1px solid #000;

下框線

border-bottom: 1px solid #000;

右框線

border-right: 1px solid #000;

左框線

border-left: 1px solid #000;

框線種類

solid 直線

dotted 點線

dashed 虛線

double 雙線

groove 立體內凸

ridge 立體浮凸

inset 凹框

outset 凸框

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值