html - 图像高度到另一个 div

标签 html css image height

我是 Stackoverflow 的新手,我需要帮助解决这些问题。

所以问题是:我希望这个虚线图像的高度达到容器的 100%。

enter image description here

HTML

<div id="test1">

</div>

<aside>
    <?php
    if (logged_in() === true) {
        include 'includes/widgets/loggedin.php';
    } else {
        include 'includes/widgets/login.php';
    }
    include 'includes/widgets/user_count.php';
    include 'includes/widgets/sponsors.php';
    include 'includes/widgets/partners.php';

    ?>
</aside>

CSS

aside {
    width:260px;
    float:right;
    background-image:url(../images/dashed.png);
    background-repeat: repeat-y;
    padding-left:15px;
}

#container, footer {
    background:#fff;
    width:1100px;
    margin:0 auto;
    padding:20px;
}

#test1 {
height:1000px;
}

谁能帮帮我?

最佳答案

试试这个:

aside { 
  background: url(images/bg.jpg) repeat-y center center fixed; 
  padding-left:15px;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

关于html - 图像高度到另一个 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27049705/

相关文章:

javascript - 为什么 javascript 看不到 style.filter 属性?

silverlight - 在WP7中显示图像控件的加载进度

html - 在表单中排列字段

html - CSS 不选择子元素

javascript - 在控制台中显示更改 slider 值

css定位问题

html - 垂直居中两个内联 block 元素

html - 显示外框的 UL 子弹

java - 如何在绘画中使用graphics2D或者有更好的方法来做到这一点?

android - 在 android 的 listView 中单击它时更改按钮的图像