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

在不使用 display:table 的情况下 让table-row适应宽度 #10

Open
fisker opened this issue Nov 16, 2017 · 0 comments
Open

在不使用 display:table 的情况下 让table-row适应宽度 #10

fisker opened this issue Nov 16, 2017 · 0 comments

Comments

@fisker
Copy link
Owner

fisker commented Nov 16, 2017

应该不是很实用 但想了很久才搞定

关键代码:

::before {
  /* 
    make sure content reach max-width of cell.
    letter-spacing / font-size can be useful.
   */
  content: "fisker is a genius."; 
  word-break: break-all; 
  display: block;
  height: 0;
  overflow: hidden;
}

demo: https://jsfiddle.net/fisker/g6a4647z/4/

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

No branches or pull requests

1 participant