首页 > 解决方案 > css - wordpress网站中带有内部按钮的输入字段

问题描述

我不太擅长 CSS 和设计网站。

我没有摆脱它。

我想添加一个带有内部按钮的输入字段以进行提交。这一切都在 wordpress 网站中作为简码。

它应该如下所示:

在此处输入图像描述

HTML

.event_form_autocomplete {
  width: 90%;
  padding: 15px;
  border: 1px solid #002652;
  color: #002652;
  font-size: 15px;
}

.event_form_submit {
  margin-left: -59px;
  padding: 14px;
  width: 50px;
  background: #002652;
  color: white;
  border: 0;
}
.event_form_arrow {
  color: white;
  position: absolute;
  margin-top: 17px;
  margin-left: -23px;
}
<input class="form-control event_form_autocomplete" id="autocomplete" name="eventAdress" placeholder="Bitte gebe Sie Ihre PLZ oder Ort ein ..." onFocus="geolocate()" type="text" required>
<input class="event_form_submit" type="submit" value="" /><i class="event_form_arrow icon-right-open white"></i>
   

http://jsfiddle.net/s5GVh/2953/

但它看起来像这样

Mozilla 在此处输入图像描述

苹果浏览器 在此处输入图像描述

歌剧 在此处输入图像描述

铬合金

在此处输入图像描述

全部使用最新版本。

标签: csswordpress

解决方案


试试这个代码

HTML

<div class="input-wrapper">
<input class="form-control event_form_autocomplete" id="autocomplete" name="eventAdress" placeholder="Bitte gebe Sie Ihre PLZ oder Ort ein ..." onFocus="geolocate()" type="text" required>
<button class="event_form_submit" type="submit" value="" /><i class="event_form_arrow icon-right-open white"></i></button>
</div>

CSS

.input-wrapper{
  position: relative;
  border: 1px solid #002652;
}
.event_form_autocomplete {
    width: 100%;
    padding: 15px;    
    color: #002652;
    font-size: 15px;
    border-width: 0;
        box-sizing: border-box;
}

.event_form_submit {
    margin: 0;
    padding: 14px;
    width: 50px;
    background: #002652;
    color: white;
    border: 0;
    position: absolute;
    top: 4px;
    right: 4px;
    height: 39px;
}
.event_form_arrow {
    color: white;
    position: absolute;
    margin-top: 17px;
    margin-left: -23px;
}


推荐阅读