【问题标题】:Button next to Mailchimp boxMailchimp 框旁边的按钮
【发布时间】:2014-04-18 07:45:36
【问题描述】:

在这个页面上:http://www.christophelouage.be/category/blog/

我没有成功将红色的“确定”按钮放在输入框右侧的边栏中。我尝试了几个小时,没有运气。

这是小部件的代码:

<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
    #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
    /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
       We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="http://christophelouage.us3.list-manage.com/subscribe/post?u=b665c89ed961eb5c803a3b5b8&amp;id=8b20a6157e" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" novalidate>

<div class="mc-field-group">
    <label for="mce-EMAIL">Email Address </label>
    <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Vul je e-mailadres in">
</div>
    <div id="mce-responses" class="clear">
        <div class="response" id="mce-error-response" style="display:none"></div>
        <div class="response" id="mce-success-response" style="display:none"></div>
    </div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div style="position: absolute; left: -5000px;"><input type="text" name="b_b665c89ed961eb5c803a3b5b8_8b20a6157e" value=""></div>
    <div class="clear"><input type="submit" value="OK" name="subscribe" id="mc-embedded-subscribe" class="blogbutton"></div>
</form>
</div>

<!--End mc_embed_signup-->

这是我的 CSS:

.mc-field-group {
    margin-top: -30px !important;
}

.mc-field-group label {
    display: none !important;
}

.mc-field-group input {
    width: 62% !important;
    clear: none !important;
    display: inline-block !important;
    float: left !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    border: 1px solid #707070 !important;
    border-radius: 2px !important;
    -moz-border-radius: 2px !important;
    -webkit-border-radius: 2px !important;
}

#mc_embed_signup form {
    padding: 10px 0 10px 0% !important;
}

.blogbutton {
    width: 20% !important;
    clear: none !important;
    display: inline-block !important;
    float: left !important;
    -moz-border-radius: 5px !important;
    -webkit-border-radius: 5px !important;
    background-color: #ad1e1c !important;
    border-radius: 5px !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    font-size: 16px !important;
    padding: 11px 0px !important;
    text-align: center !important;
    text-decoration: none !important;
    line-height: 1 !important;
    transition: all 0.15s ease-in-out !important;
    -webkit-transition: all 0.15s ease-in-out !important;
    -moz-transition: all 0.15s ease-in-out !important;
    -o-transition: all 0.15s ease-in-out !important;
    -ms-transition: all 0.15s ease-in-out !important;
    margin-top: 2px !important;
    margin-left: 5px !important;
    text-transform: none !important;
}

.blogbutton:hover {
    background-color: #373837 !important;
    color: #fff !important;
    border: none !important;
    text-decoration: none !important;
}

非常感谢您帮助我! 斯蒂芬

【问题讨论】:

  • 请添加截图?
  • 抱歉,维护插件仍处于活动状态。链接现在应该可以使用了。
  • 请在小提琴中重现此问题,否则一旦解决您的问题将变得过时并且对未来的用户完全无用。
  • 我可以移动你的元素吗?因为你的 62% input 不会与外部 div
  • 小提琴添加:jsfiddle.net/573Qk

标签: css mailchimp


【解决方案1】:

我在.mc-field-group 中移动了“确定”按钮

<div class="mc-field-group">
    <label for="mce-EMAIL">Email Address </label><br>
    <input name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Vul je e-mailadres in" type="email">
    <input value="OK" name="subscribe" id="mc-embedded-subscribe" class="blogbutton" type="submit">
</div>

额外修改的 CSS:

.mc-field-group .blogbutton {
    position: absolute;  /*This and the one after is used to style the position of the button, may be removed*/
    top: 14px;
    width: 30% !important;
    padding: 7px !important;
}

.mc-field-group input.required {
    width:70% !important;
    float:left;
    display:inline-block;
}

成品效果

请修改您自己的代码!我对你的疯狂!importants 无能为力,但你明白我的想法吗? :D

【讨论】:

  • 如果这能解决您的问题,请选择“打勾”。它会做很多事情。 :)
猜你喜欢
  • 2023-03-30
  • 1970-01-01
  • 2018-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-27
  • 1970-01-01
相关资源
最近更新 更多