我在我的css中遇到了@ font-face规则的问题。 在一些样式表中,它完全适用于其他样式,它根本不起作用...@ font-face有时候有时会有效,而不是其他时间呢?
正如您在代码片段中看到的,我使用外部文件作为我的字体,但在此特殊情况下它不工作...
任何想法的人?
无尽的感激之情将是你的分享:)
@charset "utf-8"
@font-face {
font-family: sinhala;
src: url(fonts/Sinhala.ttc);
}
#wrapperportfolio4 {
\t width: 45%;
\t float:left;
\t position:relative;
\t margin-left: 5%;
\t margin-top: -42.5%;
\t box-shadow: 3px 5px 4px 0px black;
\t height: 20vw;
\t
\t
}
#wrapper4trans {
\t width: 45%;
\t float:left;
\t position:relative;
\t margin-left: 5%;
\t margin-top: -42.5%;
\t background-color: black;
\t opacity: 0.5;
\t height: 20vw;
}
#box1title {
\t width: 65%;
\t font-family: sinhala;
\t font-size: 1.0vw;
\t color: white;
\t margin-top: 2%;
\t text-align: center;
}
#box1img {
\t width: 60%;
\t position:relative;
\t float:left;
\t margin-left: 2.5%;
\t margin-top: 1.5%;
\t
}
#box1txt{
\t width: 25%;
\t position:relative;
\t float:left;
\t font-family: sinhala;
\t font-size: 1.0vw;
\t color: white;
\t margin-left: 5%;
\t margin-top: 5%;
\t text-shadow: 0px 2px 4px rgba(0,0,0,0.50);
}
#box1txt2{
\t width: 25%;
\t position:relative;
\t float:left;
\t font-family: sinhala;
\t font-size: 1.0vw;
\t color: white;
\t margin-left: 5%;
\t margin-top: 5%;
\t text-shadow: 0px 2px 4px rgba(0,0,0,0.50);
}
#box1link {
\t width: 25%;
\t position:relative;
\t float:left;
\t font-family: sinhala;
\t font-size: 1.0vw;
\t color: white;
\t margin-left: 5%;
\t margin-top: 5%;
\t text-shadow: 0px 2px 4px rgba(0,0,0,0.50);
\t cursor: pointer;
}
<div id="wrapperportfolio4">
\t <p id="box1title">www.pieterswebdesign.com</p>
\t
\t \t \t <img id="box1img" src="images/box1img.png" />
\t \t \t \t <p id="box1txt">Pieter's Web Design is een beginnende webdesigner gevestigd in Gent.</p>
\t \t \t \t \t <p id="box1txt2">Voor betaalbare professionele websites is dit de ideale oplossing.</p>
\t \t \t \t \t \t <a id="box1link" href="https://www.pieterswebdesign.com">www.pieterswebdesign.com</a>
\t </div>
好的,我会看看thx的回复:) – Pieter
谢谢,正确的答案很好,我发布我的10分钟后复制我的矿! –
哎呀srr已经调整thx的答案:) – Pieter