【问题标题】:Mailchimp Super Slim Subscribe Form - Horizontal LayoutMailchimp Super Slim 订阅表格 - 横向布局
【发布时间】:2023-03-13 15:16:01
【问题描述】:

我想在一个 960 像素宽的响应式 magento 网站上获取此表单,该网站的最小尺寸为 320 像素。

我非常喜欢它的行为/风格类似于VintageStyler 上的时事通讯表单 - 如果您加载页面并滚动到底部,您将看到一个用于电子邮件提交的时事通讯注册表单。我想让我的表单显示在一行中,并且响应迅速,就像这个一样。

查看我当前的表单 > The Signup Form - 目前我希望以一种长的水平格式查看“3 行” - 直到它出现在较小的屏幕上

这是 mailchimp 提供的“超薄”表单,包含所有样式,而不是从远程 CSS 中提取

下面是我正在使用的代码

<head>
<!-- Begin MailChimp Signup Form -->
<style type="text/css">
    #mc_embed_signup{/*background:#fff;*/ clear:left; font:14px Helvetica,Arial,sans-serif;  width:960px;}
#mc_embed_signup form {display:block; position:relative; text-align:left; /*padding:10px 0 10px 3%*/}
#mc_embed_signup h2 {font-weight:bold; padding:0; margin:15px 0; font-size:1.4em;}
#mc_embed_signup input {border:1px solid #999; -webkit-appearance:none;}
#mc_embed_signup input[type=checkbox]{-webkit-appearance:checkbox;}
#mc_embed_signup input[type=radio]{-webkit-appearance:radio;}
#mc_embed_signup input:focus {border-color:#333;}
/* Button Code */#mc_embed_signup .button {clear:both; background-color: #aaa; border: 0 none; border-radius:4px; color: #FFFFFF; cursor: pointer; display: inline-block; font-size:15px; font-weight: bold; height: 32px; line-height: 32px; margin: 0 5px 10px 0; padding:0; text-align: center; text-decoration: none; vertical-align: top; white-space: nowrap; width: auto;}
#mc_embed_signup .button:hover {background-color:#777;}
#mc_embed_signup .small-meta {font-size: 11px;}
#mc_embed_signup .nowrap {white-space:nowrap;}     
#mc_embed_signup .clear {clear:none; display:inline;}

#mc_embed_signup label {display:block; font-size:16px; padding-bottom:10px; font-weight:bold;}
#mc_embed_signup input.email {display:block; padding:8px 0; margin:0 4% 10px 0; text-indent:5px; width:35%; min-width:130px;}
#mc_embed_signup input.button {display:block; width:35%; margin:0 0 10px 0; min-width:90px;}

#mc_embed_signup div#mce-responses {float:left; top:-1.4em; padding:0em .5em 0em .5em; overflow:hidden; width:90%;margin: 0 5%; clear: both;}
#mc_embed_signup div.response {margin:1em 0; padding:1em .5em .5em 0; font-weight:bold; float:left; top:-1.5em; z-index:1; width:80%;}
#mc_embed_signup #mce-error-response {display:none;}
#mc_embed_signup #mce-success-response {color:#529214; display:none;}
#mc_embed_signup label.error {display:block; float:none; width:auto; margin-left:1.05em; text-align:left; padding:.5em 0;}
</style>
</head>
<body>
<div id="mc_embed_signup">
<form action="#" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <label for="mce-EMAIL">Stay Connected with Tuga Sunwear</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;"><input type="text" name="#" tabindex="-1" value=""></div>
    <div class="clear"><input type="submit" value="Subscribe Now" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</form>
</div>
</body>
<!--End mc_embed_signup-->

如果您想玩弄这个并在这里发帖,那就太棒了。我似乎无法弄清楚为什么 inline-block 和摆脱浮点数不能解决这个问题。

再次感谢!

【问题讨论】:

  • 不太清楚你在这里问什么。你想达到什么目的?
  • 我很抱歉。我刚刚更新了帖子,希望能澄清我想要做什么

标签: html css forms magento mailchimp


【解决方案1】:

您确实在寻找响应式设计的教程,所以我建议您阅读其中涉及的内容。但这是您需要的基本示例:http://codepen.io/pageaffairs/pen/JDrhG

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
    *, *:before, *:after {-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}
    #mc_embed_signup{ clear:left; font:14px Helvetica,Arial,sans-serif; width: 80%; margin: 0 auto;}
    #mc_embed_signup form {display:block; position:relative; text-align:left;}
    #mc_embed_signup input {border:1px solid #999; -webkit-appearance:none;}
    #mc_embed_signup input:focus {border-color:#333;}
    #mc_embed_signup .button {clear:both; background-color: #aaa; border: 0 none; border-radius:4px; color: #FFFFFF; cursor: pointer; display: inline-block; font-size:15px; font-weight: bold; height: 32px; line-height: 32px; margin: 0 5px 10px 0; padding:0; text-align: center; text-decoration: none; vertical-align: top; white-space: nowrap; width: auto;}
    #mc_embed_signup .button:hover {background-color:#777;}
    #mc_embed_signup .small-meta {font-size: 11px;}
    #mc_embed_signup .nowrap {white-space:nowrap;}     
    #mc_embed_signup .clear {clear:none; display: inline-block; width: 31%; vertical-align: top;}

    #mc_embed_signup label {display:inline-block; font-size:16px; padding-bottom:10px; font-weight:bold; width: 31%;vertical-align: top;}
    #mc_embed_signup input.email {display:inline-block; padding:8px 0; margin:0 10px 10px 0; text-indent:5px; width:34%;vertical-align: top;}
    #mc_embed_signup input.button {display:block; width:100%; margin:0 0 10px 0;}

    @media screen and (max-width: 780px) {
        #mc_embed_signup {width: 100%;}
        #mc_embed_signup label, #mc_embed_signup input.email, #mc_embed_signup .clear {display: block; width: 100%;}
    }
</style>
</head>
<body>
<div id="mc_embed_signup">
    <form action="#" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
        <label for="mce-EMAIL">Stay Connected with Tuga Sunwear</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;">
            <input type="text" name="#" tabindex="-1" value="">
        </div>
        <div class="clear">
            <input type="submit" value="Subscribe Now" name="subscribe" id="mc-embedded-subscribe" class="button">
        </div>
    </form>
</div>
</body>

不过,您需要将其与您的布局集成,因此需要进行更改。

【讨论】:

    猜你喜欢
    • 2016-05-30
    • 2014-04-24
    • 2015-02-22
    • 2016-11-01
    • 1970-01-01
    • 2011-01-12
    • 2012-09-29
    • 2013-11-09
    • 2015-08-13
    相关资源
    最近更新 更多