AProgramThe main interface of the program is designed on a webpage. The effect is very good. html + CSS can be used to achieve richer interface effects, which is easier than using Delphi directly.
The implementation method is very simple. Add a webbrowser component in the form, and then execute the followingCode:
Webbrowser1.navigate ('d: \ soft \ homepage.html ');
However, a problem arises: The webbrowser component has no borders before loading html. After loading HTML, a three-dimensional border appears around webbrowser, it is extremely different from the style of the program itself, and all attributes of webbrowser are viewed. No attributes can be changed.
After testing, we found that this border is not produced by webbrowser, but by HTML loaded in webbrowser. If so, the problem will be solved. We can actually remove the border with CSS:
Body {border: 0px; overflow: auto;/* the scroll bar can be automatically hidden or displayed; set it to hidden to completely hide the scroll bar */}
When you are happy to set the above CSS, you find that the webbrowser border still exists. Is it CSS wrong? No, your doctype is faulty. The above CSS is ineffective in XHTML. Set doctype to html4:
<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">