css help我需要在4个输入旁边浮动两个文本区域

时间:2010-10-09 15:17:56

标签: html css wordpress

这是我必须使用的标记,表单是通过wordpress插件创建的,所以我无法控制HTML,

<div class="wpcf7" id="wpcf7-f1-p214-o1">
<form action="/testing/contact-us/#wpcf7-f1-p214-o1" method="post" class="wpcf7-form">
    <div style="display: none;">
        <input type="hidden" name="_wpcf7" value="1" />
        <input type="hidden" name="_wpcf7_version" value="2.4.1" />
        <input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f1-p214-o1" />
    </div>
    <fieldset>
        <span class="wpcf7-form-control-wrap Name"><input type="text" name="Name" value="Name" class="wpcf7-text wpcf7-validates-as-required" size="40" /></span><br />
        <span class="wpcf7-form-control-wrap your-email"><input type="text" name="your-email" value="Email Address" class="wpcf7-text wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></span><br />
        <span class="wpcf7-form-control-wrap telephone"><input type="text" name="telephone" value="Telephone" class="wpcf7-text wpcf7-validates-as-required" size="40" /></span><br />
        <span class="wpcf7-form-control-wrap company"><input type="text" name="company" value="Company" class="wpcf7-text wpcf7-validates-as-required" size="40" /></span><br />
        <input type="submit" value="Send" class="wpcf7-submit" /><br />
    </fieldset>
    <fieldset>
        <span class="wpcf7-form-control-wrap town-city"><textarea name="town-city" class="wpcf7-validates-as-required" cols="40" rows="10">Atleast town/city</textarea></span><br />
    </fieldset>
    <fieldset>
        <span class="wpcf7-form-control-wrap your-enquiry"><textarea name="your-enquiry" class="wpcf7-validates-as-required" cols="40" rows="10">Enter your enquiry</textarea></span><br />
    </fieldset>
    <div class="wpcf7-response-output wpcf7-display-none"></div>
</form>

这是我目前的CSS,

    .page-id-214 input{
    margin:0px 0px 10px 0px;
    width:231px;
    border:1px solid #aaaaaa;
    float:left;
    clear:left;
}

我试图让它看起来像这样,

alt text

目前我只能将所有元素放在彼此之上

.page-id-214 textarea {
    width:206px;
    height:109px;
    float:left;
}

1 个答案:

答案 0 :(得分:2)

尝试放

float:left;border:0;margin:0 5px;padding:0;width:206px;
    height:109px;

在fieldset元素上,而不是输入。哦,然后选择这个:

body#wpcf7-f1-p214-o1增加选择性并覆盖主题上设置的任何其他字段集样式:

这样:

body #wpcf7-f1-p214-o1 {
float:left;
border:0;
margin:0 5px;
padding:0;
width:206px;
height:109px;
}