Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么css没有应用到我的网页上?_Html_Css_Asp.net - Fatal编程技术网

Html 为什么css没有应用到我的网页上?

Html 为什么css没有应用到我的网页上?,html,css,asp.net,Html,Css,Asp.net,我有一个asp.net表单,在该表单中,我试图通过css将一些字体设置应用于文本框。这是我的css中的内容: body { } @font-face { font-family: 'Lohit Devanagari',serif; src: url('http://fonts.googleapis.com/earlyaccess/lohitdevanagari.css'); font-weight: normal; font-style: normal;

我有一个asp.net表单,在该表单中,我试图通过css将一些字体设置应用于文本框。这是我的css中的内容:

body 
{

}

@font-face {
    font-family: 'Lohit Devanagari',serif;  
    src: url('http://fonts.googleapis.com/earlyaccess/lohitdevanagari.css');
    font-weight: normal;
    font-style: normal;
}

.txtQues
{
    font-family: 'Lohit Devanagari',serif;   
    font-size:14px;
    background-color:Yellow;
}
下面是我的页面源代码的一部分,我已将css添加到页面中:

<head>
 <title>Question Master</title>
 <link href="../FontSettings.css" rel="stylesheet" type="text/css" />
 <meta name="google-translate-customization" 
 content="3280487709591956-   dc3fc45d489f056a-g5378ebab0cbcd0a4-12"/>   
</head>

问题大师
文本框:

<asp:TextBox ID="txtQuestion" runat="server" Height="101px" TextMode="MultiLine" Width="627px" meta:resourcekey="txtQuestionResource1"  EnableTheming="True" 
ontextchanged="txtQuestion_TextChanged" CssClass="txtQues"></asp:TextBox>


当我将css应用于表单时,我看到设计窗口中文本框的颜色发生了变化,这告诉我正在应用css,但是当我在浏览器上运行代码时,我发现文本框的颜色和字体都没有改变。请帮助我,让我知道哪里出了问题。

删除
@font-face
并导入文件。css allready使用字体面。尝试:

@import url("http://fonts.googleapis.com/earlyaccess/lohitdevanagari.css");
body 
{

}
.txtQues
{
    font-family: 'Lohit Devanagari',serif;   
    font-size:14px;
    background-color:Yellow;
}
在下面的代码中,删除“EnableTheming”或将其设为false

<asp:TextBox ID="txtQuestion" runat="server" Height="101px" TextMode="MultiLine" Width="627px" meta:resourcekey="txtQuestionResource1"  EnableTheming="True" ontextchanged="txtQuestion_TextChanged" CssClass="txtQues"></asp:TextBox>

我们可以看到您尝试设置样式的元素的HTML吗?我假设您尝试设置样式的元素是给定类
txtQues
?是否包含css的正确路径?.link href=“../FontSettings.css”?查看源代码并确保它正确链接到.css文件(即,单击view source中的链接并检查它是否真的将您带到了那里,并且没有断开的链接)我检查了它,发现它不是断开的链接。好的@Suresh,我需要保持启用主题为真还是假?使启用主题为假还是去掉它。仍然相同的结果@Suresh:)我们需要查看您的原始代码。给出站点url或在JSFIDLE中复制相同的url。让我们来吧。我似乎无法让它工作。。我做了一把小提琴来演奏:
.txtQues
{
font-family: 'Lohit Devanagari',serif !important;   
font-size:14px !important;
background-color:Yellow !important;
}