将不同样式应用于替代文本? [英] Applying Different Styles To Alternate Text ?
问题描述
有一个FAQ页面,里面有很多问题和答案。
问题需要是不同的颜色/风格和答案
不同。想知道有没有一种简单的方法可以做到这一点与
相比,在div中包含每个问题和答案?也许,通过
JavaScript。
提前致谢..
P.S.这可能是一个多重帖子...... :( div class =h2_lin>解决方案
vivekian写道:
有一个FAQ页面,里面有很多问题和答案。
问题需要不同的颜色/样式和答案
不同。想知道有没有一种简单的方法来比较
来封闭div中的每个问题和答案?也许,通过
JavaScript。
使用CSS。如果访问者禁用了JavaScript或不可用,该怎么办?
< h1>我的常见问题>
< h2> ;问题1< / h2>
< p>回答问题1< / p>
< h2>问题2< / h2>
< p>你明白了......< / p>
CSS:
body { font-family:sans-serif;}
h2 {color:red; font-family:serif;}
p {color:black;}
-
-bts
-警告:我为草坪鹿刹车
vivekian写道:
>
有一个FAQ页面,里面有很多问题和答案。
问题需要有不同的颜色/样式和答案
不同。
常见问题解答可以被视为定义列表(名称/值对)。使用CSS
style< dtand< ddto taste。
-
jmm(连字符)列表(at) sohnen-moe(dot)com
(删除电子邮件的.AXSPAMGN)
Jim Moe< jm ******** *******@sohnen-moe.comscripsit:
常见问题解答可以被视为定义列表(名称/值对)。
一条狗可以被认为是一匹马,但它不是马。 (此外,它不是
甚至名称/值对。问题不是名称。)
使用CSS来设置样式< dtand< ddto taste。
除了不合逻辑(语义错误)标记外,使用< dlwins
什么都没有。它的风格比简单的逻辑标记更难,例如
< h2 for questions。 (如果你想把一个答案作为一个整体来设置,那么你有更好的把它作为一个分类< div>,因为它不需要包含一个单独的
段落答案可以包含许多不同的元素。)
-
Jukka K. Korpela(Yucca)
< a rel =nofollowhref =http://www.cs.tut.fi/~jkorpela/target =_ blank> http://www.cs.tut.fi/~jkorpela/
Hi,
Have a FAQ page , where have many sets of questions and answers. The
questions need to be a different colour / style and the answers
different. Was wondering is there a easy way to do this as compared to
enclosing each question and answer within divs ? Perhaps , through
JavaScript.
Thanks in advance ..
P.S. this might be a multipost.. :(
vivekian wrote:
Have a FAQ page , where have many sets of questions and answers. The
questions need to be a different colour / style and the answers
different. Was wondering is there a easy way to do this as compared
to enclosing each question and answer within divs ? Perhaps , through
JavaScript.Use CSS. What if the visitor has JavaScript disabled or not available?
<h1>My FAQ>
<h2>Question 1</h2>
<p>Answer for question 1</p>
<h2>Question2</h2>
<p>You get the idea...</p>
CSS:
body { font-family: sans-serif; }
h2 { color: red; font-family: serif; }
p { color: black; }
--
-bts
-Warning: I brake for lawn deer
vivekian wrote:>
Have a FAQ page , where have many sets of questions and answers. The
questions need to be a different colour / style and the answers
different.
A FAQ can be considered a definition list (name/value pairs). Use CSS to
style <dtand <ddto taste.
--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jim Moe <jm***************@sohnen-moe.comscripsit:
A FAQ can be considered a definition list (name/value pairs).A dog can be considered a horse, but it ain''t no horse. (Besides, it''s not
even name/value pairs. A question is not a name.)
Use CSS to style <dtand <ddto taste.In addition to being illogical (semantically wrong) markup, using <dlwins
nothing. It''s _more difficult_ to style than simple logical markup such as
<h2for questions. (If you wish to style an answer as a unit, then you had
better make it a classed <div>, since it need not consist of a single
paragraph, and an answer can contain many different elements in succession.)
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
这篇关于将不同样式应用于替代文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!