css問題

想詢問大家~~就是我在drupal中在改樣式,然後想隱藏連結文字改為圖片顯示~但是呢~
在firefox顯示下是正常
但在ie顯示下就秀不出圖片只秀出了連結文字~

.icon_img a{
font-size:0;
text-indent:-9999px;
display: block;
width: 105px;
height: 46px;
background: url('../images/spc_movie.png') ;
}

或使再加上在ie下還是顯示不出來
line-height:0;

jesselue 的照片

Re: css問題

由.icon_img看來spc_movie.png是個icon,之前做favicon時遇到過ff ok ie不行,結果用.ico file,ie就ok了。可去下載icoFX,將spc_movie.png轉成.ico file再試試。

Kay.L 的照片

Re: css問題

沒有完整程式碼,不好猜。

是不是你剛好沒有清除 CACHE,其實是讀不出圖片來 ?

題外話:
font-size:0; 是沒必要的
其次用 em 比 px 更好
text-indent:-999em

我還會增加 no-repeat
background: url('../images/spc_movie.png') no-repeat;

---
notaBlueScreen | 訂閱RSS | Plurk | twitter

貝努鳥 的照片

Re: css問題

kay.L

因為我去改了upload的模組
--模組程式--

  $href = file_create_url($file->filepath);
$text = $file->description ? $file->description : $file->filename;
$icon = t(PowerCam);------->這裡我多一個字串叫(PowerCam)
#echo "<script>alert('$href, $text');</script>";
$piece=explode("/",$href);
$theflename=$piece[count($piece)-1];
$thedirname_extra=filenameRemoveExtensionName($text);
if(okFileType($theflename)==".zip")
{
   $thedirname=filenameRemoveExtensionName($theflename);
   $href="";
   for($i=0; $i<(count($piece)-1); $i++) $href.=$piece[$i]."/";
   $href.=$thedirname."/".$thedirname_extra."/index.html";
}
$icon = check_plain($icon);
$rows[] = array(l('<div class="icon_img">'.$icon, $href, array('html' => TURE)).'</div>', format_size($file->filesize));  -->在這裡啊~就想文字取代圖片~~但覺得在ie7和ie8這種作法好像是CSS以圖取代文字是失效的~~

--css語法----------------------------------------------------------------------------------------------

.icon_img a{
/*text-indent: -3000px;*/
display:block;
font-size:0em;
line-height:0;
text-indent:-999em
width: 105px;
height: 46px;
background: url('../images/spc_movie.png')no-repeat; ;
}

-------------------------------------------------------------------------------------------

布施如播種,以歡喜心滋潤種子,才會發芽 (靜思語錄)

Kay.L 的照片

Re: css問題

看上去沒問題, 可能是其他的CSS影響了

可以試試

.icon_img {
width: 105px;
height: 46px;
background: url('../images/spc_movie.png') ;
}
.icon_img a { text-indent:-999em; display: block;}

你都改了內容,但為什麼不直接用圖片算了 ??

---
notaBlueScreen | 訂閱RSS | Plurk | twitter

RSS feed