TextView中文字滚动效果
一、说明
1、实现滚动显示效果,TextView需满足的条件
(1)文本显示框的内容超过文本显示框的宽度。
(2)文本显示框设置成单行显示,即android:singleLine=”true”。默认情况下超出部分会自动换行显示。
(3)设置文本滚动显示,即android:ellipsize=”marquee”。单行情况下,超出显示框宽度部分默认不显示。
EidtText和textview中内容过长的话自动换行,使用android:ellipsize与android:singleLine 可以解决,使只有一行。EditText不支持marquee。用法如下:
①在xml中
●android:ellipsize = "none" 默认值,什么都不加
●android:ellipsize = "end"省略号在结尾
●android:ellipsize = "start" 省略号在开头
●android:ellipsize = "middle" 省略号在中间
●android:ellipsize = "marquee" 跑马灯
●android:singleLine = "true"
②在activity文件中
●t.setEllipsize(TextUtils.TruncateAt.valueOf("END"));
●t.setEllipsize(TextUtils.TruncateAt.valueOf("START"));
●t.setEllipsize(TextUtils.TruncateAt.valueOf("MIDDLE"));
●t.setEllipsize(TextUtils.TruncateAt.valueOf("MARQUEE"));
●t.setSingleLine(true);
实例:通过方法实现文本跑马灯效果。
activity_main.xml
xmlns:tools="https://www.doczj.com/doc/5312768964.html,/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> android:id="@+id/tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:focusableInTouchMode="true" android:focusable="true" android:text="123456789123456789123456789123456789123456789" android:textSize="50dp"/>
MainActivity.java
package com.example.test;
import android.os.Bundle;
import android.app.Activity;
import android.text.TextUtils;
import android.view.Menu;
import android.widget.TextView;
public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(https://www.doczj.com/doc/5312768964.html,yout.activity_main);
TextView t=(TextView)findViewById(https://www.doczj.com/doc/5312768964.html,);
t.setEllipsize(TextUtils.TruncateAt.valueOf("MARQUEE"));
t.setSingleLine(true);
}
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
(4)TextView需获得焦点
设置android:focusableInTouchMode=”true”,android:focusable=”true”。当文本失去焦点时,文本将不再滚动。
实例:文本失去焦点时,文本将不再滚动。
xmlns:tools="https://www.doczj.com/doc/5312768964.html,/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:focusableInTouchMode="true" android:focusable="true" android:text="aaaaaaaaaaaaaasssssssssssssssssswwwwwwwwwwwwwwrrrrrrrrrrttttt" android:textSize="20dp"/> android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" //与父控件底端对齐 android:layout_centerHorizontal="true" //水平居中 android:layout_marginBottom="166dp" //距离父控件底端166dp android:text="text">
二、案例
xmlns:tools="https://www.doczj.com/doc/5312768964.html,/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:focusableInTouchMode="true" android:focusable="true" android:text="123456789123456789123456789123456789123456789" android:textSize="50dp"/>
HTML CSS标签属性大全 a卷标, 属性名称, 简介 批注 1、跑马灯 普通卷动 滑动 预设卷动 来回卷动 向下卷动 向上卷动 向右卷动 向左卷动 卷动次数 设定宽度 设定高度 设定背景颜色 设定卷动距离 设定卷动时间 2、字体效果
字体属性:(font) 大小{font-size: x-large;}(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX、PD 样式{font-style: oblique;}(偏斜体) italic;(斜体) normal;(正常) 行高{line-height: normal;}(正常) 单位:PX、PD、EM 粗细{font-weight: bold;}(粗体) lighter;(细体) normal;(正常) 变体{font-variant: small-caps;}(小型大写字母) normal;(正常) 大小写{text-transform: capitalize;}(首字母大写) uppercase;(大写) lowercase;(小写) none;(无) 修饰{text-decoration: underline;}(下划线) overline;(上划线) line-through;(删除线) blink;(闪烁) 常用字体:(font-family) "Courier New", Courier, monospace, "Times New Roman", Times, serif, Arial, Helvetica, sans-serif, Verdana 背景属性:(background) 色彩{background-color: #FFFFFF;} 图片{background-image: url();} 重复{background-repeat: no-repeat;} 滚动{background-attachment: fixed;}(固定) scroll;(滚动) 位置{background-position: left;}(水平) top(垂直); 简写方法{background:#000 url(..) repeat fixed left top;} /*简写·这个在阅读代码中经常出现,要认真的研究*/ 区块属性:(Block) /*这个属性第一次认识,要多多研究*/ 字间距{letter-spacing: normal;} 数值/*这个属性似乎有用,多实践下*/ 对齐{text-align: justify;}(两端对齐) left;(左对齐) right;(右对齐) center;(居中) 缩进{text-indent: 数值px;} 垂直对齐{vertical-align: baseline;}(基线) sub;(下标) super;(下标) top; text-top; middle; bottom; text-bottom; 词间距word-spacing: normal; 数值 空格white-space: pre;(保留) nowrap;(不换行)
CSS学习知识点 1、css是什么? CSS(Cascading Style Sheet)可译为“层叠样式表”或“级联样式表”,它定义如何显示 HTML元素,用于控制网页的外观。 2、为什么使用css,优点是什么? 1:【内容】和【表现】相分离 HTML文件中只存放文本信息,将样式部分放在一个独立样式文件中。页面对搜索引擎更加友好。 2:提高页面浏览速度 采用CSS布局的页面容量要比TABLE布局的页面文件容量小得多,前者一般只有后者的1/2大小。 3:易于维护和改版 只要简单的修改对应CSS文件,就可以重新设计整个网站的页面。 4: 使用CSS布局更符合现在的W3C标准 W3C组织是对网络标准制定的一个非赢利组织,像HTML、CSS、XML的标准就是由它来定制。 3、CSS样式表的调用方式哪几种? 1、内部样式:把CSS样式表放到
文档中: 格式如下: 2、内联式:把CSS样式表写在HTML对应的标记内。 格式如下:蓝色14号文字 3、外部样式:把编辑好的CSS文档保存成“.CSS”文件,然后在
中定义。 格式如下: ..... 4、导入样式:与链入外部样式的功能基本相同,只是语法和实现方式上有差别。 格式如下: 4、几种调用方式的优先级? 从高到低:内联样式--------外部样式---------内部样式-----------导入样式 5、CSS的语法: CSS的定义是由三部分构成: 选择器,属性和属性值。 语法: selector {property: value;} --------------------- 选择符{属性:值}CSS3 动画属性(Animation) @keyframes //规定动画。 animation //所有动画属性的简写属性,除了animation-play-state 属性。animation-name //规定@keyframes 动画的名称。 animation-duration //规定动画完成一个周期所花费的秒或毫秒。 animation-timing-function //规定动画的速度曲线。 animation-delay //规定动画何时开始。 animation-iteration-count //规定动画被播放的次数。 animation-direction //规定动画是否在下一周期逆向地播放。 animation-play-state //规定动画是否正在运行或暂停。 animation-fill-mode //规定对象动画时间之外的状态。 CSS 背景属性(Background) background //在一个声明中设置所有的背景属性。 background-attachment //设置背景图像是否固定或者随着页面的其余部分滚动。background-color //设置元素的背景颜色。 background-image //设置元素的背景图像。 background-position //设置背景图像的开始位置。 background-repeat //设置是否及如何重复背景图像。 background-clip //规定背景的绘制区域。 background-origin //规定背景图片的定位区域。 background-size //规定背景图片的尺寸。 CSS 边框属性(Border 和Outline) border //在一个声明中设置所有的边框属性。 border-bottom //在一个声明中设置所有的下边框属性。 border-bottom-color //设置下边框的颜色。 border-bottom-style //设置下边框的样式。 border-bottom-width //设置下边框的宽度。
CSS属性大全完整版 字体属性:(font) 大小 font-size: x-large; (特大) xx-small; (极小) 一般中文用不到,只要用数值就可以,单位:PX、PD 样式 font-style: oblique; (偏斜体) italic; (斜体) normal; (正常) 行高 line-height: normal; (正常) 单位:PX、PD、EM 粗细 font-weight: bold; (粗体) lighter; (细体) normal; (正常) 变体 font-variant: small-caps; (小型大写字母) normal; (正常) 大小写 text-transform: capitalize; (首字母大写) uppercase; (大写) lowercase; (小写) none; (无) 修饰 text-decoration: underline; (下划线) overline; (上划线) line-through; (删除线) blink; (闪烁) 常用字体
font-family: "Courier New", Courier, monospace, "Times New Roman", Times, serif, Arial, Helvetica, sans-serif, Verdana 背景属性:(background) 色彩 background-color: #FFFFFF; 图片 background-image: url(); 重复 background-repeat: no-repeat; 滚动 background-attachment: fixed; (固定) scroll; (滚动) 位置 background-position: Left (水平) top (垂直); 简写方法background:#000 url(..) repeat fixed left top; 区块属性:(Block) 字间距 letter-spacing: normal; 数值 对齐 text-align: justify; (两端对齐) left; (左对齐) right; (右对齐) center; (居中) 缩进
CSS常用属性大全 2011-04-22 12:51 字体属性:(font) 大小 font-size: x-large;(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX、PD 样式 font-style: oblique;(偏斜体) italic;(斜体) normal;(正常)行高 line-height: normal;(正常) 单位:PX、PD、EM 粗细 font-weight: bold;(粗体) lighter;(细体) normal;(正常) 变体 font-variant: small-caps;(小型大写字母) normal;(正常) 大小写 text-transform: capitalize;(首字母大写) uppercase;(大写) lowercase;(小写) none;(无) 修饰 text-decoration: underline;(下划线) overline;(上划线) line-through;(删除线) blink;(闪烁) 字体投影效果:filter:dropshadow(color=#FFFFFF, offx=1, offy=1, positive=1); 背景属性: (background) 色彩background-color: #FFFFFF; 图片background-image: url(); 重复background-repeat: repeat; no-repeat; repeat-x; repeat-y;滚动background-attachment: fixed;(固定) scroll;(滚动) 位置background-position: left(水平) top(垂直);bottom; right; center; 简写方法 background:#000 url(..) repeat fixed left top; 区块属性: (Block) 字间距letter-spacing: normal; 数值 对齐text-align: justify;(两端对齐) left;(左对齐) right;(右对齐) center;(居中) 缩进text-indent: 数值px; 垂直对齐vertical-align: baseline;(基线) sub;(下标) super;(下标) top; text-top; middle; bottom; text-bottom; 单词间距word-spacing: normal; 数值 空格white-space: pre;(保留) nowrap;(不换行)
字体属性:(font) 大小font-size: x-large;(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX、PD 样式font-style: oblique;(偏斜体) italic;(斜体) normal;(正常) 行高line-height: normal;(正常) 单位:PX、PD、EM 粗细font-weight: bold;(粗体) lighter;(细体) normal;(正常) 变体font-variant: small-caps;(小型大写字母) normal;(正常) 大小写text-transform: capitalize;(首字母大写) uppercase;(大写) lowercase;(小写) none;(无) 修饰text-decoration: underline;(下划线) overline;(上划线) line-through;(删除线) blink;(闪烁) 常用字体:(font-family) "Courier New", Courier, monospace, "Times New Roman", Times, serif, Arial, Helvetica, sans-serif, Verdana 背景属性:(background) 色彩background-color: #FFFFFF; 图片background-image: url(); 重复background-repeat: no-repeat; 滚动background-attachment: fixed;(固定) scroll;(滚动) 位置background-position: left(水平) top(垂直); 简写方法background:#000 url(..) repeat fixed left top; 区块属性:(Block) 字间距letter-spacing: normal; 数值 对刘text-align: justify;(两端对齐) left;(左对齐) right;(右对齐) center;(居中) 缩进text-indent: 数值px; 垂直对齐vertical-align: baseline;(基线) sub;(下标) super;(下标) top; text-top; middle; bottom; text-bottom; 词间距word-spacing: normal; 数值 空格white-space: pre;(保留) nowrap;(不换行) 显示display:block;(块) inline;(内嵌) list-item;(列表项) run-in;(追加部分) compact;(紧凑) marker;(标记) table; inline-table; table-raw-group; table-header-group; table-footer-group; table-raw; table-column-group; table-column; table-cell; table-caption;(表格标题) 方框属性:(Box) width:; height:; float:; clear:both; margin:; padding:; 顺序:上右下左 边框属性:(Border) border-style: dotted;(点线) dashed;(虚线) solid; double;(双线) groove;(槽线) ridge;(脊状) inset;(凹陷) outset; border-width:; 边框宽度 border-color:#; 简写方法border:width style color; 列表属性:(List-style) 类型list-style-type: disc;(圆点) circle;(圆圈) square;(方块) decimal;(数字) lower-roman;(小罗码数字) upper-roman; lower-alpha; upper-alpha;
css 常 用属性 CSS 文字属性: color : #999999; /* 文字颜色 */ font-family : 宋体,sans-serif; /* 文字字体 */ fon t-varia nt:small-ca ps; /* letter-s pacing : 1pt; /* text-alig n:left; /* 文字左对齐*/ text-alig n:cen ter; /* 文字居中对齐*/ text-alig n:justify; /* 文字分散对齐*/ vertical-alig n 属性 fon t-size : 9pt; /* 文字大小*/ fon t-style:itelic; /* 文字斜体*/ lin e-height : 200%; /* 设置行高*/ fon t-weight:bold; /* 文字粗体*/ vertical-alig n: sub; /* 下标字*/ vertical-alig n:super; /* 上标字*/ text-decorati on :li ne-through; /* 加删除线*/ text-decorati on: overli ne; /* 加顶线*/ text-decorati on:un derl ine; /* 加下划线*/ text-decorati on:none; /* 删除链接下划线*/ text-tra nsform : cap italize; /* 首字大写*/ text-tra nsform : upp ercase; /* 英文大写*/ text-tra nsform : lowercase; /* 英文小写*/ text-alig n:r ight; /* 文字右对齐 */ 小字体*/ 字间距离*/
Css+div 常用CSS标签及属性 2009年10月15日评论(0)|浏览(64) 点击查看原文 CSS中的长度 绝对单位:几乎不用在网页中 in 英寸1in = 2.54cm cm 厘米1cm = 0.394in pt 磅1in = 72pt pc pica 1in = 6pc 相对单位:较常用 em 1em = 相应字体的font-size值 ex 1ex = 相应字体中的小写x字母的高度值,较难求得,一般取0.5em px 最为常用的 CSS中的元素分类 display 设定元素所属类别,不可继承 none(设定为不显示在屏幕上)
block(块级元,包括P,H1-H6,list,div,body) inline(内联元,包括a,em,span) list-item(列表元,如LI) 颜色与背景类 color 设置文字颜色 #rgb #rrggbb rgb(255,255,255) rgb(100%,100%,100%) H1{color:red} H1{color:#f00} H1{color:#ff0000} H1{color:rgb(255,0,0)} H1{color:rgb(100%,0%,0%)} background-color 设置背景颜色,格式同上;不可继承,可用于所有元BODY{background-color:red} BODY{background-color:#f00} BODY{background-color:#ff0000}
BODY{background-color:rgb(255,0,0)} BODY{background-color:rgb(100%,0%,0%)} background-image 设置背景图片,默认为none,不可继承,可用于所有元url(imageURL) none body{backround-image:url(back.jpg);} background-repeat 设置背景图片是否重复排列,不可继承,用于所有元repeat(XY轴均重复) repeat-x(X轴重复排列) repeat-y(Y轴重复排列) No-repeat(不重复排列,默认值) BODY{background-repeat:repeat-x;} BODY{background-repeat:No-repeat;} background-attachment 设定背景图片是否卷动,不可继承,用于所有元scroll(随网页卷动,默认值) fixed(不随网页卷动) BODY{background-attachment:fixed;} background-position 设定背景图片或背景颜色开始显示的位置,不可继承,用于块级元和可替换元 top,buttom,left,right,center(用关键字)
CSS的class、id、css文件名的常用命名 常用的CSS命名规则 头:header 内容:content/container 尾:footer 导航:nav 侧栏:sidebar 栏目:column 页面外围控制整体布局宽度:wrapper 左右中:left right center 登录条:loginbar 标志:logo 广告:banner 页面主体:main 热点:hot 新闻:news 下载:download 子导航:subnav 菜单:menu 子菜单:submenu 搜索:search 友情链接:friendlink 页脚:footer 版权:copyright 滚动:scroll 内容:content 标签页:tab 文章列表:list 提示信息:msg 小技巧:tips 栏目标题:title 加入:joinus 指南:guild 服务:service 注册:regsiter 状态:status 投票:vote 合作伙伴:partner (二)注释的写法: /* Footer */ 内容区 /* End Footer */ (三)id的命名: (1)页面结构 容器: container 页头:header 内容:content/container 页面主体:main 页尾:footer 导航:nav 侧栏:sidebar 栏目:column 页面外围控制整体布局宽度: wrapper 左右中:left right center (2)导航 导航:nav 主导航:mainbav 子导航:subnav 顶导航:topnav 边导航:sidebar 左导航:leftsidebar 右导航:rightsidebar 菜单:menu 子菜单:submenu 标题: title 摘要: summary (3)功能 标志:logo 广告:banner 登陆:login 登录条:loginbar 注册:regsiter 搜索:search 功能区:shop 标题:title 加入:joinus 状态:status 按钮:btn 滚动:scroll 标签页:tab 文章列表:list
字体属性 text-decoration 文本修饰 font-family 字体名称 font-size 字体大小 color 字体颜色 font-style 字体风格 line-height 行高 font-weight 文本字体的粗细 text-transform单词大小写转换 font-variant 是否为小型的大写字母 背景属性 background-color 背景颜色 background-image 背景图片 background-position 背景图片定位 background-repeat 重复方式 background-attachment是否随背景滚动 区块属性 text-indent text-align 文字对齐方式 display 显示方式 边框属性 ( border) border-bottom 下边框 border-bottom-color 下边框颜色 border-bottom-style 下边框风格 border-bottom-width 下边框宽度 border-collapse设定表格的行和列的边框是合并成单边框,还是分别有各自的边框。 border-color border-left border-left-color border-left-style border-left-width border-right border-right-color border-right-style border-right-width border-style border-top border-top-color
border-top-style border-top-width border-width 方框属性 clear 清除对象 float 浮动 margin 对象外边距 margin-bottom margin-left margin-right margin-top padding 边框与文字的间距 padding-bottom padding-left padding-right padding-top 分类属性 list-style-image 列表图片 list-style-position 列表位置 list-style-type 列表类型 定位属性 position visibility width height left top right bottom z-index clip overflow
常见CSS 属性一览表 属性名称属性功能及其取值用法说明与范例颜色与背景类 color 设置文字颜色 #rgb #rrggbb rgb(255,255,255) rgb(100%,100%,100%) H1{color:red} H1{color:#f00} H1{color:#ff0000} H1{color:rgb(255,0,0)} H1{color:rgb(100%,0%,0%)} background-color 设置背景颜色,格式同上。 BODY{background-color:red} BODY{background-color:#f00} BODY{background-color:#ff0000} BODY{background-color:rgb(255,0,0)} BODY{background-color:rgb(100%,0%,0%)} background-image 设置背景图片, url(imageURL) body{backround-image:url;} background-repeat 设置背景图片是否重复排列: repeat-x(X轴重复排列); repeat-y(Y轴重复排列); No-repeat(不重复排列) BODY{background-repeat:repeat-x;} BODY{background-repeat:No-repeat;} background-attachment 设定背景图片是否卷动,默认为卷动。 scroll(卷动) fixed(不卷动) BODY{background-attachment:fixed;} background-position 设定背景图片或背景颜色开始显示的位置,取值 格式: top,buttom,left,right,center(用关键字) 70px 10px(用长度值) 50% 30%(用百分比) BODY{background-position:right top;} BODY{background-position:50px 10px;} BODY{background-position:20% 50%;} background 定义背景综合属性,不要求顺序,各属性值以空 格分开。 BODY{background:#ffcc00 url fixed center} 字型类 font-family 设置字型属性,取值可以是任何字型名称,缺省 为浏览器内定字型,可以设多个以逗号(,)分开, 有空格的英文字型可用单引号或双引号括起来。 P{font-family:宋体,楷体,黑体,"Time New Rom";} font-style 设定字型样式:Normal(正常),italic、objlique(斜 体) P{font-style:italic;} font-variant 取值:Normal(默认),small-caps(如果是中文字型 则将字型缩小显示,如果是英文则全部改为较小 的大写) H3{font-variant:small-caps;} font-weight 设定字体粗细,取值有: Normal(默认),bold,lighter,border,100,200 (900) 由于浏览器支持程度不同,一般只用normal和 bold两种属性。 P{font-weight:bold;} font-size 设定字体的大小; 绝对大小:xx-small,x-small,small,mediumlarge,x- large,xx-large; H2{font-size:36pt;} P{font-size:200%;}
CSS符号属性: list-style-type:none; /*不编号*/ list-style-type:decimal; /*阿拉伯数字*/ list-style-type:lower-roman; /*小写罗马数字*/ list-style-type:upper-roman; /*大写罗马数字*/ list-style-type:lower-alpha; /*小写英文字母*/ list-style-type:upper-alpha; /*大写英文字母*/ list-style-type:disc; /*实心圆形符号*/ list-style-type:circle; /*空心圆形符号*/ list-style-type:square; /*实心方形符号*/ list-style-image:url(/dot.gif); /*图片式符号*/ list-style-position:outside; /*凸排*/ list-style-position:inside; /*缩进*/ CSS 背景样式:background-color:#F5E2EC; /*背景颜色*/ background:transparent; /*透视背景*/ background-image : url(/image/bg.gif); /*背景图片*/ background-attachment : fixed;/*浮水印固定背景*/ background-repeat : repeat; /*重复排列-网页默认*/ background-repeat : no-repeat; /*不重复排列*/ background-repeat : repeat-x; /*在x轴重复排列*/ background-repeat : repeat-y; /*在y轴重复排列*/ 指定背景位置background-position : 90% 90%; /*背景图片x与y轴的位置*/ background-position : top; /*向上对齐*/ background-position : buttom; /*向下对齐*/ background-position : left; /*向左对齐*/ background-position : right; /*向右对齐*/ background-position : center; /*居中对齐*/ CSS连接属性:a /*所有超链接*/ a:link /*超链接文字格式*/ a:visited /*浏览过的链接文字格式*/ a:active /*按下链接的格式*/ a:hover /*鼠标转到链接*/ 鼠标光标样式:链接手指CURSOR: hand 十字体cursor:crosshair 箭头朝下cursor:s-resize 十字箭头cursor:move 箭头朝右 cursor:move 加一问号 cursor:help 箭头朝左cursor:w-resize 箭头朝上cursor:n-resize 箭头朝右上cursor:ne-resize 箭头朝左上cursor:nw-resize 文字I型cursor:text 箭头斜右下cursor:se-resize 箭头斜左下cursor:sw-resize
c s s样式大全(整理版) 字体属性:(font) 大小 {font-size: x-large;}(特大) xx-small;(极小) 一般中文用不到,只要 用数值就可以,单位:PX、PD 样式 {font-style: oblique;}(偏斜体) italic;(斜体) normal;(正常) 行高 {line-height: normal;}(正常) 单位:PX、PD、EM 粗细 {font-weight: bold;}(粗体) lighter;(细体) normal;(正常) 变体 {font-variant: small-caps;}(小型大写字母) normal;(正常) 大小写 {text-transform: capitalize;}(首字母大写) uppercase;(大写) lowercase;(小写) none;(无) 修饰 {text-decoration: underline;}(下划线) overline;(上划线) line-through;(删除线) blink;(闪烁) 常用字体: (font-family)"Courier New", Courier, monospace, "Times New Roman", Times, serif, Arial, Helvetica, sans-serif, V e r d a n a 背景属性:(background) 色彩 {background-color: #FFFFFF;} 图片 {background-image: url();} 重复 {background-repeat: no-repeat;} 滚动 {background-attachment: fixed;}(固定) scroll;(滚动) 位置 {background-position: left;}(水平) top(垂直); 简写方法 {background:#000 url(..) repeat fixed left top;} /*简写·这个在阅读代码中经常出现,要认真的研究*/ 区块属性: (Block) /*这个属性第一次认识,要多多研究*/ 字间距 {letter-spacing: normal;} 数值 /*这个属性似乎有用,多实践下*/ 对齐 {text-align: justify;}(两端对齐) left;(左对齐) right;(右对齐) center;(居中) 缩进 {text-indent: 数值px;} 垂直对齐 {vertical-align: baseline;}(基线) sub;(下标) super;(下标) top; text-top; middle; bottom; text-bottom; 词间距word-spacing: normal; 数值 空格white-space: pre;(保留) nowrap;(不换行) 显示 {display:block;}(块) inline;(内嵌) list-item;(列表项) run-in;(追加部分) compact;(紧凑) marker;(标记) table; inline-table table-raw-group; table-header-group; table-footer-group; table-raw; table-column-group; table-column; table-cell; table-caption;(表格标题) /*display 属性的了解很模糊*/ 方框属性: (Box) width:; height:; float:; clear:both; margin:; padding:; 顺序:上右下左边框属性: (Border) border-style: dotted;(点线) dashed;(虚线) solid; double;(双线) groove;(槽线) ridge;(脊状) inset;(凹陷) outset; border-width:; 边框宽度 border-color:#; 简写方法border:width style color; /*简写*/
CSS属性大全分类:网络技术 CSS 属性: 字体样式(Font Style) 序号中文说明标记语法 1 字体样式 {font:font-style font-variant font-weight font-size font-family} 2 字体类型 {font-family:"字体1","字体2","字体3",...} 3 字体大小{font-size:数值|inherit| medium| large| larger| x-large| xx-large| small| smaller| x-small| xx-small} 4 字体风格 {font-style:inherit|italic|normal|oblique} 5 字体粗细 {font-weight:100-900|bold|bolder|lighter|normal;} 6 字体颜色 {color:数值;} 7 阴影颜色 {text-shadow:16位色值} 8 字体行高 {line-height:数值|inherit|normal;} 9 字间距 {letter-spacing:数值|inherit|normal} 10 单词间距 {word-spacing:数值|inherit|normal} 11 字体变形 {font-variant:inherit|normal|small-cps } 12 英文转换 {text-transform:inherit|none|capitalize|uppercase|lowercase} 13 字体变形 {font-size-adjust:inherit|none} 14 字体{font-stretch:condensed|expanded|extra-condensed|extra-expanded|inherit|narrower |normal| semi-condensed|semi-expanded|ultra-condensed|ultra-expanded|wider} 文本样式(Text Style) 序号中文说明标记语法 1 行间距 {line-height:数值|inherit|normal;} 2 文本修饰 {text-decoration:inherit|none|underline|overline|line-through|blink} 3 段首空格 {text-indent:数值|inherit} 4 水平对齐 {text-align:left|right|center|justify} 5 垂直对齐{vertical-align:inherit|top|bottom|text-top|text-bottom|baseline|middle|sub|supe r} 6 书写方式 {writing-mode:lr-tb|tb-rl} 背景样式 序号中文说明标记语法 1 背景颜色 {background-color:数值} 2 背景图片 {background-image: url(URL)|none} 3 背景重复 {background-repeat:inherit|no-repeat|repeat|repeat-x|repeat-y} 4 背景固定 {background-attachment:fixed|scroll} 5 背景定位 {background-position:数值|top|bottom|left|right|center}
css样式大全(整理版) 字体属性:(font) 大小 {font-size: x-large;}(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX、PD 样式 {font-style: oblique;}(偏斜体) italic;(斜体) normal;(正常) 行高 {line-height: normal;}(正常) 单位:PX、PD、EM 粗细 {font-weight: bold;}(粗体) lighter;(细体) normal;(正常) 变体 {font-variant: small-caps;}(小型大写字母) normal;(正常) 大小写 {text-transform: capitalize;}(首字母大写) uppercase;(大写) lowercase;(小写) none;(无) 修饰 {text-decoration: underline;}(下划线) overline;(上划线) line-through;(删除线) blink;(闪烁) 常用字体: (font-family)"Courier New", Courier, monospace, "Times New Roman", Times, serif, Arial, Helvetica, sans-serif, Verdana 背景属性:(background) 色彩 {background-color: #FFFFFF;} 图片 {background-image: url();} 重复 {background-repeat: no-repeat;} 滚动 {background-attachment: fixed;}(固定) scroll;(滚动) 位置 {background-position: left;}(水平) top(垂直); 简写方法 {background:#000 url(..) repeat fixed left top;} /*简写·这个在阅读代码中经常出现,要认真的研究*/ 区块属性:(Block) /*这个属性第一次认识,要多多研究*/ 字间距 {letter-spacing: normal;} 数值 /*这个属性似乎有用,多实践下*/ 对齐 {text-align: justify;}(两端对齐) left;(左对齐) right;(右对齐) center;(居中) 缩进 {text-indent: 数值px;} 垂直对齐 {vertical-align: baseline;}(基线) sub;(下标) super;(下标) top; text-top; middle; bottom; text-bottom; 词间距word-spacing: normal; 数值 空格white-space: pre;(保留) nowrap;(不换行) 显示 {display:block;}(块) inline;(内嵌) list-item;(列表项) run-in;(追加部分) compact;(紧凑) marker;(标记) table; inline-table; table-raw-group; table-header-group; table-footer-group; table-raw; table-column-group; table-column; table-cell; table-caption;(表格标题) /*display 属性的了解很模糊*/ 方框属性:(Box) width:; height:; float:; clear:both; margin:; padding:;