简体   繁体   English

styles 跨平台的差异(Windows 和 OSX)

[英]Difference in styles across platforms (Windows and OSX)

I have a antd table in react but the styles for it differ across platforms (Windows and OSX).我有一个 antd 表,但 styles 因平台(Windows 和 OSX)而异。 The bottom line that separates two rows is not completely straight on Windows while it is straight on OSX.分隔两行的底线在 Windows 上并不完全笔直,而在 OSX 上是笔直的。 I've attached a picture for how it appears on Windows machine.我附上了一张图片,说明它在 Windows 机器上的显示方式。

CSS 故障

Has anyone faced a similar problem?有没有人遇到过类似的问题?

Looks like custom height got applied to 3rd and 4th column - Removing that height or setting it to auto might resolve issue.看起来自定义高度已应用于第 3 列和第 4 列 - 删除该高度或将其设置为自动可能会解决问题。

If possible share css and html snippet.如果可能,分享 css 和 html 片段。

Are you using same browser in both platforms?您是否在两个平台上使用相同的浏览器? And is it a border of a cell?它是单元格的边界吗?

I think you need to apply same CSS to all cells, with a min-width and a max-width , or just a fixed width .我认为您需要将相同的 CSS 应用于所有单元格,具有min-widthmax-width ,或者只是一个 fixed width

Attention: look at your padding too, it's maybe the problem.注意:也请查看您的padding ,这可能是问题所在。

Did you try Normalize.css or reset.css for better cross-browser consistency?您是否尝试过Normalize.css 8CBA22E28EB17B5F5C6AE2A266AZ 或reset.css以获得更好的跨浏览器一致性?

I once faced some issues in safari/firefox browser but my layout was fine in chrome.我曾经在 safari/firefox 浏览器中遇到过一些问题,但我的布局在 chrome 中很好。 So, I used reset.css to get rid of the inconsistencies.因此,我使用reset.css来消除不一致。

index.css索引.css

@import url("./reset.css"); /* path to reset.css */
...
...
/* rest of your code */

(I posted this answer when OP had not stated whether the issue persists when using the same browser or using different browsers across the platforms) (当OP没有说明使用相同浏览器或跨平台使用不同浏览器时问题是否仍然存在时,我发布了这个答案)

PS: Either use reset.css or Normalize.css PS:要么使用reset.cssNormalize.css 8CBA22E28EB17B5F5C6AE2A266AZ

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM