这是一个好习惯吗? [英] is this a good practice ?

查看:60
本文介绍了这是一个好习惯吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你可以建议一个替代方案吗?


..标题,标题-R,标题-K,标题-G,标题-W {

字体-family:arial,helvetica,ms sans serif,sans-serif;

font-size:10pt;

font-style:normal;

font-weight:bold;

text-decoration:none;

}


..heading-R {

颜色:#7a3b3b;

}


..heading-K {

颜色:卡其色;

}


..heading-G {

颜色:darkgreen;

}


..heading-W {

颜色:白色;

}

CAN YOU suggest an alternative ?

..heading, heading-R, heading-K, heading-G, heading-W {
font-family: arial,helvetica, ms sans serif, sans-serif;
font-size: 10pt;
font-style: normal;
font-weight: bold;
text-decoration: none;
}

..heading-R {
color: #7a3b3b;
}

..heading-K {
color: khaki;
}

..heading-G {
color: darkgreen;
}

..heading-W {
color: white;
}

推荐答案

Mel写道:
Mel wrote:
你可以提出另一种选择吗?

。标题,标题-R,标题-K,标题 - G,标题-W {
font-family:arial,helvetica,ms sans serif,sans-serif;


必须引用包含空格的字体。

font-size:10pt;


点数单位非常不适合在屏幕上使用。
http://css-discuss.incutio.com/?page=UsingPoints

.heading-K {color:khaki;}


卡其色不是CSS中的颜色

.heading-G {color:darkgreen;}


Ditto''darkgreen ''

.heading-W {color:white;}
CAN YOU suggest an alternative ?

.heading, heading-R, heading-K, heading-G, heading-W {
font-family: arial,helvetica, ms sans serif, sans-serif;
Fonts with spaces in them must be quoted.
font-size: 10pt;
Point units are highly unsuitable for use on screen.
http://css-discuss.incutio.com/?page=UsingPoints
.heading-K { color: khaki;}
khaki is not a colour in CSS
.heading-G { color: darkgreen;}
Ditto ''darkgreen''
.heading-W { color: white;}




这是一种指定具有相似属性的多个类的合理方法。 />

你也可以使用多个班级...


class =" heading W"


那么:


..head {la la la}

..W {color:white; }


但是 - 班级名称并不是很好。他们应该代表

意思,而不是什么东西。


你不应该用一个类来标题,HTML附带h1,h2 ,h3 ...

h6为此。


h2 {...}

h2.cats {... }

h2.dogs {...}

h2.goats {...}


....可能你是最好的选择。


-

David Dorward< http://blog.dorward.me.uk/> < http://dorward.me.uk/>



Its a reasonable way of specifying multiple classes with similar properties.

You could also use multiple classes...

class="heading W"

then:

..head { la la la }
..W { color: white; }

However - the class names aren''t very good. They should representing
meaning, not what things look like.

And you shouldn''t use a class for a heading, HTML comes with h1, h2, h3 ...
h6 for that.

h2 { ... }
h2.cats { ... }
h2.dogs { ... }
h2.goats { ... }

.... might be you best bet.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>




" Mel" <我********** @ ssa.gov>在消息中写道

新闻:c8 ********** @ s0b1a68.ssa.gov ...

"Mel" <me**********@ssa.gov> wrote in message
news:c8**********@s0b1a68.ssa.gov...
您可以提出替代方案吗?

.heading,heading-R,heading-K,heading-G,heading-W {
font-family:arial,helvetica,ms sans serif,sans-serif;
font-尺寸:10pt;
font-style:normal;
font-weight:bold;
text-decoration:none;
}

.heading- R {
颜色:#7a3b3b;
}

。标题-K {
颜色:卡其色;
}

.heading-G {
颜色:darkgreen;
}

.heading-W {
颜色:白色;
}
CAN YOU suggest an alternative ?

.heading, heading-R, heading-K, heading-G, heading-W {
font-family: arial,helvetica, ms sans serif, sans-serif;
font-size: 10pt;
font-style: normal;
font-weight: bold;
text-decoration: none;
}

.heading-R {
color: #7a3b3b;
}

.heading-K {
color: khaki;
}

.heading-G {
color: darkgreen;
}

.heading-W {
color: white;
}




你必须有一些基础来决定哪个标题应该是卡其色,哪个b $ b应该是深绿色,哪个应该是白色的 - 也就是说,它们必须反映

某种分组。如果你决定用卡其色而不是卡其色,那你想要棕褐色的卡其色?您是否会浏览所有网页并更改

每个class =" heading-K" to class =" heading-T"?或者你会不会只改变风格,然后将它留给后代,以便为什么标题-K混淆。意思是晒黑?


重点是样式的名称不应该反映

样式的细节,它们应该反映定义页面元素的特征

要应用样式。如果您的网站有三个特殊的

部分用于数学,科学和历史,那么请使用


.heading-math {color:khaki; }


等等。然后,如果你决定数学标题应该是棕褐色,你只需要

来改变风格的定义;风格的名字仍然会像原来那样产生感觉。


除此之外,你不应该使用这些名字。卡其"和深绿色因为

它们不是标准的CSS颜色条款,并非所有浏览器都能理解

它们。请改用RGB值:#F0E68C和#006400。更安全,坚持使用17倍(11十六进制)的倍数的

颜色:#EEDD88 (或#ED8)和

"#006600" (或#060)。



You must have some basis for deciding which headings should be khaki, which
should be dark green, and which should be white--that is, they must reflect
some kind of grouping. What if you decided that instead of khaki, you wanted
the khaki ones to be tan? Would you go through all your web pages and change
every instance of class="heading-K" to class="heading-T"? Or would you
change only the style, and then leave it to future generations to be
confused about why "heading-K" means "tan"?

The point is that the names of styles shouldn''t reflect the details of the
style, they should reflect the defining characteristic of the page elements
to which you want to apply the style. If your site has three special
sections for math, science, and history, then use

.heading-math { color: khaki; }

and so forth. Then if you decide math headings should be tan, you only have
to change the style''s definition; the style''s name will still make as much
sense as it did originally.

Besides that, you shouldn''t use the names "khaki" and "darkgreen" because
they are not standard CSS color terms and not all browsers will understand
them. Use RGB values instead: "#F0E68C" and "#006400". Even safer, stick to
colors that use multiples of 17 (11 hex): "#EEDD88" (or "#ED8") and
"#006600" (or "#060").


Mel写道:
你能提出另一种选择吗?


到底是什么?你想要什么?

。标题,标题-R,标题-K,标题-G,标题-W {
font-family:arial,helvetica,ms sans serif,sans- serif;
CAN YOU suggest an alternative ?
To what? What do you want?
.heading, heading-R, heading-K, heading-G, heading-W {
font-family: arial,helvetica, ms sans serif, sans-serif;




[snip]


我不知道,一些真正的标记怎么样?


H1 {

font-family:sans-serif;

字体大小:140%;

颜色:#008000;

背景:#ffffff;

}


-

Brian(删除无效 ;从我的地址给我发电子邮件)
http://www.tsmchughs.com/


这篇关于这是一个好习惯吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