作者othree (OOO)
看板Web_Design
标题Re: [问题] class的应用 (CSS)
时间Thu Jul 12 21:20:48 2007
※ 引述《Grace5051 (爱哭鬼)》之铭言:
: 我在html里面
: 定义了两种的select class
: <select class="t1">
: <option value="aaa">
: <option value="bbb">
: </select>
: <select class="t2">
: <option value="ccc">
: <option value="ddd">
: </select>
: 然後我在css内
: select, t1{width:21em;}
: select, t2{width:31em;}
: 可是却只读到31em的宽度
: 为什麽呢 要怎麽样才可以有两种不同的宽
select, t1 这样会变成选择select元件和t1元件(元件、标签、物件...etc)
选择class要用 .
例如 .t1 就是class有t1的元件
select.t1 才是有t1这个class name的select元件
所以你可能是改成
select.t1 {width: 21em;}
select.t2 {width: 31em;}
或是就用
.t1 {width: 21em;}
.t2 {width: 31em;}
--
FrontPage is not a visual web editor. It is an IE page editor.
From "designing with web standards" by jeffery zeldman
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.118.5.39