CSS:
body {
background: url("ninabg.jpg") left top no-repeat;
background-size: 100% auto;
}
.image {
background-repeat:no-repeat;
background-image:url("logo2fix.png");
position:absolute;
right:1%;
bottom:3%;
height:40%;
width:35%;
}
.slo {
background-repeat:no-repeat;
background-image:url("slo.png");
position:absolute;
width:5%;
bottom:10%;
right:21%;
}
.eng {
background-repeat:no-repeat;
background-image: url("eng.png");
position:absolute;
width:5%;
right:12%;
bottom:10%;
}
HTML:
<!DOCTYPE HTML>
<html>
<head>
<!-- META -->
<title>Nina Rakovec</title>
<meta name="description" content="Profesionalna igralka" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<div class="image"></div>
<div class="eng"></div>
<div class="slo"></div>
</body>
</html>
我的网站只显示背景<div class="image"></div>
,为什么另外两个不是<div class="eng"></div>
and <div class="slo"></div>
显示在我的网站上?
我一无所知,不知道如何解决这个问题,请帮助我..还有另一个问题,我想使用eng
and slo
在我的网站上有两张图片,如果您点击它们,它们就是链接。但我不能使用div
代替a
,我该怎么做?
图像无法正常工作,因为.slo
and .eng
没有高度或内容,因此它们及其背景图像不会出现。给它们两个高度:
.slo {
background-repeat:no-repeat;
background-image:url("slo.png");
position:absolute;
width:5%;
bottom:10%;
right:21%;
height:200px;
display:block
}
.eng {
background-repeat:no-repeat;
background-image: url("eng.png");
position:absolute;
width:5%;
right:12%;
bottom:10%;
height:200px;
display:block;
}
对于你的第二个问题,你可以使用<a>
元素而不是<div>
:
<a href="#" class="eng"></a>
<a href="#" class="slo"></a>
或者使用一个<img>
元素来显示图像。
JSFiddle Demo http://jsfiddle.net/ImagineStudios/J8zhd/6/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)