CSS 和 TWebbrowser delphi
我想知道是否可以操纵网站的 CSS。例如输入字段中的颜色?我查看了几个问题,但我不清楚这是否可能。
例如,在 Google Chrome 中,每当选择一个字段时,它都会在外部站点周围显示一条金色线条。是否可以在 delphi 中通过任何网站执行此操作和其他操作。编写应用于在 Twebbrowser 中打开的网站的 CSS 代码?仅供个人查看,
谢谢
我也可以使用此代码更改输入字段背景的颜色吗?我可以更改背景颜色并更改字体大小,但似乎无法弄清楚输入字段的颜色或边框。这是代码:
I was wondering if it was possible to manipulate the CSS of websites. For example color in the input fields? I had a look at several questions, but its not clear to me if it is possble at all.
For Example in Google Chrome, Whenever a field is selected it shows a golden line around the outsite. Is it possible to do this and other things in delphi, with any website. Writing CSS code that gets applied to the website opend in Twebbrowser? Just for personal viewing only
Thx
Can I change the color of an input field background with this code as well? I can change background colors and change font size, but cant seem to figure out to color in or border an input field. This is the code:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
加载页面后,可以通过从代码添加样式表来修改 CSS:
It is possible to modify CSS by adding a stylesheet from code, after the page is loaded:
使用 @jasonpenny 的答案添加样式表,接下来需要更改具有焦点的输入元素周围的边框,这在 CSS 中称为焦点伪类或选择器。有关详细信息,请参阅以下文章:
http://www.w3schools.com 站点拥有大量有关 Web 开发的信息。它还允许您尝试许多示例,以便您可以看到更改内容时会产生什么效果。如果您想学习如何进行 CSS 样式设置,那么最好掌握其中的所有信息,而不是尝试同时学习编程和编程语言。
Using @jasonpenny's answer to add a stylesheet, what you need next to change the border around the input element that has focus, is what in CSS is called the focus pseudo class or selector. For more information see these articles:
The http://www.w3schools.com site has a wealth of information on web development. It also allows you to play with many examples so you can see what the effects would be when you change things. If you are trying to learn how to do css styling you might be better of getting to grips with all the information there, instead of trying to learn programming and a programming language at the same time.