在文本字段下方显示文本并添加背景颜色

时间:2016-07-07 09:29:15

标签: html css

如果我们访问here您可以看到Sub DefineLists() Dim sheetArr(1 to 5) as Worksheet Dim tblArr(1 to 5) as ListObject 'set array of sheet names Set sheetArr(1) = Sheets("All Data") Set sheetArr(2) = Sheets("Day") Set sheetArr(3) = Sheets("Evening") Set sheetArr(4) = Sheets("Night") Set sheetArr(5) = Sheets("Weekend") 'set array of table names Set tblArr(1) = sheetArr(1).ListObjects("tblAllData") Set tblArr(2) = sheetArr(2).ListObjects("tblDayData") Set tblArr(3) = sheetArr(3).ListObjects("tblEveData") Set tblArr(4) = sheetArr(4).ListObjects("tblNightData") Set tblArr(5) = sheetArr(5).ListObjects("tblWeekendData") End Sub 标签,请点击该标签。你可以看到如下图所示。

我们正在显示Add ReviewMaximum 60 characters&文本字段后your rating,但我想在文本字段下方显示。我也想为部分添加白色背景。

enter image description here

我想要显示如下图像:

enter image description here

first and last name

CSS

<li class="inline-label">
                        <label for="summary_field" class="required"><em></em><?php echo $this->__('Review Title :') ?></label>
                        <div class="input-box">

                            <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getTitle()) ?>" />
                        </div>
                        <p>( Maximum 60 characters )</p>
                   </li>


                    <li>
                        <label for="review_field" class="required"><em></em><?php echo $this->__('Your Review :') ?></label>
                        <div class="input-box">
                            <textarea name="detail" id="review_field" cols="5" rows="3" class="required-entry"><?php echo $this->escapeHtml($data->getDetail()) ?></textarea>
                        </div>
                        <p>( Please make sure your review contains atleast 100 characters )</p>
                    </li>

2 个答案:

答案 0 :(得分:1)

将您的说明p标记添加到input-box div中,如下所示:

<div class="input-box">
    <input type="text" name="title" id="summary_field" class="input-text required-entry" value="">
   <p>( Maximum 60 characters )</p>
</div>

背景颜色:

.tab-text {
    background: #fff;
    box-shadow: 3px 3px 3px #ccc;   
    padding: 60px 30px 30px;
}
.input-box textarea{
    max-width:100%;
}

对于行布局,请在li标记中添加所有字段,如下所示:

<li>
    <label>Your Rating :</label>
    <div class="input-box">
        your field like ( input or textarea)
        <p> Description Text</p>
    </div>
</li>

答案 1 :(得分:1)

使用CSS 3属性background-size:

#background {
background-size: 100% auto; /* width and height, can be %, px or whatever. */
}