隐藏输入文字 [英] Hide input text

查看:52
本文介绍了隐藏输入文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要隐藏输入元素和以下文本。我有

选择器用于输入工作,只需要获取

之后的文本。


CSS:


表格{

显示:表格;

text-align:center;

}

form> input [value =" 0"] [name =" denominator"] {

visibility:hidden;

}


HTML:


<!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Transitional // EN"

" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

< html>

< head xmlns =" http://www.w3.org/1999/xhtml">

< link rel =" stylesheet"类型= QUOT;文本/ CSS" HREF =" testf1.css" media =" all" />

< / head>

< body xmlns =" http://www.w3.org/1999/xhtml" ; whole =" 0"

< form class =" fraction">

< input type =" radio"名称= QUOT;分子"值= QUOT; 0" checked =" checked" /> 0

< input type =" radio"名称= QUOT;分子" value =" 1" /> 1

< input type =" radio"名称= QUOT;分子" value =" 2" /> 2

< input type =" radio"名称= QUOT;分子" value =" 3" /> 3

< hr />

< input type =" radio"名称= QUOT;分母" value =" 0" /> 0

< input type =" radio"名称= QUOT;分母" value =" 1" /> 1

< input type =" radio"名称= QUOT;分母" value =" 2" /> 2

< input type =" radio"名称= QUOT;分母"值= QUOT; 3英寸checked =" checked" /> 3

< / form>

< / body>

< / html> < > http://emle.sourceforge.net/emle020000 /testf1.xml
http:// emle。 sourceforge.net/emle020000/testf1.xsl
http ://emle.sourceforge.net/emle020000/testf1.css


-

CWHoleman II | cw***@Julian5Locals.com -5 http://julianLocals.com/cwhii

上帝只给了人类的一小部分,给予了特权

赚取一个人的面包做一个人乐意追求的自由,为

激情。我很感激。 The Mythical Man-Month Epilogue / F.P.Brooks

I what to hide an input element and the following text. I have the
selector for the input working and just need to grab the text following
it.

CSS:

form{
display:table;
text-align:center;
}
form>input[value="0"][name="denominator"]{
visibility:hidden;
}

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head xmlns="http://www.w3.org/1999/xhtml">
<link rel="stylesheet" type="text/css" href="testf1.css" media="all"/>
</head>
<body xmlns="http://www.w3.org/1999/xhtml" whole="0">
<form class="fraction">
<input type="radio" name="numerator" value="0" checked="checked"/>0
<input type="radio" name="numerator" value="1"/>1
<input type="radio" name="numerator" value="2"/>2
<input type="radio" name="numerator" value="3"/>3
<hr/>
<input type="radio" name="denominator" value="0"/>0
<input type="radio" name="denominator" value="1"/>1
<input type="radio" name="denominator" value="2"/>2
<input type="radio" name="denominator" value="3" checked="checked"/>3
</form>
</body>
</html>

http://emle.sourceforge.net/emle020000/testf1.xml
http://emle.sourceforge.net/emle020000/testf1.xsl
http://emle.sourceforge.net/emle020000/testf1.css

--
C.W.Holeman II | cw***@Julian5Locals.com-5 http://JulianLocals.com/cwhii
To only a fraction of the human race does God give the privilege of
earning one''s bread doing what one would have gladly pursued free, for
passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks

推荐答案

5月1日上午11:42,C.W.Holeman II < cwhii_google_s ... @ yahoo.com>

写道:
On May 1, 11:42 am, "C.W.Holeman II" <cwhii_google_s...@yahoo.com>
wrote:

我要隐藏输入元素和以下文本。我有

选择器用于输入工作,只需要获取

之后的文本。
I what to hide an input element and the following text. I have the
selector for the input working and just need to grab the text following
it.



< input type =" radio"名称= QUOT;分子"值= QUOT; 0" checked =" checked" /

<input type="radio" name="numerator" value="0" checked="checked"/


>< span> 0< / span>
><span>0</span>



form> input [value =" 0"] [name =" denominator"],form> input [value =" 0"]

[name =" denominator"] + span {

visibility:hidden;

}


或:

< input type =" radio"名称= QUOT;分子"值= QUOT; 0" checked =" checked" />


form> input:after {content:attr(value)}

form> input [value =" 0"] [name =" denominator"],form> input [value =" 0"]

[name =" denominator"]:after {

可见性:隐藏;内容:""

}

form>input[value="0"][name="denominator"],form>input[value="0"]
[name="denominator"]+span{
visibility:hidden;
}

or:
<input type="radio" name="numerator" value="0" checked="checked"/>

form>input:after {content:attr(value) }
form>input[value="0"][name="denominator"],form>input[value="0"]
[name="denominator"]:after{
visibility:hidden;content:""
}


