簡體   English   中英

如何在我的.js文件中使用超贊的標簽

[英]How to use font-awesome tags in my .js file

我想用.js文件中的超棒圖標替換圖像。

我的檔案如下

"</head>"+
"<body bgcolor=\"White\">"+

"<table width=\"100%\" height=\"100%\" cellpadding=0 cellspacing=0 border=0>"+
"<tr height=\"100%\" bgcolor=\"#FFFFFF\"><td valign=top>"+

"<table class=\"clsOTable\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"+
"<tr><td bgcolor=\"#4E4E4E\">\n"+
"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n"+
"<tr>\n "+
"   <td height='60px' align=left bgcolor=\"#4E4E4E\" colspan=\"7\">"+
"<table width=100% height=40 border=\"0\"><tr><td width=50 ><a href=\"dateconsole.jsp?controlname="+

 str_target+"&date="+ dt2dtstr(dt_prev_year)+dt2tmstr(dt_datetime)+"\">"+
 "<img src=\"../images/prevpopyr.gif\" width=\"50px\" height=\"50px\" border=\"0\""+
 " alt=\"previous year\"></a></td><td width=50 ><a href=\"dateconsole.jsp?controlname="+
 str_target+"&date="+ dt2dtstr(dt_prev_month)+dt2tmstr(dt_datetime)+"\">"+
 **"<img src=\"../images/prevpop.gif\**" width=\"50px\" height=\"50px\" border=\"0\""+
 " alt=\"previous month\"></a></td><td align=center ><font color=\"white\" face=\"tahoma, verdana\" size=\"4\">"+
 arr_months[dt_datetime.getMonth()]+" "+dt_datetime.getFullYear()+"</font>+"

我嘗試戴上頭標

<head>

"<link rel='stylesheet' href='<util:getAbsoluteURL URL="css/font-awesome.css" />' type="text/css" media="screen">+"

</head>

並更換

<img src=\"../images/prevpopyr.gif\" width=\"50px\" height=\"50px\" border=\"0\""+
    " alt=\"previous year\">

<i class="fa fa-forward"></i>

真棒字體標簽。

但這行不通嗎? 請提出建議。

您是否嘗試按照有關真棒字體入門的說明進行操作? http://fortawesome.github.io/Font-Awesome/get-started/

嘗試將標頭標記中的鏈接替換為

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">

看看是否可行。 如果是這樣,那么我們知道您的本地css字體位置很棒。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM