|
13 | 13 | background-color: #fafafa; |
14 | 14 | margin: 0; |
15 | 15 | padding: 0; |
| 16 | + overflow-x: hidden; /* Prevent page-wide horizontal scrolling */ |
16 | 17 | } |
17 | 18 |
|
18 | 19 | main { |
|
22 | 23 | background-color: white; |
23 | 24 | border-radius: 8px; |
24 | 25 | box-shadow: 0 2px 8px rgba(0,0,0,0.05); |
| 26 | + overflow-x: hidden; /* Prevent container horizontal scrolling */ |
25 | 27 | } |
26 | 28 |
|
27 | 29 | h1, h2, h3 { |
|
68 | 70 | text-decoration: underline; |
69 | 71 | } |
70 | 72 |
|
71 | | - /* ✅ Scrollable long equations */ |
72 | | - .math-display { |
| 73 | + /* ✅ Scrollable long equations - MathJax 3.x */ |
| 74 | + /* Target MathJax display math containers (various formats) */ |
| 75 | + .MathJax-Display, |
| 76 | + .MathJax_Display, |
| 77 | + div.MathJax_Display, |
| 78 | + mjx-container[jax="CHTML"][display="true"], |
| 79 | + mjx-container[display="true"] { |
| 80 | + display: block !important; |
| 81 | + width: 100% !important; |
| 82 | + max-width: 100% !important; |
73 | 83 | overflow-x: auto !important; |
74 | | - overflow-y: hidden; |
75 | | - max-width: 100%; |
76 | | - -webkit-overflow-scrolling: touch; |
| 84 | + overflow-y: hidden !important; |
| 85 | + margin: 1em 0 !important; |
| 86 | + box-sizing: border-box; |
77 | 87 | } |
78 | 88 |
|
79 | | - .math-display > .MathJax { |
80 | | - padding-bottom: 0.5rem; |
| 89 | + /* Ensure the MathJax content itself can scroll horizontally */ |
| 90 | + /* Math content should maintain its natural width to allow scrolling */ |
| 91 | + mjx-container[jax="CHTML"][display="true"] > mjx-math, |
| 92 | + mjx-container[display="true"] > mjx-math { |
| 93 | + display: inline-block; |
81 | 94 | } |
82 | 95 |
|
83 | | - .math-display::-webkit-scrollbar { |
| 96 | + /* Style scrollbar for better UX on display equations */ |
| 97 | + /* Webkit browsers (Chrome, Safari, Edge) */ |
| 98 | + .MathJax-Display::-webkit-scrollbar, |
| 99 | + .MathJax_Display::-webkit-scrollbar, |
| 100 | + div.MathJax_Display::-webkit-scrollbar, |
| 101 | + mjx-container[jax="CHTML"][display="true"]::-webkit-scrollbar, |
| 102 | + mjx-container[display="true"]::-webkit-scrollbar { |
84 | 103 | height: 8px; |
85 | 104 | } |
86 | | - .math-display::-webkit-scrollbar-thumb { |
| 105 | + |
| 106 | + .MathJax-Display::-webkit-scrollbar-thumb, |
| 107 | + .MathJax_Display::-webkit-scrollbar-thumb, |
| 108 | + div.MathJax_Display::-webkit-scrollbar-thumb, |
| 109 | + mjx-container[jax="CHTML"][display="true"]::-webkit-scrollbar-thumb, |
| 110 | + mjx-container[display="true"]::-webkit-scrollbar-thumb { |
87 | 111 | background: #ccc; |
88 | 112 | border-radius: 4px; |
89 | 113 | } |
| 114 | + |
| 115 | + .MathJax-Display::-webkit-scrollbar-thumb:hover, |
| 116 | + .MathJax_Display::-webkit-scrollbar-thumb:hover, |
| 117 | + div.MathJax_Display::-webkit-scrollbar-thumb:hover, |
| 118 | + mjx-container[jax="CHTML"][display="true"]::-webkit-scrollbar-thumb:hover, |
| 119 | + mjx-container[display="true"]::-webkit-scrollbar-thumb:hover { |
| 120 | + background: #999; |
| 121 | + } |
| 122 | + |
| 123 | + /* Firefox scrollbar styling */ |
| 124 | + .MathJax-Display, |
| 125 | + .MathJax_Display, |
| 126 | + div.MathJax_Display, |
| 127 | + mjx-container[jax="CHTML"][display="true"], |
| 128 | + mjx-container[display="true"] { |
| 129 | + scrollbar-width: thin; |
| 130 | + scrollbar-color: #ccc transparent; |
| 131 | + } |
| 132 | + |
| 133 | + /* Ensure inline math doesn't break layout */ |
| 134 | + mjx-container:not([display="true"]) { |
| 135 | + display: inline-block; |
| 136 | + max-width: 100%; |
| 137 | + overflow-x: auto; |
| 138 | + vertical-align: middle; |
| 139 | + } |
90 | 140 | </style> |
91 | 141 | </head> |
92 | 142 |
|
|
0 commit comments