好吧我在css和可怕的一些帮助下很糟糕。我知道对于擅长它的人来说这很简单。简单的CSS定位
我收录了我的代码和我一直在尝试的东西,以及它看起来像的几张图片。第一张照片是我的。第二个就是我想要的样子。
HTML
<div class="thumbposter"><img src="http://tipmypicks.com/cssmovie/imdb/imdbImage.php?url=http://ia.media-imdb.com/images/M/[email protected]@._V1._SY200.jpg"/><div class="ratingimage"><h1>Step Brothers</h1><img src="http://tipmypicks.com/cssmovie/images/ratedr.png"></div></div>
<div class="genre"><p>Genre: Comedy</p></div>
<div class="releasedate"><p>Released: 2008</p></div>
<div class="rating"><p>Rating: 6.8</p></div>
<div class="plot"><h1>Plot</h1><p>Two aimless middle-aged losers still living at home are forced against their will to become roommates when their parents get married.</p></div>
CSS
<style>
@font-face
{
font-family: MyriadPro-Regular;
src: url(http://tipmypicks.com/cssmovie/font/MyriadPro-Regular.otf);
}
.thumbposter img
{
margin-top: 50px;
margin-left: 50px;
border:2px solid;
border-color: grey;
border-radius:2px;
}
.thumbposter h1 {
position: absolute;
left: 500px;
top: 60px;
color: white;
font-size:30px;
font-family: MyriadPro-Regular;
}
.releasedate p {
position: absolute;
left: 323px;
top: 295px;
color: white;
font-size:15px;
}
.genre p {
position: absolute;
left: 323px;
top: 315px;
color: white;
font-size:15px;
}
.rating p {
position: absolute;
left: 323px;
top: 275px;
color: white;
font-size:15px;
}
.plot p {
position: absolute;
left: 500px;
top: 170px;
width: 500px;
color: white;
font-size:15px;
}
.trailer a {
position: absolute;
left: 345px;
top: 260px;
color: white;
font-size:17px;
}
.playbutton img {
position: absolute;
left: 325px;
top: 260px;
}
.plot h1 {
position: absolute;
left: 500px;
top: 140px;
color: white;
font-size:22px;
}
.ratingimage img {
position: relative;
left: 500px;
top: 60px;
float:left;
}
@font-face
{
font-family: airstrikebold;
src: url(http://tipmypicks.com/cssmovie/font/airstrikebold.ttf);
}
</style>
我只是想将R旁边去标题......你可以从看到我的代码,我在css上很糟糕,并且对于一切都使用绝对定位,我不能用“R”等级来做到这一点,因为一些标题比其他标题长。有人可以帮帮我吗?
这显然是一种更清洁的方式。滥用绝对位置可能会导致页面在很多情况下中断。 – enguerranws
非常感谢您的回答!我的造型很糟糕,并有一个大脑放屁。这组织的事情要好得多 – drewg23