2014-01-29 27 views
0

我正在努力將個人網站放在一起,但是我現在堅持嘗試將我的社交媒體圖標置於我的標題中對齊。請參見下面的什麼,我有個大氣壓:在網頁的標題中整理文字和社交媒體圖標

enter image description here

文字和Facebook的圖標沿着我的頭的底部對齊,但是我想在整個頭部中間的文字和之間的空間中的位置圖標的頂部和底部相同,以便它出現在中心。誰能幫我這個?

謝謝

忘記添加代碼,有點此刻凌亂:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/> 
<title> Chilun</title> 
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> 
<style type="text/css"> 
@font-face /* support for browsers & IE v10 onwards*/ 
{font-family:homefont; src: url("Juice.ttf");} 
{font-family:headerfont; src: url("playball.ttf");} 
body {background:url('img/mybackground1.jpg') no-repeat center center fixed;} 
<!-- Make Header Sticky --> 
#header_container {background:#00E5EE; border:0px solid #666; height:60px; left:0; position:fixed; width:100%; top:0;} 
#header{line-height:60px; margin:0 auto; width:940px; text-align:center;display:inline-block; float:right; padding:15px;} 
#wrapper{width:900px;margin:0 auto;} 
a{color:#444;} 
.logo{margin-left:600px;margin-top:100px;background:#fff;padding:10px;} 
.bigtitle{font-family: homefont; font-size:100px; color:#FF0000; text-transform:uppercase; text-align:center; margin-top:200px;} 
.header{font-family: headerfont; font-size:20px; color:#FFFFFF; text-align: left; font-style:italic;} 
</style> 
</head> 
<body> 

<div id="header_container"> 
    <div id="header"><p class="header"> Follow me on: <a style="padding:5; margin:0; href="https://www.facebook.com/chilunliuTheBOSSE"; View my Facebook Profile</a><img src="/img/facebook-lnk.gif" width="40" height="40"></div></p> 
</div> 
    <div id="wrapper"> 
     <h1 class="bigtitle"> Chilun Liu</h1> 
    </div> 

</body> 
</html> 
+2

在這種情況下,一個圖片是不是字千言萬語。發佈一些代碼。 – j08691

+0

對不起,我忘了這麼做。已添加代碼 – user1283674

回答

1

在CSS中,選擇包含圖標和文字(即div.facebookicon)的div和使用標準css格式(facebookicon.div {--css here--}。使用命令text-align:center;將它們橫向居中。接下來,使用填充和邊距(即padding:10px;)來獲取(集中在頭部中間)

編輯:我注意到d你使用了text-align:left;這就是爲什麼它被推到左邊那樣。你可以額外嘗試這樣的事情:

.className{ 
width:300px; 
height:200px; 
position:absolute; 
left:50%; 
top:50%; 
margin:-100px 0 0 -150px; 
} 

(實驗細節)

+0

感謝大鮑勃,將對此進行調查。 – user1283674