简体   繁体   中英

Is it possible to not target the banner in the body?

I am having an issue.. I would for the banner to increase in size with the browser expands but not the content of the body. So I figured to not allow the body content to expand, I would do the following media query:

   @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%;
    }
}

UPDATE 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" />

I believe the problem you're having is because you're setting a max width for the entire body, and your banner is within the body. This means that your banner will never be able to be larger than the 1263px max-width you specified.

Rather than change the size of the entire body you need to create a wrapper for your content. You also need to create a wrapper for your banner.

Here's some HTML:

<body>

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


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


</body>

and some CSS:

body {width:100%;}

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

.banner-wrapper {
    width:100%;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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