【问题标题】:Bootstrap 3 - Row Fixed IssueBootstrap 3 - 行固定问题
【发布时间】:2019-04-21 09:37:18
【问题描述】:

我正在努力使用 Bootstrap 3 网格系统。 让我解释一下我已经实现了什么、我需要什么以及我做了什么(尝试失败)。

这是图像的布局 (HTML | Razor)。让你在这个屏幕上看到这个This is the site link 的实时版本,这样你就可以看到它并播放它。

    <div class="row">
    <div class="col-xs-12 col-md-6 nopadding">
            <div id="showcaseSection" class="showcaseSection superVideo">
                <ul class="media-list" id="showcaseMedia" itemscope itemtype="http://schema.org/UserComments"></ul>
            </div>


        <div class="hidden-xs">
            <div class="col-xs-6 nopadding">
                <p class="text-center no-margin" style="margin-top: 15px;">
                    <span>Equipo: @Model.Team1Name (<span id="team1Total">0</span>)</span>
                </p>
                <ul class="media-list team1ListShowCase" id="@Model.Team1Id" data-img="@Url.Action("GetLinkToImageTeam", "Home", new {Id = Model.Team1Id})" data-media="media-left" data-team="@Model.Team1Name" data-class="team1"></ul>
            </div>
            <div class="col-xs-6 nopadding">
                <p class="text-center no-margin" style="margin-top: 15px;">
                    <span>Equipo: @Model.Team2Name (<span id="team2Total">0</span>)</span>
                </p>
                <ul class="media-list team2ListShowCase" id="@Model.Team2Id" data-img="@Url.Action("GetLinkToImageTeam", "Home", new {Id = Model.Team2Id})" data-media="media-right" data-team="@Model.Team2Name" data-class="team2"></ul>

            </div>
        </div>
    </div>


    <div class="col-xs-12 col-md-6">
       <div class="col-xs-12 col-md-6 nopadding">

    <div id="chatcontainer">
        <ul class="media-list" id="chatbody" itemscope itemtype="http://schema.org/UserComments"></ul>

        <div id="chatOptions" class="collapse">
            <p class="text-center">@Model.Title</p>
            <button id="exitroom" class="btn btn-danger" title="Salir" disabled="disabled">
                <span class="glyphicon glyphicon-log-out"></span> @Resources.Salir
            </button>
            <span>
                <input type="checkbox" id="isAutoscroll" name="my-checkbox" checked>
                <label>Actualizar Mensajes</label>
            </span>
        </div>
    </div>
    @if (!Model.IsReadOnly)
    {
        <div class="input-group">
            <input type="hidden" style="display: none" class="form-control" aria-required="false" readonly id="inresponseto">
            <textarea type="text" rows="2" class="form-control" required="required" aria-required="true" maxlength="500" placeholder="Comentario..." disabled="disabled" id="responseText"></textarea>
            <input type="text" class="form-control" style="height: 25px;" aria-required="false" readonly id="inresponsetomessage">
            <span class="input-group-btn">
                <button id="sendresponse" type="button" title="Enviar" class="btn btn-primary" disabled="disabled">
                    <span class="glyphicon glyphicon-send"></span>
                </button>
                <button class="btn btn-info" data-toggle="collapse" title="Opciones" data-target="#chatOptions">
                    <span class="fa fa-cogs"></span>
                </button>
            </span>
        </div>
    }
</div>
</div>

如您所见,所有内容都排成一排。 我希望在 XS(视口)上将 视频部分固定在顶部,并将 文本区域用于评论固定的底部。

我尝试将其添加到行中,但我修复了视频但我看不到文本区域

.fixed2 {
position: fixed;
z-index: 10;
width: 100%;}

我不知道在 XS 中如何在中间显示固定顶部(视频)和固定底部(聊天文本框)和可滚动的 cmets。

欢迎任何帮助。

【问题讨论】:

    标签: asp.net-mvc twitter-bootstrap razor twitter-bootstrap-3 bootstrap-grid


    【解决方案1】:

    为平板电脑/移动设备覆盖 #chatcontainer 的高度将解决此问题。示例:

    @media(max-width: 767px) {  
      #chatcontainer{
        height: calc(50vh - 80px);
      } 
    }
    

    【讨论】:

    • 毗湿奴,如果我能给你500分,我会去做。非常感谢他的超级简单修复。
    • @MRFerocius 很高兴能够解决您的问题。这比获得积分/声誉更令人满意。 :-)
    猜你喜欢
    • 2023-03-09
    • 2014-02-03
    • 1970-01-01
    • 1970-01-01
    • 2014-03-24
    • 2017-11-02
    • 1970-01-01
    • 2015-12-09
    • 1970-01-01
    相关资源
    最近更新 更多