2014-12-02 39 views
0

這是我有:地格邊界盈(固定顯示)

enter image description here

不過,我希望文字下方的陰影不會出現在邊框的頂部。當標題的「位置」設置爲「絕對」或「固定」以外的任何其他位置時,我可以得到這種效果,但我在動畫中失去了靈活性......這是我以後想要做的。

這裏是我的代碼:

.feature { 
height: 300px; 
width: 100%; 
background-image: url("http://conceptartworld.com/wp-content/uploads/2013/06/The_Last_of_Us_Concept_Art_Crows_JS-01.jpg"); 
background-size: cover; 
background-repeat: no-repeat; 
overflow: hidden; 
border-bottom: solid 5px #FFFFFF; 
box-shadow: 0 2px 10px #333; 
} 

.feature h1 { 
position: fixed; 
font-size: 120px; 
vertical-align: text-bottom; 
color: #FFFFFF; 
margin-left: 50px; 
font-family: "oswald", sans-serif; 
font-weight: 400; 
text-transform: uppercase; 
text-shadow: 4px 4px 5px rgba(0,0,0,0.5); 
transition: margin 0.5s; 
} 

#moral { 
margin-top: 160px; 
} 

#studios { 
margin-top: 160px; 
margin-left: 400px; 
} 

也......我的垂直對齊文本的底部是不工作...這就是爲什麼我使用的上邊距..誰能告訴我爲什麼?

阿爾曼

+0

我想你不能使邊界線成爲一個獨立的元素,這種效果。將其作爲


實施,並將其設置爲大於文本的z-index。 – 2014-12-02 10:54:43

+0

做了詭計。謝謝。 – 2014-12-02 11:32:20

+0

你可以發佈這個答案嗎? – 2014-12-10 08:14:10

回答

0

我認爲你不能做這樣的效果,而不使邊界線的獨立元素。 將它實現爲<hr/>並將其設置爲大於文本的z-index。