From 76d9d0bbb9f539f7e543856974da6b7b76cf4ca6 Mon Sep 17 00:00:00 2001 From: Alexey Zakharenkov Date: Wed, 3 Nov 2021 23:30:32 +0300 Subject: [PATCH] Fix html layout so that tooltips stay inside window viewport --- v2h_templates.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v2h_templates.py b/v2h_templates.py index eb825f1..bcec823 100644 --- a/v2h_templates.py +++ b/v2h_templates.py @@ -52,8 +52,8 @@ tr:hover td:nth-child(n+2) { td { border-radius: 2px; } -td div+div { - margin-top: 0.8em; +td > div { + margin-bottom: 0.8em; } .tooltip { font-weight: bold; @@ -68,7 +68,7 @@ td div+div { content: attr(data-text); position: absolute; top: 100%; - transform: translateX(-50%); + left: 0; margin-top: 14px; width: 200px; padding: 10px; @@ -86,7 +86,7 @@ td div+div { position: absolute; margin-top: -5px; top: 100%; - transform: translateX(-50%); + left: 30px; border: 10px solid #000; border-color: transparent transparent lightblue transparent; visibility: hidden;