【问题标题】:How to add span tag inside Divi Contact Form module submit button如何在 Divi Contact Form 模块提交按钮中添加 span 标签
【发布时间】:2021-09-03 06:01:00
【问题描述】:

我正在使用 divi builder 的模块构建联系表单。 Divi 的联系表单已经带有一个按钮,我需要通过在按钮标签中添加 html span 标签来自定义它。

.link--button {
  font-family: "Raleway", sans-serif;
  font-size: 15px;
  line-height: 22.6px;
  background-color: transparent;
  padding: 16px 32px 16px 40px;
  cursor: pointer;
  border: 4px solid #000000;
  color: #000000;
}

.link--button:hover .arrow {
  transition: all 0.4s ease;
  width: 35px;
  margin-right: 5px;
}

.arrow {
  height: 2px;
  width: 25px;
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-right: 15px;
  margin-bottom: 4px;
  background: black;
}

arrow:before {
  right: -2px;
  bottom: -3px;
  transform: rotate(-45deg);
  background: black;
}

.arrow:after {
  right: -2px;
  top: -3px;
  transform: rotate(45deg);
  background: black;
}

.arrow:before,
.arrow:after {
  content: "";
  background: black;
  position: absolute;
  height: 2px;
  width: 10px;
  border-radius: 30%;
}
<button class="link--button btn--black">
  <span class="arrow arrow--black"></span>Submit
 </button>

如何修改divi的html来插入箭头?

【问题讨论】:

    标签: html jquery css wordpress divi


    【解决方案1】:

    我找到了答案。在 Divi Themes 集成选项卡中,使用 jquery 将 HTML 前置:

    jQuery(document).ready(function(){
        jQuery(".my-form .et_pb_button").prepend('<span class="arrow arrow--black"></span>');
    });
    

    这会在表单的按钮内添加 HTML 标记

    【讨论】:

      猜你喜欢
      • 2019-06-06
      • 2015-09-24
      • 2013-09-25
      • 1970-01-01
      • 1970-01-01
      • 2016-04-03
      • 2018-07-03
      • 2011-10-24
      • 2020-03-18
      相关资源
      最近更新 更多