彩色输入字段网站
我想更改我在网络浏览器上看到的输入字段的边框颜色。我想知道当我用鼠标选择它们时是否可以更改边框颜色。谷歌浏览器就是一个很好的例子。有人知道这有效吗?我怎样才能让它在delphi中工作?
谢谢
I want to change the border color of the input fields that i can see on webbrowser. I want to know if i can change the border color when i select them by mouse. Google chrome is a good example. Anyone know this works? and how i can make it work in delphi?
Thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这类事情通常是通过 css 样式完成的。 IIRC 在本例中为 *:focus 的样式设置。
通常,样式表与 HTML 页面分开,并通过标头中的标签进行引用。
如果您从 Delpi 中生成内容,您可能必须使用所谓的内联样式表:...嵌入在 HTML 页面中的标签。
如果您不熟悉这些技术,我可以推荐 w3schools 网站。更具体地说,他们的 CSS 教程。
That sort of thing is normally done through css styles. IIRC in this case the style settings for *:focus.
Normally stylesheets would be separate from the HTML page and referenced through tags in the header.
If you are generating the content from within Delpi you may have to use a so-called inline stylesheet: ... tags embedded in the HTML page.
If you are unfamiliar with these techniques, I can recommend the w3schools site. More specifically their CSS tutorial.
Delphi 的 TWebBrowser 是 IWebBrowser2 组件的包装器在当前版本的 Windows 中,它基于 Internet Explorer。
因此,在我看来,任何 Delphi 代码都不太可能用于修改控件的呈现。
更新版本的 Internet Explorer 现在确实会突出显示活动/聚焦的输入字段,但我怀疑您对目标计算机上安装的 IE 版本有很大的控制权。
明显的替代方案是使用 CSS 样式以不同方式绘制活动/聚焦输入字段。
Delphi's TWebBrowser is a wrapper around the IWebBrowser2 component which, in current versions of Windows, is based on Internet Explorer.
So it would seem exceedingly unlikely to me that any Delphi code could be used to modify the controls rendering.
More recent versions of Internet Explorer do now highlight the active/focused input field but I doubt you will have much control over which versions of IE are installed on your target machines.
The obvious alternative would be to use CSS styling to draw the active/focused input fields differently.