下载好的字体 用attr为什么无法导入呢??求大神!!

<!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" />

<meta http-equiv="X-UA-Compatible" content="IE-edge,chrome=1" />

<meta name="viewport" content="width=device-width, initial-scale=1" />

<link type="text/css" rel="stylesheet" href="stylesheets/screen.css" />

<title>Untitled Document</title>

<style type="text/css">

@font-face {

  font-family: "raphaelicons";

  src: url('../fonts/raphaelicons-webfont.eot');

  src: url('../fonts/raphaelicons-webfont.eot#iefix') format('embedded-opentype'), url('../fonts/raphaelicons-webfont.ttf') format('truetype'), url('../fonts/raphaelicons-webfont.woff') format('woff'), url('../fonts/raphaelicons-webfont.svg') format('svg');

}

@font-face {

  font-family: "Flaticon";

  src: url('../fonts/Flaticon.eot');

  src: url('../fonts/Flaticon.eot#iefix') format('embedded-opentype'), url('../fonts/Flaticon.ttf') format('truetype'), url('../fonts/Flaticon.woff') format('woff'), url('../fonts/Flaticon.svg') format('svg');

}


.st-panel1 [data-iconn]:after {

  content: attr(data-iconn);

  width: 200px;

  height: 200px;

  color:black;

  font-size: 90px;

  text-align: center;

  line-height: 200px;

  font-family: "raphaelicons";

}

.st-panel2 [data-icond]:after {

  content: attr(data-icond);

  width: 200px;

  height: 200px;

  color:black;

  font-size: 90px;

  text-align: center;

  line-height: 200px;

  position: absolute;

  top: 300px;

  font-family: "Flaticon";

}

</style>

</head>

<body>        

            <div class="st-scroll">

                    <section class="st-panel1" id="st-panel-1">

                        <div class="st-desc" data-iconn="H"></div>

                    </section>

                    <section class="st-panel2 st-color" id="st-panel-2">

                        <div class="st-desc" data-icond="\f102"></div>  

                    </section>                    

            </div>   

</body>

</html>


慕标3810760
浏览 1016回答 1
1回答

echo_kinchao

看控制台报错啊  是不是 路径错了
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

CSS3