问题标签 [text-indent]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
html - IE中文本框的文本缩进
我试图通过给它一个极端的文本缩进来将我的文本推出文本框,但显然文本缩进在 IE 中被忽略/解释不同。
这是一个模拟(在 Chrome 和 IE 中尝试以查看差异):http:
//jsfiddle.net/Cernx/1/
有什么解决方法吗?还是有另一种将文本推出文本框的方法?
css - CSS中负文本缩进的宽度问题
当我运行下面的代码时,我在屏幕上看到一个蓝色框。
如果我将文本更改Hello World
为HelloWorld
,蓝色框消失了怎么办?
附加说明- 我在 google chrome 中看到了这一点。
java - 需要带有缩进第一行的 JTextArea (或类似的)
如何扩展 JTextArea 以缩进第一行?我想在文本区域的左上角区域显示一些不可编辑的东西(例如一些图标)。这些项目将是一行文本的高度,因此如果 JTextArea 将第一行的一部分留空,则可以将这些项目布置在那里。该字段必须是可编辑的和多行的。
我花了几天时间查看文本类和 UI 类的层次结构。我对这种架构有一个大致的了解——使用 Document 来存储文本,DefaultTextUI 进行绘画并跟踪插入符号等等。但是,深入研究字符定位代码只会变得越来越混乱。
我想我可以从头开始,扩展 Component,但这似乎是错误的方法。有没有人有足够的信心来帮助“正确”的方式?如果我们取消论坛,我可能愿意补偿。
html - Nested divs with text indentation issue in Chrome/IE
I am having problems with nested divs in Chrome and IE, whereas in Firefox it works fine.
I have two style attribute (text-indent and margin-top) set in the outer div. The "display" style of inner div is set to block. So, ideally the content after the inner div should appear in a new line without any indentation. It appears so in Firefox, whereas in Chrome/IE it appears with text indentation! Based on this behaviour if I assume that this content fragment (from "remaining text" shown below) inherits the style attribute of the corresponding div, that is not the case too; because, only the text-indent is inheritted and the margin-top is not! Could you please help me to understand on where I am doing wrong?
By the way here is the html fragment:
Thanks
Srikanth
html - 文本缩进在 chrome 和 firefox 中定义了不同的 div 大小
我在这里有这个小块 - 文本有文本缩进所以它不会被看到,然后唯一应该看到的是图像的跨度(大小 24 * 27)。Firefox 看到<a>
24*27 的大小(如我所愿),但 chrome 将其计算为 58*24(更宽)。取出文本本身可以解决问题(但我想把文本留在那里)。
当我将属性添加到文本中时,display:none
它工作得很好,但我不希望这样做。
错误是什么?为什么它的计算方式不同,我该如何解决?
我有这段 HTML:
一般的CSS是:
android - Android 缩进和悬挂缩进
我有兴趣拥有一系列 TextView,最终带有悬挂缩进。通过 CSS 执行此操作的标准方法是将边距设置为 X 像素,然后将文本缩进设置为 -X 像素。显然,我可以用“android:layout_marginLeft="Xdp" 来做第一个,但我不确定如何在 TextView 上施加 -X 像素。有什么想法或解决方法吗?我很感激任何建议。
javascript - 是否可以在 Notepad++ 中缩进 JavaScript 代码?
我有一些用一行编写的 JavaScript 代码(没有回车),它完全不可读......
使用记事本++,我尝试自己替换这些字符({
, }
, ;
)加上回车,但它仍然不是很方便......
有没有办法在 Notepad++ 中正确执行此操作?
jquery - 对多行文本应用文本缩进。jQuery
多行文本的文本缩进似乎不起作用。如下图 text-indent 似乎不适用于years:
******字(红圈)**。
请指教。
提前致谢。
BB
css - 如何将文本缩进一个字符宽度
前提是我使用monospace作为我的font-family,但它似乎无法正常工作,我尝试了一些解决方案,但其中一个都有效,我的 HTML 结构如下:
使用em
em应该等于计算出来的 font-size值,但是padding-left: 1em; 不起作用:
使用像素
填充左:32px;与padding-left: 1em产生相同的输出;.
使用前
ex应该是字母 'x' 的计算高度,它也不起作用:
使用ch
好的,webkit不支持ch作为 css 单元。
那么如何编写css来准确缩进第二个div一个字符宽度,即第一个'0'应该与字母'b'左对齐,没有任何偏差。