Skip to content

Commit d3c1ab8

Browse files
Copilotulysses4ever
andcommitted
Fix text overflow with left/right positioning for absolutely positioned div
Co-authored-by: ulysses4ever <[email protected]>
1 parent e659a3f commit d3c1ab8

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

docs/assets/css/dark-mode.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,15 @@ body.dark-mode #newsplash::before {
155155
}
156156

157157
/* Ensure content is above the overlay and constrain width to prevent overflow */
158-
/* Parent container is 880px, using 860px provides 20px margin for proper text wrapping */
159-
body.dark-mode #newsplash > div {
160-
position: relative;
158+
/* The text div is absolutely positioned, so we need to constrain it with explicit left/right */
159+
/* Parent container is 880px wide, text should wrap within it with proper margins */
160+
body.dark-mode #newsplash > div[style*="position:absolute"] {
161+
position: absolute !important; /* Keep original positioning */
161162
z-index: 1;
162-
max-width: 860px; /* Allow wrapping on smaller screens */
163-
width: 100%;
163+
left: 0 !important;
164+
right: 20px !important; /* 20px margin on the right to prevent overflow */
165+
padding-left: 20px; /* Match the left padding to keep text centered */
166+
padding-right: 20px; /* Additional padding for safety */
164167
box-sizing: border-box;
165168
}
166169

0 commit comments

Comments
 (0)