- Newest
- Most votes
- Most comments
A technical reason why the ::after { content: "..."; } CSS hack fails is CSS Sanitization. When you upload a custom CSS file to Cognito, the service runs a validation and sanitization script. AWS strictly filters the CSS and removes any properties that are not on their explicit "allow-list."
The content property, along with most selectors for pseudo-elements, is stripped out for security reasons and to maintain UI integrity. Therefore, even if your CSS file is accepted during the upload process, the text will simply not render in the frontend.
Bottom Line: Since the Classic Hosted UI has reached its technical limit, you have two options:
Option 1 - Upgrade to Cognito "Managed Login" (Recommended): AWS has introduced a newer version of the Hosted UI (Managed Login). While it still doesn't allow raw HTML injection, it has built-in support for Terms of Service and Privacy Policy links. You configure these URLs at the App Client level, and Cognito will automatically render them as clickable links in the footer. This is the "low-code" path to meeting legal requirements.
Option 2 - Custom UI: If you need specific plaintext (like a custom copyright year) or a very specific layout that even Managed Login doesn't provide, then building a custom UI via Amplify/SDK is indeed the only way.
Relevant content
- asked 3 years ago
- asked 3 years ago

If my answer helped solve your problem, I would appreciate it if you click on “accepted answer”