【问题标题】:Special class on Jumbotron hiding H1 titleJumbotron 隐藏 H1 标题的特殊课程
【发布时间】:2016-03-09 20:50:31
【问题描述】:

我为 Jumbotron 添加了一个“特殊”类,以使 Jumbotron 的高度保持 100% 的用户浏览器窗口(无论大小)。

但是,当我将此类应用到 jumbotron (greenpromobox) 中的 div 时,它位于我的标题顶部,因此在移动设备上隐藏了 H1 标题(位于 Jumbotron 中)。

关于解决方案的任何想法?

直播链接:http://185.123.96.102/~kidsdrum/moneynest.co.uk

HTML

<div class="special">
    <div class="jumbotron">
        <div class="container text-center">
            <div class="h1extrapadding hidden-xs hidden-sm"></div>  
            <h1 class="boldme">Aged 20-30 & frustrated with money?</h1> 

            <div class="greenpromobox">
                <div class="h2extrapadding hidden-xs hidden-sm"></div>  
                <h2 class="boldme">Take our free <b class="jumpstarttext">Jumpstart Your Finances</b> class to<br /> quickly gain control over your finances</h2>

                <!-- Begin MailChimp Signup Form -->
                <div id="mc_embed_signup">
                    <form action="//moneynest.us11.list-manage.com/subscribe/post?u=9ccf2d2219536b32eaae3c3d1&amp;id=299de51b4e" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
                        <div id="mc_embed_signup_scroll">

                        <img src="http://185.123.96.102/~kidsdrum/moneynest.co.uk/img/hand-drawn-arrow.png" id="handarrow" class="hidden-xs hidden-sm" alt="arrow"><input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="Enter your email address" required autofocus>
                        <!-- 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;" aria-hidden="true">
                            <input type="text" name="b_9ccf2d2219536b32eaae3c3d1_299de51b4e" tabindex="-1" value="">
                        </div>
                        <div class="clear">
                            <input type="submit" value="Start Class Now" name="subscribe" id="mc-embedded-subscribe" class="text-uppercase btn btn-primary btn-lg"></div>
                        </div>
                    </form>
                </div>
               <!--End mc_embed_signup-->
            </div>
        </div>
    </div>
</div>

CSS

.special,.special .jumbotron{
    height:100%;
    width: 100%;
}

【问题讨论】:

  • 我没有看到这个.. 你修好了吗?我注意到绿色框的底部在手机上被裁剪了。
  • 不,我还没有修复它你是在手机上尝试还是通过调整大小?当我在 iPhone 上实际查看时,似乎有所不同。
  • iPhone 4S 是我用的手机

标签: html css twitter-bootstrap twitter-bootstrap-3


【解决方案1】:

是的.. 5秒。你的手机是最新的吗?

【讨论】:

  • 非常感谢,是的,我的手机是最新的。嗯,奇怪的是,greenpromodiv 的底部似乎不见了,知道这是为什么吗?
  • 您的 jumbotron 设置为溢出:隐藏。该大小的内容比 jumbotron 高,因此正在被裁剪。如果您在该尺寸的屏幕上缩小内容,那就没问题了。不要忘记,在风景中它会更短。
  • 好点,似乎源于输入电子邮件框的高度,如果我将 px 更改为 % 它似乎不起作用?
  • 使用媒体查询根据屏幕尺寸设置尺寸。您还应该让 h1 和 h2 在手机上的字体更小。
  • 谢谢,我以为 Bootstrap 会为我做这件事?考虑到它首先是移动设备?
【解决方案2】:

已删除:

.special,.special .jumbotron{
    height:100%;
}

添加

@media only screen and (min-width: 768px) {
.special,.special .jumbotron
{height: 100%;
}
}

这阻止了 Jumbotron 强制移动设备上的 100% 高度导致元素被隐藏。

山姆

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-17
    • 1970-01-01
    • 2016-03-19
    • 1970-01-01
    相关资源
    最近更新 更多