Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed that message headers overflows message body #6

Merged
merged 1 commit into from
Sep 8, 2011
Merged

Fixed that message headers overflows message body #6

merged 1 commit into from
Sep 8, 2011

Conversation

nikitachernov
Copy link
Contributor

Apparently, in some projects message headers can overflow top-part of the rich message body. Tested in Chrome 13, FireFox 6 and Safari 5.

ryanb added a commit that referenced this pull request Sep 8, 2011
Fixed that message headers overflows message body
@ryanb ryanb merged commit 99ef595 into ryanb:master Sep 8, 2011
@ryanb
Copy link
Owner

ryanb commented Sep 8, 2011

I had to revert this because it was causing a large gap at the top while working in Safari. Can you be more clear on what this fixes?

@nikitachernov
Copy link
Contributor Author

Ok, I got it now.

Div '#message_headers' has "position: absolute" property. It means that it floats over the top of the page.
And then at the bottom of the file there are: "body { margin-top: 96px; }".
So, the following happens:

  1. Gap is created manually.
  2. Div '#message_headers' overflows this gap.
  3. Everything looks good... unless someone has "body{ margin: 0; }" set up in their email template and now '#message_headers' hides part of the mail :)

So, in order to make your preview page more agnostic to users' CSS, it's better to use
"position: static;" in '#message_headers' and to remove "body { margin-top: 96px; }".
Then '#message_headers' will push everything down above itself and no manual gap is needed anymore. Sorry for not noticing that from the first time :)

@ryanb
Copy link
Owner

ryanb commented Sep 10, 2011

So if we make it static and then remove the body margin maybe that will improve it? Need to do some testing.

@nikitachernov
Copy link
Contributor Author

Yes, it will. The body margin seems to be the only property that may conflict with users' CSS. Others are wrapped by '#message_headers'.
Thanks!

@josephers
Copy link
Contributor

If we do it this way, #message_headers will be subject to the body padding. This can create a gap around the edges.

Another solution is to specify !important on the margin-top property. (#10)

@ryanb
Copy link
Owner

ryanb commented Sep 12, 2011

Thanks @josephers, I will pull that change in.

@nikitachernov if this does not solve the issue please open a separate issue.

@nikitachernov
Copy link
Contributor Author

Works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants