html - Joomla 使模块全宽

标签 html css joomla

我想在 joomla 3.4.3 全宽中获得一个模块。

比如我有一张图片,应该满页都是。 如果我将它设置为

width="100%"

它只占用任何文章通常使用的所有空间,所以左右两边都有空白。其他一些模块,例如幻灯片,通常使用整个宽度。

我怎样才能像这些模块一样使用所有空间?

编辑: 我加了

<div style="margin-left:0px";"padding-left:0px";"margin-right:0px";"padding-right:0px">
    <img src="images/slides/1.jpg" style="width:100%"/>
</div>

这并没有改变任何东西。 图片是一个占位符,稍后会有一个谷歌地图,为什么我把 div 放在里面。

索引.php:

<?php
/**
* @version   $Id: index.php 26163 2015-01-27 17:11:55Z james $
* @author    RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC
* @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 *
 * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
 *
 */

/* No Direct Access */
defined( '_JEXEC' ) or die( 'Restricted index access' );
/* Load Mootools */
JHTML::_('behavior.framework', true);
/* Load and Inititialize Gantry Class */
require_once(dirname(__FILE__) . '/lib/gantry/gantry.php');
$gantry->init();
/* Get the Current Preset */
$gpreset = str_replace(' ','',strtolower($gantry->get('name')));
?>
<!doctype html>
<html xml:lang="<?php echo $gantry->language; ?>" lang="<?php echo $gantry->language;?>" >
<head>
<?php if ($gantry->get('layout-mode') == '960fixed') : ?>
    <meta name="viewport" content="width=960px">
<?php elseif ($gantry->get('layout-mode') == '1200fixed') : ?>
    <meta name="viewport" content="width=1200px">
<?php else : ?>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php endif; ?>
<?php /* Head */
    $gantry->displayHead();
?>
<?php /* Force IE to Use the Most Recent Version */ if ($gantry->browser->name == 'ie') : ?>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<?php endif; ?>

<?php
    $gantry->addLess('bootstrap.less', 'bootstrap.css', 6);
    if ($gantry->browser->name == 'ie'){
        if ($gantry->browser->shortversion == 8){
            $gantry->addScript('html5shim.js');
            $gantry->addScript('canvas-unsupported.js');
            $gantry->addScript('placeholder-ie.js');
        }
        if ($gantry->browser->shortversion == 9){
            $gantry->addInlineScript("if (typeof RokMediaQueries !== 'undefined') window.addEvent('domready', function(){ RokMediaQueries._fireEvent(RokMediaQueries.getQuery()); });");
            $gantry->addScript('placeholder-ie.js');
        }
    }
    if ($gantry->get('layout-mode', 'responsive') == 'responsive') $gantry->addScript('rokmediaqueries.js');
?>
</head>
<body <?php echo $gantry->displayBodyTag(); ?>>
    <div id="rt-page-surround">
        <div class="rt-pagesurround-overlay">
            <div id="rt-body-surround">
                <?php /** Begin Header **/ if ($gantry->countModules('header')) : ?>
                <div id="rt-header">
                    <div class="rt-container">
                        <div class="rt-flex-container">
                            <?php echo $gantry->displayModules('header','standard','standard'); ?>
                            <div class="clear"></div>
                        </div>
                    </div>
                </div>
                <div class="rt-header-fixed-spacer"></div>
                <?php /** End Header **/ endif; ?>
                <?php /** Begin Slideshow **/ if ($gantry->countModules('slideshow')) : ?>
                <div id="rt-slideshow">
                    <div class="rt-bg-overlay">
                        <?php echo $gantry->displayModules('slideshow','basic','standard'); ?>
                        <div class="clear"></div>
                        <a class="rt-slideshow-scrollbottom" href="#rt-head-anchor" data-scroll><span class="rt-bottom-arrow"></span></a>
                    </div>
                </div>
                <?php /** End Slideshow **/ endif; ?>

                <?php /** Begin Head Anchor **/ ?>
                <div id="rt-head-anchor"></div>
                <?php /** End Head Anchor **/ ?>

                <?php /** Begin TopFullWidth **/ if ($gantry->countModules('topfullwidth')) : ?>
                <div id="rt-topfullwidth">
                    <?php echo $gantry->displayModules('topfullwidth','basic','standard'); ?>
                    <div class="clear"></div>
                </div>
                <?php /** End TopFullWidth **/ endif; ?>
                <?php /** Begin Header Surround **/ if ($gantry->countModules('drawer') or $gantry->countModules('top') or $gantry->countModules('showcase')) : ?>
                <header id="rt-header-surround">
                    <div class="rt-bg-overlay">
                        <?php /** Begin Drawer **/ if ($gantry->countModules('drawer')) : ?>
                        <div id="rt-drawer">
                            <div class="rt-container">
                                <div class="rt-flex-container">
                                    <?php echo $gantry->displayModules('drawer','standard','standard'); ?>
                                    <div class="clear"></div>
                                </div>
                            </div>
                        </div>
                        <?php /** End Drawer **/ endif; ?>
                        <?php /** Begin Top **/ if ($gantry->countModules('top-')) : ?>
                        <div id="rt-top">
                            <div class="rt-container">
                                <div class="rt-flex-container">
                                    <?php echo $gantry->displayModules('top-','standard','standard'); ?>
                                    <div class="clear"></div>
                                </div>
                            </div>
                        </div>
                        <?php /** End Top **/ endif; ?>

                        <?php /** Begin Showcase **/ if ($gantry->countModules('showcase')) : ?>
                        <div id="rt-showcase">
                            <div class="rt-container">
                                <div class="rt-flex-container">
                                    <?php echo $gantry->displayModules('showcase','standard','standard'); ?>
                                    <div class="clear"></div>
                                </div>
                            </div>
                        </div>
                        <?php /** End Showcase **/ endif; ?>
                    </div>
                </header>
                <?php /** End Header Surround **/ endif; ?>

                <?php /** Begin Main Section **/ ?>
                <section id="rt-mainbody-surround">
                    <?php /** Begin Breadcrumbs **/ if ($gantry->countModules('breadcrumb')) : ?>
                    <div id="rt-breadcrumbs">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('breadcrumb','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Breadcrumbs **/ endif; ?>
                    <?php /** Begin Feature **/ if ($gantry->countModules('feature')) : ?>
                    <div id="rt-feature">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('feature','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Feature **/ endif; ?>
                    <?php /** Begin Utility **/ if ($gantry->countModules('utility')) : ?>
                    <div id="rt-utility">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('utility','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Utility **/ endif; ?>
                    <?php /** Begin Expanded Top **/ if ($gantry->countModules('expandedtop')) : ?>
                    <div id="rt-expandedtop">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('expandedtop','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Expanded Top **/ endif; ?>
                    <?php /** Begin Main Top **/ if ($gantry->countModules('maintop')) : ?>
                    <div id="rt-maintop">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('maintop','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Main Top **/ endif; ?>
                    <?php /** Begin Main Body **/ ?>
                    <div id="rt-mainbody-wrapper">
                        <div class="rt-container">
                            <?php echo $gantry->displayMainbody('mainbody','sidebar','standard','standard','standard','standard','standard'); ?>
                        </div>
                    </div>
                    <?php /** End Main Body **/ ?>
                    <?php /** Begin Main Bottom **/ if ($gantry->countModules('mainbottom')) : ?>
                    <div id="rt-mainbottom">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('mainbottom','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Main Bottom **/ endif; ?>
                    <?php /** Begin Expanded Bottom **/ if ($gantry->countModules('expandedbottom')) : ?>
                    <div id="rt-expandedbottom">
                        <div class="rt-bg-overlay">
                            <div class="rt-container">
                                <div class="rt-flex-container">
                                    <?php echo $gantry->displayModules('expandedbottom','standard','standard'); ?>
                                    <div class="clear"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Expanded Bottom **/ endif; ?>
                </section>
                <?php /** End Main Section **/ ?>

                <?php /** Begin FullWidth **/ if ($gantry->countModules('fullwidth')) : ?>
                <div id="rt-fullwidth">
                    <?php echo $gantry->displayModules('fullwidth','basic','standard'); ?>
                    <div class="clear"></div>
                </div>
                <?php /** End FullWidth **/ endif; ?>

                <?php /** Begin Footer Section **/ if ($gantry->countModules('extension') or $gantry->countModules('bottom') or $gantry->countModules('footer') or $gantry->countModules('copyright')) : ?>
                <footer id="rt-footer-surround">
                    <?php /** Begin Extension **/ if ($gantry->countModules('extension')) : ?>
                    <div id="rt-extension">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('extension','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Extension **/ endif; ?>
                    <?php /** Begin Bottom **/ if ($gantry->countModules('bottom')) : ?>
                    <div id="rt-bottom">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('bottom','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Bottom **/ endif; ?>
                    <?php /** Begin Footer **/ if ($gantry->countModules('footer')) : ?>
                    <div id="rt-footer">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('footer','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Footer **/ endif; ?>
                    <?php /** Begin Copyright **/ if ($gantry->countModules('copyright')) : ?>
                    <div id="rt-copyright">
                        <div class="rt-container">
                            <div class="rt-flex-container">
                                <?php echo $gantry->displayModules('copyright','standard','standard'); ?>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                    <?php /** End Copyright **/ endif; ?>
                </footer>
                <?php /** End Footer Surround **/ endif; ?>
            </div>

            <?php /** Begin Debug **/ if ($gantry->countModules('debug')) : ?>
            <div id="rt-debug">
                <div class="rt-container">
                    <div class="rt-flex-container">
                        <?php echo $gantry->displayModules('debug','standard','standard'); ?>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
            <?php /** End Debug **/ endif; ?>

            <?php /** Begin Analytics **/ if ($gantry->countModules('analytics')) : ?>
            <?php echo $gantry->displayModules('analytics','basic','basic'); ?>
            <?php /** End Analytics **/ endif; ?>

            <?php /** Popup Login and Popup Module **/ ?>
            <?php echo $gantry->displayModules('login','login','popup'); ?>
            <?php echo $gantry->displayModules('popup','popup','popup'); ?>
            <?php /** End Popup Login and Popup Module **/ ?>
        </div>
    </div>

    <?php if ($gantry->countModules('slideshow')) : ?>
    <script>
        (function(){
            var width, height = true;

            function initHeader() {
                width = window.innerWidth;
                height = window.innerHeight;

                largeHeader = document.getElementById('rt-slideshow');
                largeHeader.style.height = height+'px';

                document.getElementById('sprocket-features-img-list').style.height= height+'px';

            }

            // Main
            initHeader();
        })();
    </script>
    <?php endif; ?>

</body>
</html>
<?php
$gantry->finalize();
?>

最佳答案

宽度将指的是它所在的任何容器的宽度。所以你需要编写你的 css,以便它在它所在的任何容器的上下文中工作(你的问题不清楚)。幻灯片放映须知 <div id="rt-slideshow"> <div class="rt-bg-overlay">您可以尝试添加这些并看看会发生什么,它可能是自 'bg-overlay' 以来的第二个听起来很有希望。 – Elin 8 小时前

关于html - Joomla 使模块全宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31287124/

相关文章:

javascript - 如何检查焦点上的每个输入

div 类中的 PHP 变量

css - Joomla 在文章中添加 &lt;style&gt;

php - Joomla 3.0 组件 JS 后端错误

oracle - joomla 2.5 - 不同服务器连接中的oracle数据库

javascript - 在用户点击时,将一段 javascript 加载到页面中

html - 在发送到 sql 服务器之前从 html 输入元素中提取值

html - 2 div float 但高度相同

更改浏览器窗口的分辨率大小时,CSS 媒体查询不起作用

css - 为什么在 html 和 body 上都设置 `overflow`?