繁体   English   中英

是否可以不将标语对准身体?

[英]Is it possible to not target the banner in the body?

我遇到了一个问题。我希望横幅随着浏览器的扩展而增加尺寸,但不能容纳正文的内容。 因此,我决定不允许正文内容扩展,我将执行以下媒体查询:

   @media (min-width:1281px){
    #homepage .carousel .carousel-caption { 
        left:auto;
        right:auto;
        max-width:1263px;
        margin-left:70px;
    }
    /*.footer-links{
        margin:auto;
        max-width:1263px;
    }
    .bodyPages{
        margin:auto !important;
        max-width:1263px !important;
    }
    #searchForm{
        margin:auto !important;
        max-width:1263px !important;
    }
    }*/
    /*.content-wrapper{
        margin:auto;
        max-width:1263px !important;
    }
    .carousel-wrapper{
        max-width:100%;
    }*/
    body{
        max-width:1263px !important;
        margin:auto;
    }
    :not(.carousel-inner img){

    }
    .carousel-inner img {
      height: auto;
      width: 100%;
    }
}

更新2:

<cfoutput>
<cfinclude template="inc/html_head.cfm" />
<body id="#$.getTopID()#" class="#$.createCSSHook($.content('menuTitle'))#" data-spy="scroll" data-target=".subnav" data-offset="50">
    <!--- <cfinclude template="inc/navbar.cfm" /> --->
    <!--- Navbar's display below is set to absolute position --->
    <cfinclude template="inc/navbar_ap.cfm" />
    <div id="resizable-section">
        <!---
            The Carousel/Slideshow
            Refer to the theme's contentRenderer.cfc for details on this method and its arguments/options
            NOTES: 
                * This theme is designed for Mura 6.1+
                * Only content items with an 'Associated Image' will be rendered
                * You can control the crop of the carousel image by using the custom defined 'carouselimage' image size // 'carouselimage'
        --->
        <!--- #$.dspCarouselByFeedName(
            feedName='Slideshow'
            , showCaption=true
            , cssID='myCarousel'
            , size='carouselimage'
            , interval=5000
            , autoStart=true
        )# --->
            #$.dspCarouselByFeedName(
            feedName='Slideshow'
            , showCaption=true
            , cssID='myCarousel'
            , size='custom'
            , interval=10000
            , autoStart=true
        )#
            <div class="container-fluid bodyPages">
                <div class="row">
                        <!-- expanded width of the following section. -->
                        <!--<section class="col-lg-8 col-md-8 col-sm-12 col-xs-12 content">-->
                        <section class="col-lg-offset-1 col-lg-10 col-md-12 col-sm-12 col-xs-12 content" id="home-content">
                        <!--- The content --->
                            #$.dspBody(
                                body=$.content('body')
                                , pageTitle=''
                                , crumbList=false
                                , showMetaImage=false
                            )#
                            <!--- Display Objects assigned to display region 2 (Main Content) --->
                            #$.dspObjects(2)#
                        </section>
                            <aside class="col-lg-3 col-md-4 col-sm-12 col-xs-12">-->
                            <!--- Display Objects assigned to display region 3 (Right Column) --->
                            <!--#$.dspObjects(3)#-->
                        <!--</aside>-->
                </div><!--- /.row --->
                <cfinclude template="inc/footer.cfm" />
            </div><!-- /.container -->
    </div><!-- /.resizable-text -->
<cfinclude template="inc/html_foot.cfm" />

我相信您遇到的问题是因为您要为整个身体设置最大宽度,并且横幅位于身体内。 这意味着您的横幅广告永远不能大于您指定的1263px最大宽度。

无需更改整个身体的大小,而是需要为内容创建包装。 您还需要为横幅创建包装。

这是一些HTML:

<body>

<div class="banner">
    Banner Content goes here
</div>


<div class="content-wrapper">
    Page content goes here
</div>


</body>

和一些CSS:

body {width:100%;}

.content-wrapper {
    max-width:1263px;
}

.banner-wrapper {
    width:100%;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM