【发布时间】:2016-07-07 22:22:27
【问题描述】:
我正在尝试将 image 标签 class="right-slider" 与 table 标签对齐,与 index.html 下方的图片相同,并且有无论屏幕尺寸如何,它们都会 100% 显示在屏幕上。
有人可以帮助我吗? 谢谢
html {
width: 100%;
height: 100%;
}
body {
font-family: segoe ui light;
width: 100%;
height: 100%;
}
.resources {
width: 1483px;
padding: 2px;
background-color: #e0832c;
color: white;
margin-left: auto;
margin-right: auto;
text-align: center;
transition: all 0.4s ease;
}
.resources:hover {
width: 1498px;
padding: 5px;
font-weight: medium;
}
table {
margin-left: auto;
margin-right: auto;
}
td {
border: none;
height: 120px;
width: 210px;
background-color: #ccc3c3;
color: #f2eaea;
font-size: 20px;
vertical-align: 10px;
transition: all 0.5s ease;
}
td:hover {
width: 210px;
height: 123px;
background-color: #a09a9a;
box-shadow:inset 0px 0px 85px rgba(0,0,0,.3);
-webkit-box-shadow:inset 0px 0px 85px rgba(0,0,0,.3);
-moz-box-shadow:inset 0px 0px 85px rgba(0,0,0,.3);
}
th {
color: white;
background-color: grey ;
padding: 5px;
font-weight: lighter;
font-size: 15px;
}
a {
margin-bottom: 50px;
text-decoration: none;
}
.right-slider {
float: right;
margin: 33 98 0;
position: relative;
}
<html>
<head>
</head>
<body><!--HTML Code-->
<div>
<a href=""><img class="right-slider" src="rightslider.png" height="680px"></a>
</div>
<div class="resources">Resource Assignment</div>
<table>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
<th>Saturday</th>
<th>Sunday</th>
<tr> <!--1st week-->
<td>01</td>
<td>02</td>
<td>03</td>
<td>04</td>
<td>05</td>
<td>06</td>
<td>07</td>
</tr>
<tr> <!--2nd week-->
<td>08</td>
<td>09</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
</tr>
<tr> <!--3rd week-->
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
</tr>
<tr> <!--4th week-->
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
<td>26</td>
<td>27</td>
<td>28</td>
</tr>
<tr> <!--5th week-->
<td>29</td>
<td>30</td>
<td>31</td>
<td>01</td>
<td>02</td>
<td>03</td>
<td>04</td>
</tr>
</table>
</body>
</html>
【问题讨论】:
标签: html css vertical-alignment