CSS — 西米CC 汇聚建站资源 - 点亮博客价值 — 西米CC Page 2

From the category archives:

CSS

汇聚博客资源,点亮博客价值 - 西米CC(http://ximicc.com)操作HTML元素的诀窍在于明白它们工作的方法在于没有特定的形式。一些由标签组成的大部分页面可以设定任何样式。浏览器默认的样式里的大部分html元素由字体样式、margin,padding组成,本质上是显示类型。

Display属性基本上分为inline,block,和 none。inline就像它的本意——显示为inline的元素为行。strong,anchor锚和em强调元素默认是行。block元素前后换行。标题和段落元素是块元素…..

Continue Reading …

{ 0 comments }

汇聚博客资源,点亮博客价值 - 西米CC(http://ximicc.com)背景图片Background Images有许多属性可以操作。幸运的是,可以使用background处理所有:

  1. body {
  2. background: white url(http://www.htmldog.com/images/bg.gif) no-repeat top right;
  3. }

上面合并了下面属性:

background-color出现在前面。

background-image图片的位置。

background…..

Continue Reading …

{ 0 comments }

汇聚博客资源,点亮博客价值 - 西米CC(http://ximicc.com)一些CSS属性答应使用一串值代替许多属性,值使用空格分开。

margin,pdding和border-width答应合并 margin-top-width, margin-right-width, margin-bottom-width等等,形式像这样:property:top right bottom left;逆时针顺序。

所以下面的:

  1. p {
  2. border-top-width: 1px;
  3. border-right-w…..

Continue Reading …

{ 0 comments }

汇聚博客资源,点亮博客价值 - 西米CC(http://ximicc.com)CSS中,如果对于相同元素有针对不同条件的定义,宜将最一般的条件放在最上面,并依次向下,保证最下面的是最特殊的条件。这样,浏览器在显示元素时,才会从特殊到一般、逐级向上验证条件,才会使你的每一个CSS语句都起到效果。

老外总结了一个便于记忆的“爱恨原则”(LoVe/HAte),即四种伪类的首字母:LVHA即正确的顺序:a:link、 a:visited、a:hover、a:active。实际上,从CSS的“就近原则”也可以看出这个…..

Continue Reading …

{ 0 comments }

汇聚博客资源,点亮博客价值 - 西米CC(http://ximicc.com)Grouping 分组

当许多选择器有同样属性时,可以使用逗号组合它们。例子:

  1. h2 {
  2. color: red;
  3. }
  4. .thisOtherClass {
  5. color: red;
  6. }
  7. .yetAnotherClass {
  8. color: red;
  9. }

上面的可以写成这样:

  1. h2, .thisOtherClass, .yetAnotherClass
  2. {
  3. color: red;
  4. }…..

Continue Reading …

{ 0 comments }