QOwnNotes icon indicating copy to clipboard operation
QOwnNotes copied to clipboard

How to apply HTML style?

Open it19862 opened this issue 3 years ago • 4 comments

How to apply HTML style? QOwnNotes - 22.6

авпвап

07 06 2022_00-21-13

it19862 avatar Jun 06 '22 21:06 it19862

The QTextBrowser of the preview only supports a limited set of html (see https://doc.qt.io/qt-5/richtext-html-subset.html). Best use the Custom note preview styling script from the script repository to inject styles.

pbek avatar Jun 07 '22 06:06 pbek

In this case your problem is your code. It should be:

<style>
	.divback {
		background-color:brown;
	}
</style>	
<body>
	<div class="divback">
		авпвап
	</div>
</body>

Note it's background-color

ryliejamesthomas avatar Jul 07 '22 10:07 ryliejamesthomas

Hmmm. Actually it does recognise the background shorthand too.

I think your problem is due to you closing the CSS comment twice /* Цвет фона */*/. Remove one instance of */ and it works

ryliejamesthomas avatar Jul 07 '22 11:07 ryliejamesthomas

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 07 '22 02:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Aug 21 '22 02:08 github-actions[bot]