我有两个问题,所以我只想在一篇文章中问他们。我的悬停不会覆盖整个物体。如您所见:http://st358373.cmd16c.cmi.hanze.nl/epw/index.php<白色部分不包括整部电影海报。我不知道如何解决这个问题。也许这是一个简单的解决方案,但我似乎无法找到它。
其次,我的页脚不是100%宽度。我也不知道如何解决这个问题。我希望你们能帮助我。
<center><table width="600" border="0" cellpadding="0" cellspacing="5"><tbody align="center">
<div><tr><td><div style="width: 200px; height:296px; margin-top: 50px">
<div class="image-hover">
<img src="images/thor.jpg" width="200px" height="296px"/>
<span class="desc"><div class="filmtitle">Thor: Ragnarök</div>
<div style="font-size:8px; text-transform:uppercase; color:#000;">
<div class="black"><div class="filmdiscription"><b>SUMMARY: </b> Thor is imprisoned on the other side of the universe without his mighty hammer and finds himself in a race against time to get back to Asgard to stop Ragnarok, the destruction of his homeworld and the end of Asgardian civilization, at the hands of an all-powerful new threat, the ruthless Hela. But first he must survive a deadly gladiatorial contest that pits him against his former ally and fellow Avenger the Incredible Hulk!<br><br>
<b>Genre: </b><br><br><center> <!--Genre ophalen uit de Database-->
</span>
</div></div>
</div></div></td>
CSS:
#title {
background-color: black;
color: #FFFFFF;
font-family: Raleway;
font-size: 9px;
height: 50px;
letter-spacing: 5px;
line-height: 55px;
padding-bottom: 5px;
text-transform: uppercase;
width: 1019px;
margin-top: 20px;
}
.container div {
display: none;
}
.container:hover div {
display: block;
}
.filmtitle {
height: 20px;
padding-bottom: 0px;
text-transform: uppercase;
letter-spacing: 3px;
background-color: #000;
color:#fff;
font-size: 7px;
line-height: 20px;
font-family: raleway;
}
.filmdiscription {
font-family: calibri;
font-size: 8px;
letter-spacing: 1px;
line-height: 120%;
text-transform: uppercase;
text-align: justify;
padding: 15px;
color: rgb(255, 255, 255);
vertical-align: middle;
}
.black {
height: 240px;
background-color: #000000;
vertical-align: middle;
margin-bottom: 9px;
padding-top: 19px;
}
.image-hover>span {
width:180px;
height:276px;
display: block;
margin-top: -296px; background-color: white; padding: 10px;
-webkit-transition: .4s ease-in-out opacity;
-moz-transition: .4s ease-in-out opacity;
-o-transition: .4s ease-in-out opacity;
transition: .4s ease-in-out opacity;
opacity: 0;
}
.image-hover:hover>span {
opacity: 0.9;
}
页脚:
<footer>
<div class="footertekst">© 2017 Nienke. Rechten voorbehouden.</div>
</footer>
CSS:
html {
position: relative;
min-height: 100%;
}
body {
margin: 0 0 100px; /* bottom = footer height */
max-width: 100%;
padding: 0;
}
.footertekst {
text-align: center;
color: white;
font-size: 12px;
font-weight: 100;
font-family: 'Roboto', serif;
letter-spacing: 0.5px;
margin-top: 50px;
}
footer {
position: absolute;
left: 0;
bottom: 0;
height: 100px;
width: 100%;
font-family: 'Roboto', sans-serif;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#619b28+0,427768+100 */
background: #619b28; /* Old browsers */
background: -webkit-linear-gradient(left, #619b28 0%, #427768 100%);
background: -o-linear-gradient(left, #619b28 0%, #427768 100%);
background: linear-gradient(to right, #619b28 0%, #427768 100%); /* FF3.6-15 */
/* Chrome10-25,Safari5.1-6 */
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#619b28', endColorstr='#427768',GradientType=1 ); /* IE6-9 */
}
答案 0 :(得分:0)
对于您的第一个问题,请对CSS进行以下更改:
.image-hover>span {
width: 180px;
height: 274px;
display: block;
margin-top: -299px;
background-color: white;
padding: 9px 10px 13px 10px;
-webkit-transition: .4s ease-in-out opacity;
-moz-transition: .4s ease-in-out opacity;
-o-transition: .4s ease-in-out opacity;
transition: .4s ease-in-out opacity;
opacity: 0;
}
对于第二个问题,它实际上是由您的导航栏引起的。添加最后两行:
ul.topnav {
list-style-type: none;
margin: 0;
top: 0;
left: 0;
overflow: hidden;
font-family: 'Raleway', sans-serif;
font-weight: 500;
text-align: center;
width: 100%;
position: absolute;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#619b28+0,427768+100 */
background: #619b28; /* Old browsers */
background: -webkit-linear-gradient(left, #619b28 0%, #427768 100%);
background: -o-linear-gradient(left, #619b28 0%, #427768 100%);
background: linear-gradient(to right, #619b28 0%, #427768 100%); /* FF3.6-15 */
/* Chrome10-25,Safari5.1-6 */
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#619b28', endColorstr='#427768',GradientType=1 ); /* IE6-9 */
right: 0px;
padding-left: 0px;
}
这是您的整个css文件,其中包含所做的更改:
@charset "UTF-8";
/* CSS Document */
html {
position: relative;
min-height: 100%;
}
body {
margin: 0 0 100px; /* bottom = footer height */
max-width: 100%;
padding: 0;
}
ul.topnav {
list-style-type: none;
margin: 0;
top: 0;
left: 0;
overflow: hidden;
font-family: 'Raleway', sans-serif;
font-weight: 500;
text-align: center;
width: 100%;
position: absolute;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#619b28+0,427768+100 */
background: #619b28; /* Old browsers */
background: -webkit-linear-gradient(left, #619b28 0%, #427768 100%);
background: -o-linear-gradient(left, #619b28 0%, #427768 100%);
background: linear-gradient(to right, #619b28 0%, #427768 100%); /* FF3.6-15 */
/* Chrome10-25,Safari5.1-6 */
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#619b28', endColorstr='#427768',GradientType=1 ); /* IE6-9 */
right: 0px;
padding-left: 0px;
}
ul.topnav li {display: inline-block;
}
ul.topnav li a {
display: inline-block;
color: #ffffff;
text-align: center;
padding: 14px 16px;
text-decoration: none;
transition: 0.3s;
font-size: 10px;
letter-spacing: 2px;
}
ul.topnav li a:hover {background-color: #000000;}
ul.topnav li.icon {display: none;}
body{
color:#666666;
background-color:white;
background-position:top left;
background-repeat: no-repeat;
background-attachment:fixed;
font-family:arial;
font-size:11px;
line-height: 130%;
text-align:justify;
}
a:link, a:active, a:visited{
color: #000;
text-decoration: none;
}
a:hover{
color:#000;
text-decoration: none;
}
#title {
background-color: black;
color: #FFFFFF;
font-family: Raleway;
font-size: 9px;
height: 50px;
letter-spacing: 5px;
line-height: 55px;
padding-bottom: 5px;
text-transform: uppercase;
width: 1019px;
margin-top: 20px;
}
.container div {
display: none;
}
.container:hover div {
display: block;
}
.filmtitle {
height: 20px;
padding-bottom: 0px;
text-transform: uppercase;
letter-spacing: 3px;
background-color: #000;
color:#fff;
font-size: 7px;
line-height: 20px;
font-family: raleway;
}
.filmdiscription {
font-family: calibri;
font-size: 8px;
letter-spacing: 1px;
line-height: 120%;
text-transform: uppercase;
text-align: justify;
padding: 15px;
color: rgb(255, 255, 255);
vertical-align: middle;
}
.black {
height: 240px;
background-color: #000000;
vertical-align: middle;
margin-bottom: 9px;
padding-top: 19px;
}
.image-hover>span {
width: 180px;
height: 274px;
display: block;
margin-top: -299px;
background-color: white;
padding: 9px 10px 13px 10px;
-webkit-transition: .4s ease-in-out opacity;
-moz-transition: .4s ease-in-out opacity;
-o-transition: .4s ease-in-out opacity;
transition: .4s ease-in-out opacity;
opacity: 0;
}
.image-hover:hover>span {
opacity: 0.9;
}
h1
{
font-family: 'Oswald', sans-serif;
font-size: 30px;
text-transform: uppercase;
color: #274E89;
}
.contacttext {
font-family: 'Oswald', sans-serif;
color: #1F1D1D;
margin-top: -40px;
}
/* Centres the page (this could be container)*/
.body {
display:block;
margin:0 auto;
width:576px;
font-family: 'Muli', sans-serif;
font-size: 16px;
color: #999;
position: relative;
margin-top: 150px;
padding-bottom: 50px;
}
/* Labels are titles for the text fields. You can use a placeholder instead if you like*/
label
{
display:block;
margin-top:20px;
letter-spacing:2px;
}
/* Centres the form within the page */
form
{
margin:0 auto;
width:459px;
}
/* Styles the text boxes */
input, textarea, file {
width:439px;
height:27px;
background-color:#efefef;
border-radius:5px;
-moz-border-radius:5px;
-webkit-border-radius:5px;
border:1px solid #dedede;
padding:10px;
margin-top:3px;
font-size:0.9em;
color:#3a3a3a;
}
input:focus, textarea:focus {
border:1px solid #97d6eb;
}
/* Styles the text area boxes (message field) */
textarea
{
height:213px;
background-color: #efefef;
}
/* Styles the submit button */
#submit {
/* background:url(images/submit.png); */
width:127px;
height:48px;
text-align: center;
/* text-indent:-9999px; */
border:none;
margin-top:20px;
cursor:pointer;
}
/* Styles the submit hover */
#submit:hover {
color:#fff;
background-color: #216182;
opacity:0.9;
}
/* Styles the cancel button*/
#cancel {
/* background:url(images/cancel.png); */
width:127px;
height:28px;
text-align: center;
/* text-indent:-9999px; */
border:none;
margin-top:20px;
cursor:pointer;
}
/* Styles the cancel hover */
#cancel:hover {
color:#fff;
background-color: #000;
opacity:0.9;
}
.footertekst {
text-align: center;
color: white;
font-size: 12px;
font-weight: 100;
font-family: 'Roboto', serif;
letter-spacing: 0.5px;
margin-top: 50px;
}
p.contacttext {
padding-top: 50px;
padding-right: 10px;
font-weight: 100;
font-size: 12px;
}
#main {
width:960px;
margin:50px auto;
font-family:raleway;
text-align: center;
}
span {
color:red
}
h2 {
background-color: white;
text-align:center;
border-radius:10px 10px 0 0;
margin:-10px -40px;
padding:15px
}
hr {
border:0;
border-bottom:1px solid #ccc;
margin:10px -40px;
margin-bottom:30px
}
#login {
width:600px;
display: inline-block;
border-radius:10px;
font-family:raleway;
border:2px solid #ccc;
padding:10px 40px 25px;
margin-top:70px;
}
input[type=text],input[type=password] {
width:100%;
padding:10px;
margin-top:8px;
border:1px solid #ccc;
padding-left:5px;
font-size:16px;
font-family:raleway
}
input[type=submit] {
width:103.5%;
background-color: #2F8059;
color:#fff;
border:2px solid #2F8059;
padding:10px;
font-size:20px;
cursor:pointer;
border-radius:5px;
margin-bottom:15px;
height: 50px;
}
input{
text-align:center;
}
label {
display: block;
text-align: center;
line-height: 150%;
font-size: .85em;
}
#con {
margin-top: 50px;
}
.links {
text-align: center;
margin-bottom: 20px;
text-transform: uppercase;
font-family: 'Raleway', sans-serif;
}
a {
color:#000;
text-decoration:none;
}
a:hover {
text-decoration:underline;
}
footer {
position: absolute;
left: 0;
bottom: 0;
height: 100px;
width: 100%;
font-family: 'Roboto', sans-serif;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#619b28+0,427768+100 */
background: #619b28; /* Old browsers */
background: -webkit-linear-gradient(left, #619b28 0%, #427768 100%);
background: -o-linear-gradient(left, #619b28 0%, #427768 100%);
background: linear-gradient(to right, #619b28 0%, #427768 100%); /* FF3.6-15 */
/* Chrome10-25,Safari5.1-6 */
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#619b28', endColorstr='#427768',GradientType=1 ); /* IE6-9 */
}