德尔福CSS - 盒子模型问题
我正在使用基于 Windows 的程序(用 Delphi 编码)来生成 HTML(并且可以将浏览器限制为 MSIE 7 +)。
我需要绝对的、像素完美的所见即所得。但是,我遇到了文本换行问题。
在 Delphi 中看起来像这样的
-- -----------------
| aaaa bbb ccc ddd |
--------------------
在浏览器中看起来像这样(MS IE 和 FF。虽然我只针对 MSIE,但我使用 FF 来访问 FireDebug)
--------------------
| aaaa bbb ccc |
--------------------
ddd
现在,Delphi 有一个对象检查器
这使我能够精确设置控件的顶部/左侧/宽度/高度,并且在生成 HTML 时,我将它们用于每个控件的 CSS 定位控制表格上。例如
<fieldset style="position: absolute; top: 56px; left: 32px; width: 185px; height: 13px; ">
<legend> </legend>
<div style="position: absolute; top: 0px; left: 0px; width: 179px; height: 13px;">
Label1 000 111 222 aaa bbb cccc dd
</div>
</fieldset>
,但是由于我得到了文本换行,我想我忽略了一些东西,比如边距/边框/填充的设置。有什么想法吗?
顺便说一句,我使用 Arial 10 作为 Windows/浏览器可比性的字体,所以它不应该是字体大小问题。
我认为Delphi必须有类似于盒子模型的东西,因为它绘制带有边距的控件(从0左开始的控件与窗体左侧有一个可见的间隙;如果我给它宽度100并用左定位另一个控件) =100 它们之间有明显的差距)。
知道我将如何实现所见即所得吗? HTMl 必须反映 Delphi 表单中的控件布局。
I am using a windows based program, coded in Delphi, to generated HTML (and can restrict the browser to MSIE 7 +).
I need absolute, pixel perfect WYSIWYG. However, I am having text-wrap problems.
What looks like this in Delphi
-- -----------------
| aaaa bbb ccc ddd |
--------------------
looks like this in the browser (both MS IE and FF. Although I am targeting MSIE only, I am using FF to have access to FireDebug)
--------------------
| aaaa bbb ccc |
--------------------
ddd
Now, Delphi has an Object Inspector
which allows me to precisely set a control's top/left/width/height and when generating the HTML, I use those for CSS positioning of each control on the form. e.g.
<fieldset style="position: absolute; top: 56px; left: 32px; width: 185px; height: 13px; ">
<legend> </legend>
<div style="position: absolute; top: 0px; left: 0px; width: 179px; height: 13px;">
Label1 000 111 222 aaa bbb cccc dd
</div>
</fieldset>
But since I am getting text wrap I guess that I am overlooking something, like setting of margin/border/padding. Any ideas what?
Btw, I use Arial 10 as my font for windows/browser comparability, so it shouldn't be a font size problem.
I think that Delphi must have something akin to the box model, insomuchas it draws the control with a margin (a control starting at 0 left has a visible gap from the left of the form; if I give it width 100 and position another with left =100 there is a visible gap between them).
Any idea how I am going to achieve WYSIWYG? The HTMl must reflect the control layout in the Delphi form.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个,这就是你想要实现的目标吗?
Try this, is this what you are trying to achieve?