Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

[FEATURE] Better Constant width to height ratio #64

Closed
xialvjun opened this issue Mar 6, 2018 · 3 comments · Fixed by #65
Closed

[FEATURE] Better Constant width to height ratio #64

xialvjun opened this issue Mar 6, 2018 · 3 comments · Fixed by #65

Comments

@xialvjun
Copy link

xialvjun commented Mar 6, 2018

.better-constant-width-to-height-ratio {
  background: #333;
  width: 50%;
}
.better-constant-width-to-height-ratio::before {
  content: ' ';
  display: block;
  padding-top: 100%;
  float: left;
}
.better-constant-width-to-height-ratio::after {
  content: ' ';
  display: block;
  clear: both;
}

No need to worry about padding.

@atomiks
Copy link
Contributor

atomiks commented Mar 6, 2018

Very nice. Please make a PR with these changes and I'll merge ASAP!

@xialvjun
Copy link
Author

xialvjun commented Mar 6, 2018

In fact, I'm lazy. 🙏Orz.
Eh, and my English is not that good, en, that's the excuse.

@xialvjun xialvjun closed this as completed Mar 6, 2018
atomiks added a commit that referenced this issue Mar 6, 2018
@atomiks atomiks mentioned this issue Mar 6, 2018
atomiks added a commit that referenced this issue Mar 6, 2018
@lock
Copy link

lock bot commented Dec 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants