Edit CSS with Delphi

I am using Delphi 2010. I am using twebbrowser to download the HTML source and view it. Now I want to click on the area (background, links, etc.) in the web browser and get the style in the CSS file that styles the HTML.

For example: I click on the H3 area and I want it to be moved to h3{ color: white; }in CSS. Any help is generally much appreciated; it's hard for me to understand.

+3
source share
1 answer

You will need to deal with source parsing in order to do this job. Since a CSS record may be in another file, or even in files, it can be tricky. I would start by looking at the DIHtmlParser component , which may help here. You will need to analyze the main document and each identified CSS file in order to find the appropriate file / position to jump. I would also consider tEmbeddedWB as an alternative to TWebBrowser, as it provides much more control over the embedded browser, as well as TRichEditWB, which works well for viewing the syntax of a dedicated HTML source.

: CSS HTML CSS. HTML, , , , , CSS. , CSS , , , , .

+2

Source: https://habr.com/ru/post/1737264/


All Articles