fix(ink): prevent content overflow on mobile viewports
Five targeted fixes applied to all 11 ink templates: 1. Convert table/tr/tbody to display:block on mobile so the block-level stacking of <td> elements works correctly. 2. Add box-sizing:border-box to all <td> elements to prevent padding from pushing content beyond the viewport width. 3. Add word-break:break-word + overflow-wrap:break-word to table, td, th elements to force long text to wrap. 4. Add white-space:pre-wrap + word-break:break-all to <pre> and <code> to prevent horizontal scroll from code blocks. 5. Add max-width:100% + height:auto to all images, and max-width:100% to nested tables. 6. Remove invalid table-layout:fixed from <center> tag (was CSS property on wrong element — had no effect). Also reduced mobile padding from 28px to 16px for more usable content width on narrow screens. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
f2a3c0f033
commit
433b5f9259
11 files changed
+121
-33
No files matched your search
@@ -57,17 +57,25 @@
|
||||
|
||||
/* Responsive */
|
||||
@media only screen and (max-width:480px) {
|
||||
/* Stack layout — convert table rows to blocks */
|
||||
.email-wrap,.email-wrap tbody,.email-wrap tr{ display:block!important;width:100%!important }
|
||||
.email-wrap td{ box-sizing:border-box!important }
|
||||
.email-header { padding-left:16px!important;padding-right:16px!important }
|
||||
.email-card { width:100%!important;display:block!important;border-left:none!important;padding-left:28px!important;padding-right:28px!important;padding-top:0!important }
|
||||
.email-sidebar { width:100%!important;display:block!important;padding:0 28px 16px!important;border-left:none!important;border-top:1px solid #ddd!important }
|
||||
.email-card { width:100%!important;display:block!important;border-left:none!important;padding:0 16px 16px!important }
|
||||
.email-sidebar { width:100%!important;display:block!important;padding:0 16px 16px!important;border-left:none!important;border-top:1px solid #ddd!important }
|
||||
.email-btn { display:block!important;width:auto!important;text-align:center!important }
|
||||
.email-footer { padding-left:16px!important;padding-right:16px!important }
|
||||
/* Prevent content overflow */
|
||||
.email-wrap,.email-wrap td,.email-wrap th{ word-break:break-word!important;overflow-wrap:break-word!important }
|
||||
img{ max-width:100%!important;height:auto!important }
|
||||
pre,code{ white-space:pre-wrap!important;word-break:break-all!important }
|
||||
table{ max-width:100%!important }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="margin:0;padding:0;background:#ede4d4;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;">
|
||||
<center style="width:100%;table-layout:fixed;">
|
||||
<center style="width:100%;">
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="email-wrap">
|
||||
|
||||
<!-- Floating Title -->
|
||||
|
||||
Reference in new issue
Block a user