Default body styling

If I run a new, empty, project (i.e. no Bootstrap, and no other CSS library specified) there is default font styling injected into the body tag - how do I prevent this?

In fact, I notice that the html tag also has some inline styling with height = 100% - seems an odd thing to do. I'd rather not have any inline.

Thanks, Bob

We don't see the behavior you are experiencing, can you provide us with a screenshot of the HTML?

Hi Pieter

Below is a screenshot of the Elements view (it's not visible in the source view). This is a new project - simply created and immediately executed. The main form has CSSLibrary = cssNone.

image

If I set CSSLibrary = cssBootstrap then I get:

image

I.e. the inline styling of the body has gone but is still present for the html tag. Given that inline over-rides external files there shouldn't be any inline at all.

Using v2.4.5.3/Delphi 12/Chrome browser.

Cheers, Bob

Quick update: If I revert to CSSLibrary = cssNone and run it again the body inline styling remains absent.

Update 2: I can work around it by setting ElementFont = efCSS (after adding WebLib.Controls to the uses). This gets set after setting CSSLibrary = cssBootstrap, but doesn't revert to efProperty after switching back to cssNone. My main form contained only WebLib.Forms since I design everything in HTML and this has conflicted with the form settings where properties appear to be implemented using inline styles.

Would be good to have an option CSSLibrary = cssExternalFiles which then sets ElementFont = efCSS which lets the system know it shouldn't inject inline styling.

Cheers, Bob

It is by design that when Form.ElementFont = efProperty, the form's Font property is used for the BODY inline style. If you do not want this, set Form.ElementFont = efCSS.