【问题标题】:Subscription form CSS editing订阅表单 CSS 编辑
【发布时间】:2016-04-26 14:09:49
【问题描述】:

我需要编辑此订阅表单,使电子邮件框和按钮的宽度均为 290 像素并居中。我还想让按钮变黑而不是圆角。请问有人可以帮忙吗?

<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/slim-10_7.css" rel="stylesheet" type="text/css">
<style type="text/css">
    #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica, Arial,sans-serif;  width:290px;}
    /* 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="//thefacefactory.us12.list-manage.com/subscribe/post?u=95d25bd530e274cd2b9abd235&amp;id=411d7026eb" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">
    <label for="mce-EMAIL">The Face Factory Newsletter</label>
    <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
    <!-- 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;" arial-hidden="true"><input type="text" name="b_95d25bd530e274cd2b9abd235_411d7026eb" tabindex="-1" value=""></div>
    <div class="clear"><input type="submit" value="Receive Offers and Beauty Tips" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </div>
</form>
</div>

<!--End mc_embed_signup-->

【问题讨论】:

  • 向我们展示您已经尝试过的 CSS 并描述它没有正确执行的地方。

标签: css forms


【解决方案1】:

尝试将以下样式添加到您现有的 CSS &lt;style&gt; 块中:

/* Target your subscribe button */
#mc-embedded-subscribe { 
      /* Ensure that the background is black (#000) */
      background-color: #000!important; 
      /* Ignore any rounded corners */
      border-radius: 0!important;
}

您可以see a working example here并在下面演示:

【讨论】:

  • 太好了,谢谢!您知道如何将所有内容居中并使邮箱与其他所有内容一样大小吗?
  • 如果您想将所有内容居中,请尝试使用these styles,它可以是seen here
  • 谢谢,我只是想把邮箱设置成和黑色按钮一样大,不知道我做了什么,但没用,现在正在触摸黑色按钮?
  • 您可能希望在您的电子邮件信箱中添加一些顶部和底部边距,这可以通过#mc_embed_signup input.email { margin: 10px auto;} 完成。这将使其水平居中并添加 10px 的顶部和底部边距以将其与其他元素分开。
  • 谢谢,成功了,你知道如何使邮箱更宽,使其与黑色按钮的大小相同吗?我保证最后一个问题。
猜你喜欢
  • 1970-01-01
  • 2018-05-12
  • 1970-01-01
  • 2022-08-19
  • 1970-01-01
  • 2021-07-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多