自由,平等,開源,分享

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            2 Posts :: 61 Stories :: 3 Comments :: 0 Trackbacks

            對含有表單的網(wǎng)頁進行 XHTML 1.0 校驗時,發(fā)現(xiàn)無論如何也無法通過驗證,網(wǎng)上檢索了一下相關資料,發(fā)現(xiàn)有如下規(guī)則:

            XHTML 1.0 Strict 中表單元素要放在<div></div>、<p></p>… 里面。

            看下面的代碼:

          <form method="post" action="">
          <p>
          <label>帳號 <input name="account" type="text" /></label>
          <label>密碼 <input name="password" type="password" /></label>
          <input type="submit" value="登錄" />
          </p>
          </form>

            另外,如果 form 中包含 fieldset 元素,它可不必包含在 div、p 等元素中,但未包含在 fieldset 元素中的表單元素,必須包含在 div、p 中。

          <form method="post" action="">
          <fieldset>
          <legend>帳戶</legend>
          <label>帳號 <input name="account" type="text" /></label>
          <label>密碼 <input name="password" type="password" /></label>
          </fieldset>
          <p><input type="submit" value="登錄" /></p>
          </form>

          posted on 2008-04-22 14:16 龍震 閱讀(347) 評論(0)  編輯  收藏 所屬分類: W3C validation
          主站蜘蛛池模板: 镇巴县| 墨竹工卡县| 侯马市| 浦北县| 英德市| 苏州市| 光山县| 余江县| 筠连县| 平昌县| 千阳县| 宁蒗| 东台市| 沈丘县| 新建县| 晴隆县| 巧家县| 星座| 久治县| 常州市| 彭水| 罗平县| 高陵县| 新乡县| 高州市| 新民市| 澜沧| 凤台县| 芦溪县| 大兴区| 胶州市| 霍城县| 昔阳县| 宁德市| 琼中| 静海县| 苏州市| 许昌县| 班戈县| 金昌市| 江安县|