Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.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 - Fatal编程技术网

Html CSS未应用于输入元素

Html CSS未应用于输入元素,html,css,Html,Css,这很奇怪,我看不出问题所在,而且我有一些使用CSS的经验 input { border: solid 1px #0066FF; } .docDataEditorRow input { width: 100px; font-size: 10px; } HTML: 在Firebug中未被应用或显示为已覆盖您可能有什么东西覆盖了它。规则是否显示在元素检查器中 我会尝试以下方法: #docDataEditor .docDataEditorRow input[type="text] {

这很奇怪,我看不出问题所在,而且我有一些使用CSS的经验

input {
  border: solid 1px #0066FF;
}
.docDataEditorRow input {
  width: 100px;
  font-size: 10px;
}
HTML:


在Firebug中未被应用或显示为已覆盖

您可能有什么东西覆盖了它。规则是否显示在元素检查器中

我会尝试以下方法:

#docDataEditor .docDataEditorRow input[type="text] {
  width: 100px;
  font-size: 10px;
}

看下面的小提琴:

您的代码与您在问题中粘贴的代码完全相同,并且工作正常

也许您的代码中有其他东西导致它无法工作

input {
  border: solid 1px #0066FF;
}
.docDataEditorRow input {
  width: 100px;
  font-size: 10px;
}

<div id="docDataEditor">
    <form>
        <div class="column-50">
        <div class="docDataEditorRow">
            <label for="keyword-Fecha">Fecha</label>
            <input type="text" value="20131122" id="keyword-Fecha">
        </div>
        <div class="docDataEditorRow">
            <label for="keyword-Fecha de Creacion">Fecha de Creacion</label>
            <input type="text" value="2013-11-22 00:00:00" id="keyword-Fecha de Creacion">
        </div>      
        </div>
 <div class="column-50"></div>
    </form>
  </div>
输入{
边框:实心1px#0066FF;
}
.docDataEditorRow输入{
宽度:100px;
字体大小:10px;
}
德国福查
克赖西翁酒店
更新 查看后,CSS中有一个无效字符。这会导致它中断,并且不会在该角色之后应用样式和样式

删除后,样式将正确应用


原始答案 解决此问题的最简单方法是使用类名而不是元素(
input


培根先生{
宽度:100px;
字体大小:10px;
}

使用
.docDataEditorRow输入
可能会很危险,因为您开始使CSS特定。将内容保留为单个类名将使您的css在长期内更易于维护。

它工作正常:您能告诉我出了什么问题吗?我补充说什么是错误的你是否尝试过更准确地瞄准元素?类似于´#docDataEditor form.docDataEditorRow input´您需要提供实际再现问题的代码。检查这一点,使用您发布的确切代码测试它,而不使用其他内容。还要指定测试的浏览器(包括版本号和平台)。仍不工作,要设置样式的内容位于JQuery自动生成的div中(如果有帮助)。这太奇怪了,您在元素检查器中看到了什么?首先检查您的开发工具css样式是否正确地存在于样式表中。然后用你的开发工具看看还有什么其他样式应用到这个元素上。我已经添加了它,奇怪的是它也不起作用。我完全迷路了。editorInput{width:100px;font size:10px;}好的,使用浏览器开发工具检查元素,看看输入元素应用了什么样式。css中有一个奇怪的字符破坏了它。我已经删除了它,现在它的工作
#docDataEditor .docDataEditorRow input[type="text] {
  width: 100px;
  font-size: 10px;
}
input {
  border: solid 1px #0066FF;
}
.docDataEditorRow input {
  width: 100px;
  font-size: 10px;
}

<div id="docDataEditor">
    <form>
        <div class="column-50">
        <div class="docDataEditorRow">
            <label for="keyword-Fecha">Fecha</label>
            <input type="text" value="20131122" id="keyword-Fecha">
        </div>
        <div class="docDataEditorRow">
            <label for="keyword-Fecha de Creacion">Fecha de Creacion</label>
            <input type="text" value="2013-11-22 00:00:00" id="keyword-Fecha de Creacion">
        </div>      
        </div>
 <div class="column-50"></div>
    </form>
  </div>
<input class="bacon" type="text" value="20131122" id="keyword-Fecha">

.bacon {
  width: 100px;
  font-size: 10px;
}