Scripsit CWHoleman II:
Scripsit C.W.Holeman II:

我要隐藏输入元素和以下文本。
I what to hide an input element and the following text.



什么?

What?


我有输入工作的选择器
I have the selector for the input working



不,你不是。它包含IE 6不支持的几种结构,它们仍然是最常见的浏览器。

No you don''t. It contains several constructs not supported by IE 6, which is
still the most common browser.


只需要抓取以下文本它。
and just need to grab the text following it.



将文本包装在元素中并开发合适的选择器。

Wrap the text inside an element and develop a suitable selector.


<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // EN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"



这是没有意义的。

That''s pointless.


< body xmlns =" http:// www .w3.org / 1999 / XHTML" whole =" 0"

< form class =" fraction">
<body xmlns="http://www.w3.org/1999/xhtml" whole="0">
<form class="fraction">



您不遵守XHTML 1.0规范或任何HTML

规范。 < body>中有一个发明的''整体'属性,并且< formtag,

You don''t comply with the XHTML 1.0 specification, or any HTML
specification. There''s an invented ''whole'' attribute in <body>, and the
required ''action'' attribute is missing from the <formtag,


必需的''action''属性=post_quotes>
< input type =" radio"名称= QUOT;分子"值= QUOT; 0" checked =" checked" /> 0

< input type =" radio"名称= QUOT;分子" value =" 1" /> 1

< input type =" radio"名称= QUOT;分子" value =" 2" /> 2

< input type =" radio"名称= QUOT;分子" value =" 3" /> 3
<input type="radio" name="numerator" value="0" checked="checked"/>0
<input type="radio" name="numerator" value="1"/>1
<input type="radio" name="numerator" value="2"/>2
<input type="radio" name="numerator" value="3"/>3



你应该在< fieldsetelement中包含相互关联的单选按钮,并且

你应该关联带有标记字段的标签,例如


< div class =" dummy">< label>< input type =" radio"名称= QUOT;分子" value =" 0"

checked =" checked" /> 0< / label>< / div>


然后你可以简单地使用

..dummy {visibility:hidden; }


-

Jukka K. Korpela(Yucca)
http://www.cs.tut.fi/~jkorpela/

You should wrap interrelated radio buttons inside a <fieldsetelement, and
you should associate labels with fields in markup, e.g.

<div class="dummy"><label><input type="radio" name="numerator" value="0"
checked="checked"/>0</label></div>

Then you can simply use
..dummy { visibility: hidden; }

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Jukka K. Korpela写道:
Jukka K. Korpela wrote:

Scripsit CWHoleman II:
Scripsit C.W.Holeman II:

>我要隐藏输入元素和以下文本。
>I what to hide an input element and the following text.



什么?


What?



介绍下面显示的具体细节。

An introduction with specific details shown below it.


> ;我隐藏什么
>I what to hide



visibility:hidden;

visibility:hidden;


>输入元素
>an input element



form> input [value =" 0"] [name =" denominator"]

form>input[value="0"][name="denominator"]


>以及以下文字。
>and the following text.



< input type =" radio"名称= QUOT;分母" value =" 0" /> 0

< input type =" radio"名称= QUOT;分母" value =" 1" />


输入元素后面的文本,在本例中为0。

<input type="radio" name="denominator" value="0"/>0
<input type="radio" name="denominator" value="1"/>

After the input element, the text following it, in this case the "0".


>
>

>我有输入的选择器工作
>I have the selector for the input working



不,你不是。它包含IE 6不支持的几种结构,


No you don''t. It contains several constructs not supported by IE 6,



我忘了包含:


Mozilla / 5.0(Windows; U ; Windows NT 5.1; en-US; rv:1.8.1.3)

Gecko / 20070309 Firefox / 2.0.0.3

Windows Internet Explorer版本:7.0。 5730.11


我创建的例子在上面的浏览器中产生了我所询问的效果:它们显示了两行带有
按钮和文本垂直对齐,0按钮和文本对齐。分母按钮是

隐藏但是0文本是可见的。

I forgot to include:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3)
Gecko/20070309 Firefox/2.0.0.3

Windows Internet Explorer Version: 7.0.5730.11

The example I created produced the effect I am asking about on both of
the above browsers: they displayed two rows of radio buttons with the
buttons and text aligned vertically and the "0" denominator button was
hidden but the "0" text was visible.


这仍然是最常见的浏览器。
which is still the most common browser.



我不会考虑这会影响我b
做什么。什么是现在的最常见的浏览器可能与发布时间不一致或

无关。

I am not near the point of considering how that will effect what I am
doing. What is now the "most common browser" may be different or
irrelevant by release time.


