Skip to content
New issue

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

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

Already on GitHub? # to your account

实现宽高比例固定的 div #378

Open
lzxjack opened this issue Jan 12, 2023 · 2 comments
Open

实现宽高比例固定的 div #378

lzxjack opened this issue Jan 12, 2023 · 2 comments

Comments

@lzxjack
Copy link
Contributor

lzxjack commented Jan 12, 2023

No description provided.

@lzxjack
Copy link
Contributor Author

lzxjack commented Jan 12, 2023

<div class="box"></div>

<style>
  .box {
    background-color: red;
    width: 500px;
  }
  .box::after {
    display: block;
    content: '';
    padding-top: 50%;
  }
</style>

@bey1995
Copy link

bey1995 commented Sep 17, 2024

px不就是固定的吗?
题目是怎么描述的呀?

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

No branches or pull requests

2 participants