Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Master branch has "em" CSS unit broken? #411

Copy link
Copy link
Closed
@martinrotter

Description

@martinrotter
Issue body actions

I am an author of RSS Guard app.

Here is comparison of two screenshots:

with litehtml 0.9

Image

with litehtml latest master branch

Image

You see there is a clear difference in margins/paddings in almost all HTML elements (bottom right part of the app GUI on the screenshots). All other "container" code and everything is exactly the same.

Here is the sample HTML loaded into the viewer. You can see that almost all CSS rules use em as an unit and to me it seems that latest master branch litehtml does not take display em units properly. In fact I believe that they are somehow ignored entirely. When I replaced em units with px units of "same" size, the rendered output suddenly starts looking as expected.

<!DOCTYPE html>
<html lang="en">
<head>
<title>workaround #1770 for rssguard, unified qdomdocument usages </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
img {
  max-width: 98%;
}

p {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}

.article {
  background-color: transparent;
  color: #333;
  line-height: 1.1;
  padding: 0em;
}

.article h1,
.article h2,
.article h3,
.article h4,
.article h5,
.article h6 {
  color: #222;
  margin-top: 0em;
  margin-bottom: 0.2em;
}

.article-body a {
  color: #50a5c2;
  text-decoration: none;
}

.article-body a:hover {
  color: #89c2d6;
  text-decoration: underline;
}

.article-urls-strip {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  line-height: 2.2;
}

.article-url {
  text-decoration: none;
  padding: 0.1em 0.2em;
  border-radius: 2px;
  border: 1px solid red;
  background-color: red;
  color: white;
}

.article-url:hover {
  background-color: #ff4d4d;
  color: white;
}

.article-enclosure-url {
  text-decoration: none;
  text-transform: uppercase;
  padding: 0.1em 0.2em;
  border-radius: 2px;
  border: 1px solid #3c8aa4;
  background-color: #3c8aa4;
  color: white;
}

.article-enclosure-url:hover {
  background-color: #66afc7;
  color: white;
}

</style>
</head>
<body>
<div class="article" dir="ltr" id="153277">
    <section class="article-header">
        <h1>workaround #1770 for rssguard, unified qdomdocument usages </h1>
        <div>martinrotter • 20.6.2025 7.56</div>
        <div class="article-urls-strip"><a class="article-url" href="https://github.com/martinrotter/rssguard/commit/7cf3f0ee6136de80fb7c8a96aec6303291b1f171">URL</a>&nbsp;&nbsp;<a class="article-enclosure-url" href="https://avatars.githubusercontent.com/u/1255302?s=30&v=4">image/jpg</a></div>
        <div><a href="https://avatars.githubusercontent.com/u/1255302?s=30&v=4">
  <img alt="image/jpg"
       src="https://avatars.githubusercontent.com/u/1255302?s=30&v=4"
       style="max-height: 90px;">
</a></div>
    </section>
    <div class="article-body">
        
      <pre style='white-space:pre-wrap;width:81ex'>workaround #1770 for rssguard, unified qdomdocument usages</pre>
    
    </div>
</div>
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.