-
Notifications
You must be signed in to change notification settings - Fork 5k
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
3 种在任何浏览器中使用 CSS 网格的后备方案 #8191
3 种在任何浏览器中使用 CSS 网格的后备方案 #8191
Conversation
非必要不用对代码做格式化哈 - - .. |
这又是ide的功劳,快去骂他 |
校对认领 |
@Chorer 好的~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lsvih @PassionPenguin 校对完毕
|
||
CSS Grid has great support amongst browsers nowadays — roughly 95% for its basic functionality. However, sometimes you can’t ignore that 5%, as you might want your web application’s layout to look great across all browsers. You might even want to use newer Grid features that have less support. | ||
如今,CSS Grid 在浏览器中已经有了强壮的支持基础 —— 支持 Grid 基本功能的浏览器占比约为 95%。不过有时我们可能无法忽略这 5%,因为我们可能希望我们的 Web 应用程序的布局在所有浏览器中都看起来一样的棒,而且我们甚至还可能希望去使用一些支持率较少的较新的 Grid 功能。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如今,CSS Grid 在浏览器中已经有了强壮的支持基础 —— 支持 Grid 基本功能的浏览器占比约为 95%。不过有时我们可能无法忽略这 5%,因为我们可能希望我们的 Web 应用程序的布局在所有浏览器中都看起来一样的棒,而且我们甚至还可能希望去使用一些支持率较少的较新的 Grid 功能。 | |
如今,CSS Grid 在浏览器中已经广受支持 —— 支持 Grid 基本功能的浏览器占比约为 95%。不过有时我们无法忽略剩下的 5%,因为我们可能希望自己的 Web 应用的布局在所有浏览器中看起来都一样的棒,而且我们甚至还可能希望去使用一些支持度较低的新型 Grid 功能。 |
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
校对认领 @lsvih |
@sin7777 欢迎校对~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lsvih @PassionPenguin 校对完毕,要记得更正哈~
|
||
As you can see, the results are 100% equal, but they are very similar. That’s what we are aiming for. As more browsers adopt `subgrid`, more users will be seeing the pixel-perfect version of your layout. | ||
如我们所见,结果是完全一致的,但是它们的实现非常相似,这就是我们的目标。随着越来越多的浏览器采用 `subgrid`,更多的用户都可以看到布局的完美版本! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如你所见,结果虽然看起来是完全一致的,但其实只是非常相似而已,这就是我们的目标。随着越来越多的浏览器采用 subgrid
,更多的用户都可以看到布局的像素级完美版本!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如我们所见,结果是完全一致的,但是它们的实现非常相似,这就是我们的目标。随着越来越多的浏览器采用 `subgrid`,更多的用户都可以看到布局的完美版本! | |
如你所见,结果虽然看起来是完全一致的,但其实只是非常相似而已,这就是我们的目标。随着越来越多的浏览器采用 `subgrid`,更多的用户都可以看到布局的像素级完美版本! |
> * 校对者: | ||
|
||
# 3 Fallback Techniques To Support CSS Grid in Any Browser | ||
# 3 种在任何浏览器中使用 CSS 网格的 Fallback 技术 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 种在任何浏览器中使用 CSS Gird 的后备方案
|
||
The most common usage of Grid is to build multi-dimensional layouts that adapt to the user’s screen resolution. What should you do when the Grid is not available? How can you make a flexible and responsive layout with something other than Grid? | ||
Grid 中最常见的用处是构建适合用户屏幕分辨率的多维栅格布局。但当栅格不可用时该怎么办?除了 Grid 之外,还有什么东西可以帮助我们制作灵活且迅速响应的布局? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同意,我建议是不翻译成中文,仍然用Gird
</html> | ||
``` | ||
|
||
Note that we are not asserting against this Grid feature: `grid-template-columns`. What would happen if the browser doesn’t support it? In that scenario, Grid will fall back to the default positioning algorithm. It will stack the `divs`. For our example, that works, so we won’t need any extra work. | ||
注意,我们并没有断言 Grid 特性 `grid-template-columns`。如果浏览器不支持该怎么办?在这种情况下,Grid 将退回到默认的定位算法 —— 它将堆叠 `div`。在我们的示例中,该方法正常的执行了,因此我们并不需要再去进行别的什么工作。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意,我们并不是反对 Grid 特性 grid-template-columns
。如果浏览器不支持该怎么办?在这种情况下,Grid 将退回到默认的定位算法 —— 它将堆叠 div
。在我们的示例中,该方法可以正常运行,因此我们不需要再去进行额外的工作。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意,我们并没有断言 Grid 特性 `grid-template-columns`。如果浏览器不支持该怎么办?在这种情况下,Grid 将退回到默认的定位算法 —— 它将堆叠 `div`。在我们的示例中,该方法正常的执行了,因此我们并不需要再去进行别的什么工作。 | |
注意,我们并不是反对 Grid 特性 `grid-template-columns`。如果浏览器不支持该怎么办?在这种情况下,Grid 将退回到默认的定位算法 —— 它将堆叠 `div`。在我们的示例中,该方法可以正常运行,因此我们不需要再去进行额外的工作。 |
hhh等人齐一起改要不然校对中间会有特性((((( |
article/2021/3-fallback-techniques-to-support-css-grid-in-any-browser.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Chor <[email protected]>
@PassionPenguin 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。 掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件。 |
收到 |
译文翻译完成,resolve #8171