我无法在居中时创建覆盖浏览器窗口宽度80%的输入字段.
<input style="margin-right:10%; margin-left:10%;" size="100%">
Run Code Online (Sandbox Code Playgroud)
仅在浏览器最大化时才有效.
我认为增强的for循环只是一些语法糖,其行为与"传统"for循环完全相同.我在下面编写了一些代码,表明情况并非如此.
产出不同的原因是什么?或者我错过了什么,我应该停止以这种方式编写代码?
为什么不引用temp [(当前指数)]?对我来说,这确实是没有意义不
String temp[] = { "foo:bar" };
for (String t : temp)
t = t.split(":", 2)[1];
System.out.println(temp[0].startsWith("foo")); //true
for (int t = 0; t < temp.length; t++)
temp[t] = temp[t].split(":", 2)[1];
System.out.println(temp[0].startsWith("foo")); //false
Run Code Online (Sandbox Code Playgroud)