这个问题很容易解释,我只想知道如何使用 CSS 将文本放在两个图像之间。我试过position: absolute;
了,但它没有居中,我试过了,vertical-align: middle;
但它没有做任何事情。这是网站,希望对大家有所帮助。
如果你不明白这个问题,基本上我要问的是如何做到这一点:
-------webpage-------
[IMAGE] [TEXT] [IMAGE]
----- - 网页 - - - -
编辑:似乎人们没有看到我的网站链接,或者他们无法查看源代码。这是 HTML 的代码:
<html>
<head>
<title>
Epileptic Development
</title>
<link rel='stylesheet' type='text/css' href='style.css' />
</head>
<body>
<div id='wrap'>
<center>
<div id="test">
<img id='margin' src='ewd2.png' /><br />
<img id='whale2' src='ewd.png' /><br />
<div id="epileptic">
<h1 id="header">
Epileptic<br /> Development
</h1>
</div>
<div id='p'>
<p>
Welcome to the official Epileptic Development website! <br />We'll be posting our news, games and projects here!
</p>
<p id='subreddit'>
<a href='http://www.reddit.com/r/sonl'>Our official sub reddit</a><br />
</p>
<p id='iTwitter'>
<a href='http://www.twitter.com/doorshaveknobs'>iPoisonxL's Twitter</a><br />
</p>
<p id='MTwitter'>
<a href='http://www.twitter.com/swagmaster63487'>MaXXik's Twitter</a><br />
</p>
<a href='/files/babyheadsmasher.zip'><img id='bhs' src='screen.png' title='Download BABY HEAD SMASHER!!' width='231' height='227' /></a>
<a href='/files/sonl.zip'><img id='sonl' src='sonl.png' title='Download SoNL!!' width='231' height='227' /></a><br />
</div>
</div>
</center>
</div>
</body>
这是图像/文本的 CSS 代码:
#p {
font-family: inc;
font-size: 18;
border: 5px solid black;
border-top: 3px solid black;
border-radius: 15px;
-moz-border-radius: 15px;
margin-top: 0px;
background-color: orange;
margin-bottom: 0px;
padding: 10px;
padding-bottom: 284px;
}
img#margin {
float: left;
margin-left: 40px;
margin-top: 20px;
}
img#whale2 {
float: right;
margin-right: 40px;
}
#bhs {
float: left;
border-radius: 15px;
border: 5px solid black;
margin-left: 15px;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
}
#bhs:hover {
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
-moz-filter: grayscale(0%);
-ms-filter: grayscale(0%);
-o-filter: grayscale(0%);
}
#sonl {
float: right;
border-radius: 15px;
border: 5px solid black;
margin-right: 15px;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
}
#sonl:hover {
filter: grayscale(0%);
-webkit-filter: grayscale(0%);
-moz-filter: grayscale(0%);
-ms-filter: grayscale(0%);
-o-filter: grayscale(0%);
}
#subreddit {
}
注意:我只放了相关的CSS。