[英]how to: dynamic navigation bar size depending on dynamic image size?
我的页面上有一张图片占用了 25% 的宽度。 现在我希望它右侧的导航栏与图像具有相同的高度。 我怎么做? 如果可能的话,我更喜欢 CSS 或 JS 解决方案......而且我不想使用桌子......
提前致谢!
PS:导航栏是这个的变体: http://de.selfhtml.org/css/layouts/anzeige/nav_modern.htm
这是主页的一部分:
<style type="text/css">
#Logo {
position: absolute;
margin-left: 20px;
margin-top: 20px;
width: 25%;
border: 2px solid black;
}
#Nav {
position: absolute;
margin-left: 30%;
margin-top: 20px;
}
</style>
</head>
<body text="#000000" bgcolor="#ABECEE" link="#FF0000" alink="#FF0000" vlink="#FF0000">
<img src="xxxxxxxxxxxxxxxxx" id="Logo"></img>
<div id="Nav"><?php include("navi.html"); ?></div>
我不确定我是否正确,但据我了解,您需要图像的滚动条,因此您可以执行以下操作:
<html>
<body>
<div class="myimage">
</div>
</body>
</html>
.myimage
{
background-image: url('to-my-image');
overflow-y: scroll;
/*whatever the width and height of your image*/
height: 40px;
width: 50px;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.