2016-02-26 37 views
-2

因此很明顯,在CSS3,有一個CSS命令是這樣我如何添加文本陰影與CSS2

text-shadow: 10px 10px 5px #color; 

它創建的文本陰影。

它在CSS中不起作用。

那麼我該如何在CSS中製作陰影?

這是我

.Stuff{ 
    text-shadow: 5px 5px 2px #000; 
} 

編輯:在這一點上,我想我會透露我的整個程序。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Document</title> 
<style type="text/css"> 

.TitleMotto { 
    font-family: "Parry Hotter"; 
    font-size: 36px; 
    font-style: normal; 
    line-height: single; 
    text-transform: none; 
    background-color: #F00; 
    color: #CF0 
    text-shadow: 5px 5px 2px #000; 

} 
.Motto { 
    font-family: "Parry Hotter"; 
    font-size: 24px; 
    font-style: normal; 
    line-height: single; 
    text-transform: none; 
    background-color: #F00; 
    color: #CF0 
} 
</style> 
</head> 

<body><table width="815" border="1"> 
    <tr> 
    <td width="281" height="104"><img src="file:///E|/Business Project/Business_Logo (2).jpg" width="299" height="172" alt="Logo" /></td> 
     <td width="518" class="Motto"><center> 
      <div class="TitleMotto">Stuff</div> 
      <p>Stuff</p> 
     </center></td> 
     </tr> 
     <tr> 
     <td height="543">&nbsp;</td> 
     <td>&nbsp;</td> 
     </tr> 
    </table> 

    </body> 

PS:圖像不會顯示。

+1

你想要爲ie7設計一些東西嗎? – Aaron

+0

@Aaron在Dreamweaver中做它。 – bleh

+0

但你打算在現代瀏覽器中打開它? – Aaron

回答

1

你的代碼工作正常。您不需要指定您使用的CSS類型,而不像HTML瀏覽器讀取CSS或忽略它。

在您的瀏覽器中預覽?

單擊下面的運行代碼按鈕。

.stuff {text-shadow: 5px 5px 2px #000;}
<p class="stuff">text with a shadow</p>

修訂

通過添加完整的CSS代碼,我可以看到你缺少一個右分號。

color: #CF0; // ADD YOUR CLOSING SEMI-COLON HERE 
text-shadow: 5px 5px 2px #000; 
+0

我應該說我正在使用.text和調用類,不使用上面顯示的東西。 – bleh

+0

看我的編輯,它應該很清楚。 – bleh

+0

查看我的新評論。 –