【发布时间】:2017-03-22 05:16:37
【问题描述】:
我有一些非常简单的 HTML/CSS 代码,无论我做什么,我总是得到 chrome 的“无效属性值”异常,并且 logo 无法正确定位。
修复了第一个问题,但现在图像没有移动相关的边框。
<html lang="de" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>my website</title>
<style type="text/css">
*{ padding: 0; margin: 0; }
.header {
width: 100%;
height: 100px;
border: none;
border-bottom-style: solid;
border-bottom-width: 5px;
position: relative;
border-bottom-color: rgb(220,30,60);
}
.logo {
position: absolute;
padding-bottom:50px;
height: 150%;
width: auto;
}
</style>
</head>
<body>
<div class="header" id="header">
<img id="logo" class="logo" src="image.png"/>
</div>
</body>
</html>
【问题讨论】:
-
50 px应该是50px。 -
是的,已修复,但现在 img 不会移动到与底部边框相关的位置。我想,填充设置距离到 div 的边界?
-
@tagduck 看看我的回答。 stackoverflow.com/a/40489435/1076753
-
您应该使用当前版本编辑您的问题,以及您还缺少什么。如果是两个单独的问题,则应在两个单独的帖子中提出。这个应该关闭,因为一个错字对任何人都没有帮助。
-
1.适当地?我不知道你想做什么。 2.添加一个JSfiddle。