Agata Cortle
Agata Cortle

Reputation: 39

Style don't change in form

I use Contact Form 7 in bridge theme.

I try to customize the form in order to have 2 columns and the text be in the same line with the box where the user write the code.

My problem in that even if I use style in order to change the height and width and set the border is not take the style. Any idea why this could happen?

#left_form7 {
    width: 47%;
    float: left;
    margin-right:6%;
}

#right_form7 {
    width: 47%;
    float: left;
}

.clearfix_form7:after {
    content:"\0020";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
    overflow:hidden;
    margin-bottom:10px;
}

.clearfix_form7 {
    display:block;
}

span.label_form7 {
  float: left;
  width: 180px;
}

span.form-input_form7 {
  float: left;
  width: 200px;
}
<div class="clearfix_form7">
    <div id="left_form7">
    <span class="label_form7">First name</span><span class="form-input_form7" style="border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[text first-name]</span><br/> <br/>
    <span class="label_form7">Last name</span><span class="form-input_form7" style= "border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[text last-name]</span><br/> <br/>
    <span class="label_form7">How Did You Find Us?</span><span class="form-input_form7" style="border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[text text-find-us]</span><br/>
    </div>
    <div id="right">
    <span class="label_form7">Email</span><span class="form-input_form7" style="border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[email* your-email]</span><br/> <br/>
    <span class="label_form7">Phone</span><span class="form-input_form7" style="border-width:2px; border-style: solid; border-color: #000000; height: 5px; width:320px">[text your-phone]</span>
    </div>
</div></div>

Subject [text* your-subject] <br/>
Message [textarea* your-message]<br/>
[submit "Send"]

Here an example of output as it is now and as I can understand it seems that the box is not changing.

Upvotes: 0

Views: 274

Answers (1)

DaFois
DaFois

Reputation: 2223

Try this, you don't need to have the same style repeated on each input element. You have the class form-input_form7 to select them, and if you put height: 5px with inline style, you can't overwrite it with an external css.

#left_form7 {
    width: 47%;
    float: left;
    margin-right:6%;
}

#right_form7 {
    width: 47%;
    float: left;
}

.clearfix_form7:after {
    content:"\0020";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
    overflow:hidden;
    margin-bottom:10px;
}

.clearfix_form7 {
    display:block;
}

span.label_form7{
  float: left;
  width: 180px;
}

span.form-input_form7{
  float: left;
  width: 200px;
  border-width:2px;
  border-style: solid; 
  border-color: #000000;
}
<div class="clearfix_form7">
    <div id="left_form7">
    <span class="label_form7">First name</span><span class="form-input_form7">[text first-name]</span><br/> <br/>
    <span class="label_form7">Last name</span><span class="form-input_form7">[text last-name]</span><br/> <br/>
    <span class="label_form7">How Did You Find Us?</span><span class="form-input_form7">[text text-find-us]</span><br/>
    </div>
    <div id="right_form7">
    <span class="label_form7">Email</span><span class="form-input_form7">[email* your-email]</span><br/> <br/>
    <span class="label_form7">Phone</span><span class="form-input_form7">[text your-phone]</span>
    </div>
</div>

Subject [text* your-subject] <br/>
Message [textarea* your-message]<br/>
[submit "Send"]

Upvotes: 1

Related Questions