Proshka Asked:2020-06-26 17:00:21 +0000 UTC2020-06-26 17:00:21 +0000 UTC 2020-06-26 17:00:21 +0000 UTC 为块设置什么属性,使其位于页面中心 772 我正在为菜单制作一个固定块。 .header-fixed { position: fixed z-index: 1000 background-color: #ffffff top: 0 } 问题:如何以任何屏幕分辨率使块居中? css 1 个回答 Voted Best Answer Илья Шишлачев 2020-06-26T18:32:13Z2020-06-26T18:32:13Z .header-fixed { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1000; background-color: #ffffff; }
1 个回答