在html表

时间:2015-08-30 01:03:51

标签: html css

我正在前端工作,需要一个文本框,它应该接受“狂野”字符。我还需要提一下,文本输入的标签上标有“W”。我已经编写了下面的代码,但它只是在标签旁边打印了一个普通的“W”,但是我需要按照第一张图片所示显示它。

另一个要求是在一张桌子上并排打印两个不同的段落。

1 个答案:

答案 0 :(得分:1)

请参阅此FIDDLE

<强> HTML

<table>
    <tbody>
        <tr>
            <td class="cellA">Show most recent records only
                <input type="checkbox" />
            </td>
            <td class="cellB">W = WildCards Allowed
                <br/>% = 0 to many characters
                <br/>_ = 1 character</td>
        </tr>
    </tbody>
</table>
<hr>
<label for="msn">Machine Serial Number: <sup>W</sup>
</label>
<input id="msn" />

<强> CSS

html {
    font: 400 16px/1.4 Consolas;
}
.cellA {
    vertical-align: bottom;
    text-align: left;
}
.cellB {
    padding-left: 3em;
}
sup {
    font-size: 60%;
    position: relative;
    top: -.4em;
    vertical-align: baseline;
    color: red;
}