html - CSS/HTML 代码无效,字体未应用

标签 html css input

当我尝试运行此 CSS/HTML 代码时(这是在 webkit 浏览器中),它不起作用。输入框中的字体是没有应用 Lato 字体:

<html>
    <head>
        <link href='http://fonts.googleapis.com/css?family=Lato:300' rel='stylesheet'
        type='text/css'>
        <title>Dumb Search</title>
        <meta name="apple-mobile-web-app-capable" content="yes"
        />
        <link rel="apple-touch-icon-precomposed" href="../ds.png" />
        <meta name="viewport" content="width = device-width, user-scalable = no, initial-scale = 0.8">
        <style>
            .box {
                padding:20px;
                width:290px;
                box-shadow:0px 1px 3px -1px #c3c3c3;
                background-color:white;
                color:gray;
                font-family:Lato;
                text-align:left;
            }

        </style>
    </head>
    <body bgcolor="#f5f5f5">
        <center>
            <br>
            <div style="position:relative;width:342px;">
                <form action="searchcompleted.php" style="display:inline;">
                    <input name="q" value="Search, or tap the camera" class="box" style="border:0;outline:0;width:340px;color:#A0A0A0;padding-top:15px;padding-bottom:15px;"
                    onfocus="if (this.value == 'Search, or tap the camera') {this.value = '';}"
                    onblur="if (this.value == '') {this.value = 'Search, or tap the camera';}">
                </form>
                <img src="http://i45.tinypic.com/30vkbhj.jpg" style="position:absolute;top:0px;left:278px;opacity:0.4;height:30px;padding:15px;padding-right:17px;"
                onclick='void(0);document.getElementById("thisone").click();'>
                <form style="display:inline;" action="http://www.dumbsearch.com/dumbocr/post.php"
                method="post" enctype="multipart/form-data" id="sniff">
                    <input accept="image/*" type="file" style="display:none;" id="thisone"
                    onchange='document.getElementById("scan").style.display="block";' name="photo">
                    <div onclick='void(0);document.getElementById("sniff").submit();' style="position:absolute;top:65px;left:195px;background-color:white;border:0;box-shadow: 0px 1px 3px -1px #C3C3C3;padding:20px;color:#0EBFE9;padidng-left:25px;padding-right:25px;z-index:4;display:none;font-family:Lato;"
                    id="scan">Touch to scan</div>
                </form>
            </div>
            <br>
            <div class="box"></div>
    </body>

</html>

非常感谢!提前!

编辑:看这里:http://pastehtml.com/view/cokmdi9yg.html

最佳答案

在字体系列中试试这个

 @font-family
{
font-family: FirstFont;
src: url('.ttf');
} 

关于html - CSS/HTML 代码无效,字体未应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14250414/

相关文章:

javascript - 如何检测类(class)中的 child 人数?

html - CSS 和 IE8 的问题,Box 仅在 IE8 中有溢出/重复的图像!请帮忙!

html - 如何使标签栏居中

html - CSS定位

html - 如何从按钮上的链接中删除下划线?

javascript - 为什么此掩码代码会出现 JavaScript 解析器错误?

css - 使用 HTML5 和 CSS 创建 5 个相等且 flex 的列,可在单行中调整高度

javascript - 如何使用切换仅显示少数?

c - 在 C 中使用 scanf() 接受空输入

bash - 在 bash 中,如何处理命令行上的所有用户输入