我希望在960px宽响应magento网站上获得此表单,该网站的最小尺寸为320px。
我非常喜欢它类似于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-->
如果你想玩这个并在这里回帖,那就太棒了。我似乎无法弄清楚为什么内联块和摆脱浮动将无法解决这个问题。
再次感谢!
答案 0 :(得分:2)
您真的在寻找响应式设计的教程,所以我建议您阅读其中涉及的内容。但这是您需要的基本示例: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>
但是,您需要将其与布局集成,因此需要更改内容。