You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h1>Background Position Bottom/Right Alignment Fix</h1>
70
+
71
+
<p>This demonstrates the fix for background-position alignment. Each box shows a 30x30px gradient positioned in different corners of a 150x100px container.</p>
72
+
73
+
<divclass="demo-container">
74
+
<div>
75
+
<divclass="test-box bottom-right-keywords"></div>
76
+
<divclass="description">
77
+
<code>background-position: right bottom;</code><br>
78
+
<spanclass="success">✓ Bottom-right corner</span>
79
+
</div>
80
+
</div>
81
+
82
+
<div>
83
+
<divclass="test-box bottom-right-percent"></div>
84
+
<divclass="description">
85
+
<code>background-position: 100% 100%;</code><br>
86
+
<spanclass="success">✓ Should match right bottom</span>
87
+
</div>
88
+
</div>
89
+
90
+
<div>
91
+
<divclass="test-box top-right-percent"></div>
92
+
<divclass="description">
93
+
<code>background-position: 100% 0%;</code><br>
94
+
<spanclass="success">✓ Top-right corner</span>
95
+
</div>
96
+
</div>
97
+
98
+
<div>
99
+
<divclass="test-box bottom-left-percent"></div>
100
+
<divclass="description">
101
+
<code>background-position: 0% 100%;</code><br>
102
+
<spanclass="success">✓ Bottom-left corner</span>
103
+
</div>
104
+
</div>
105
+
</div>
106
+
107
+
<h2>Fix Summary</h2>
108
+
<p><strong>Issue:</strong> Background images with percentage positions (like <code>100% 100%</code>) were not aligning flush with element edges.</p>
109
+
<p><strong>Solution:</strong> Enhanced the <code>calculateBackgroundPosition</code> function to properly detect and handle percentage values in two-value background-position syntax.</p>
0 commit comments