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

<hr> not expanding full width (special case) #434

Open
iamsankalp opened this issue May 11, 2016 · 10 comments
Open

<hr> not expanding full width (special case) #434

iamsankalp opened this issue May 11, 2016 · 10 comments

Comments

@iamsankalp
Copy link
Contributor

The following code inside a will give only a half width 'hr' separator. As soon as you write anything with <hr> like &nbsp; it'll be full width.
How can we reproduce this bug?

<row>
      <columns>
        <hr>
      </columns>
</row>

What did you expect to happen?
Expand full width

What happened instead?
Only expands to half columns width.

What email clients does this happen in?
Tested in browser so far

@cossssmin
Copy link

I can confirm this to be happening in Outlook 2013, and web Gmail (Chrome).

Looking at the source code, this happens when you have the <hr> row after a row of two columns. It's set to display: table-cell and it spans just one cell width (if it were to have colspan defined, it would work, but that's not ideal).

Also, this is the markup you end up with, based on the example given by @iamsankalp above:

<table class="row collapse" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
  <tbody>
    <tr style="padding:0;text-align:left;vertical-align:top">
      <hr style="Margin:15px auto;clear:both;font-size:1px;height:1px;line-height:1px;">
    </tr>
  </tbody>
</table>

... which is invalid markup, because there is a missing <td> that needs to wrap the <hr />

@rafibomb
Copy link
Member

Might have to do with the .expander that is right after the <hr>. Can you remove it and let us know if it solves this? If so we can build this into Inky

@iamsankalp
Copy link
Contributor Author

@hellocosmin Thanks for jumping in.
@rafibomb Yup, removing the whole <th class="expander"> fixes it. Just checked.

@rafibomb
Copy link
Member

Ok, so looking at how <hr>'s behave, it seems like the only time this is happening is when a set of row's and columns surround the <hr>. There may be a way in Inky to eliminate the .expander for this case.

For now, using an <hr> without a nested row and column seems to work well.

Case tested - working as expected

<container>
  <row>
    <columns small="12">
      <hr>
      <h1 class="text-center">{{title}}</h1>
    </columns>
  </row>

@rafibomb
Copy link
Member

Similar issue here with buttons: #415

@iamsankalp
Copy link
Contributor Author

Just in case, someone needs - this is what i'm using until a permanent fix

      <row>
        <columns>
          <p class="hr-fix">&nbsp;</p>
          <hr>
        </columns>
      </row>
.hr-fix{
  line-height: 0px !important;
}

@rafibomb rafibomb modified the milestones: 2.1.1, 2.2.0 May 23, 2016
@rafibomb rafibomb added this to the 2.2.0 milestone Jun 10, 2016
@axelson
Copy link

axelson commented Jul 1, 2016

Is this fixed by foundation/inky#29 ?

@rafibomb rafibomb modified the milestones: 2.2.0, 2.3 Jul 8, 2016
@rafibomb rafibomb removed this from the 2.2.0 milestone Jul 8, 2016
@cossssmin
Copy link

@axelson yes it is, using it in production.

@axelson
Copy link

axelson commented Sep 30, 2016

Then this should be marked as closed right?

@rafibomb rafibomb added button and removed button labels Nov 4, 2016
@rafibomb
Copy link
Member

rafibomb commented Nov 4, 2016

We'd like to close this - if it's resolved out of the box. Using the no-expander attribute is a workaround but not a solution in my mind. Can anyone confirm it's resolved?

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

No branches or pull requests

4 participants