I have a few nested divs on a website I am creating with the Joomla engine. The problem lies mainly in the fact that the plugins themselves nest 2 divs inside my already created div "banner", meaning I do not have access to these two divs. Within them is the small, rectangular image. This image should help you see my issue (I'd post an embedded image but you know, apparently I need 10 rep):

我在使用Joomla引擎创建的网站上有几个嵌套的div。问题主要在于插件本身在我已创建的div“banner”中嵌套2个div,这意味着我无法访问这两个div。其中是一个小的矩形图像。这个图像可以帮助你看到我的问题(我发布了一个嵌入式图像,但你知道,显然我需要10个代表):

http://www.nerfarena.net/SiteImage.PNG

I don't want the banner ad butted against the search bar. But the three nested divs will not increase in height no matter what CSS properties I modify. Even #banner won't budge. They all seem to size themselves to the minimum needed (bottom of the search bar + banner ad's height). I'm looking for a way around this so any suggestions would be really appreciated.

我不希望横幅广告与搜索栏对接。但是无论我修改什么CSS属性,三个嵌套的div都不会增加高度。即使#banner也不会让步。他们似乎都将自己的大小调整到所需的最小值(搜索栏的底部+横幅广告的高度)。我正在寻找解决方案,所以任何建议都会非常感激。

Here is the chunk of the php file where the divs I am concerned about are:

这是php文件的大块,我关心的div是:

`

     <!-- Logo -->
    <div id="logo">

    <?php if ($logo && $logoimage == 1): ?>
        <a href="<?php echo $this->baseurl ?>"><img src="<?php echo htmlspecialchars($logo); ?>"  alt="<?php echo $sitename; ?>" /></a>
    <?php endif; ?>
    <?php if (!$logo || $logoimage == 0): ?>

        <?php if ($sitetitle): ?>
            <a href="<?php echo $this->baseurl ?>"><?php echo htmlspecialchars($sitetitle); ?></a><br/>
        <?php endif; ?>

        <?php if ($sitedescription): ?>
            <div class="sitedescription"><?php echo htmlspecialchars($sitedescription); ?></div>
        <?php endif; ?>

    <?php endif; ?>
    </div>

    <!-- Search -->
    <div id="search">       
        <jdoc:include type="modules" name="position-0" />
    </div>

    <!-- Banner -->
    <div id="banner" style= "text-align: right;">
        <jdoc:include type="modules" name="banner-position" />
    </div> 
</div>

`

1 个解决方案

#1


1

Try using sibling selectors for CSS. Sometimes it helps me fix the alignments of divs.

尝试使用CSS的兄弟选择器。有时它可以帮助我修复div的对齐。

更多相关文章

  1. 如何在离子框架中显示图像标题?
  2. HTML之表格篇——表格的嵌套
  3. 将图像从本地上传到tinyMCE
  4. 嵌入的图像在签名中不显示。
  5. 我似乎无法正确对齐这些图像
  6. 如何使用CSS精灵重复背景图像?
  7. 使用img src加载图像会在Mozilla / Chrome中产生不同的大小
  8. PHP选择具有特定宽度的图像并构建网格
  9. 如何在应用程序中嵌入图像并在HTML控件中使用它们?

随机推荐

  1. 2011.07.20(2)——— android 计算当前坐标
  2. Android——TabWidget(切换卡)
  3. 5 分钟开发一个 AI 检测人体框架的 App
  4. Android_selector背景选择器的用法
  5. android开发笔记之android studio
  6. Android 控件(button)对齐方法实现详解
  7. Epoxy——RecyclerView的绝佳助手
  8. Android中的单任务模式
  9. Kotlin 写 Android 单元测试(四),Robolectri
  10. android 桌面小工具(Widget)开发教程