>并且只需要抓取文本跟着它。
>and just need to grab the text following it.



将文本包装在元素中并开发合适的选择器。


Wrap the text inside an element and develop a suitable selector.



我希望不必添加它。如果有一些选择器

将无法添加像span这样的东西,我宁愿

理解该方法。

I am hoping to not have to add that. If there is some selector that
will work without adding something like a span I would prefer to
understand that method.


><!DOCTYPE html PUBLIC" - // W3C // DTD XHTML 1.0 Transitional // EN"
><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"



那是没有意义的。


That''s pointless.



来自 http: //www.w3.org/TR/xhtml1/ 第3.1.1节。

From http://www.w3.org/TR/xhtml1/ Section 3.1.1.


4.文件之前必须有DOCTYPE声明

根元素。 DOCTYPE

声明中包含的公共标识符必须使用

相应的正式公共标识符引用DTD中找到的三个DTD之一。系统标识符可能会被改变以反映本地系统惯例。
...

<!DOCTYPE html

PUBLIC" ; - // W3C // DTD XHTML 1.0 Transitional // EN"

" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4. There must be a DOCTYPE declaration in the document prior to the
root element. The public identifier included in the DOCTYPE
declaration must reference one of the three DTDs found in DTDs using
the respective Formal Public Identifier. The system identifier may be
changed to reflect local system conventions.
...
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


您不遵守XHTML 1.0规范或任何HTML

规范。
You don''t comply with the XHTML 1.0 specification, or any HTML
specification.



我创建了一个片段,让读者尽可能轻松地跟随我的问题。

I created a fragment to make it as easy as possible for readers to
follow my question.


< body>中有一个发明的''整体'属性,
There''s an invented ''whole'' attribute in <body>,



我在 http://emle.sourceforge.net/emle020000/testf1.xsl

但在帖子的文本中错过了它。

I caught that in http://emle.sourceforge.net/emle020000/testf1.xsl
but missed it in the text of the posting.


并且< formtag,$ b中缺少必需的''action''属性$ b
and the required ''action'' attribute is missing from the <formtag,



我创建了一个片段,让读者尽可能轻松地按照我的问题来支付
。我测试过这个例子的两个浏览器似乎没有受到简化的影响。

I created a fragment to make it as easy as possible for readers to
follow my question. The two browsers I tested the example on appeared to
not be effected by the simplification.


> ; < input type =" radio"名称= QUOT;分子"值= QUOT; 0" checked =" checked" /> 0
< input type =" radio"名称= QUOT;分子" value =" 1" /> 1
< input type =" radio"名称= QUOT;分子" value =" 2" /> 2
< input type =" radio"名称= QUOT;分子" value =" 3" /> 3
> <input type="radio" name="numerator" value="0" checked="checked"/>0
<input type="radio" name="numerator" value="1"/>1
<input type="radio" name="numerator" value="2"/>2
<input type="radio" name="numerator" value="3"/>3



你应该在< fieldsetelement,

中包含相互关联的单选按钮,你应该关联带有标记字段的标签,例如


You should wrap interrelated radio buttons inside a <fieldsetelement,
and you should associate labels with fields in markup, e.g.



我使用的样本只是一个片段。感谢您参考

< fieldset,我不知道。是< fieldsetelement some

如何需要或与隐藏0的问题有关?

The sample I am using is just a fragment. Thank you for the reference to
<fieldsetwhich I did not know about. Is the <fieldsetelement some
how needed or related to the issue of hiding the "0"?


>

< div class =" dummy">< label>< input type =" radio"名称= QUOT;分子" value =" 0"

checked =" checked" /> 0< / label>< / div>


然后你可以简单地使用

.dummy {visibility:hidden; }
>
<div class="dummy"><label><input type="radio" name="numerator" value="0"
checked="checked"/>0</label></div>

Then you can simply use
.dummy { visibility: hidden; }



是的,这有效。如果这是我将使用它的唯一解决方案,但我会想要不必创建像虚拟这样的名称。将XSL内容

绑定到CSS文件。


-

C.W.Holeman II | cw***@Julian5Locals.com -5 http://julianLocals.com/cwhii

上帝只给了人类的一小部分,给予了特权

赚取一个人的面包做一个人乐意追求的自由,为

激情。我很感激。 The Mythical Man-Month Epilogue / F.P.Brooks

Yes, that works. If that is the only solution I will use it but I would
like to not have to create an name like "dummy" to tie the XSL content
to the CSS file.

--
C.W.Holeman II | cw***@Julian5Locals.com-5 http://JulianLocals.com/cwhii
To only a fraction of the human race does God give the privilege of
earning one''s bread doing what one would have gladly pursued free, for
passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks


这篇关于隐藏输入文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