css - 如何在站点中间居中文本并删除滚动条?
问题描述
我需要这个文本在网站的中心,但它是对齐的。
<!DOCTYPE html>
<style>
::selection { opacity:.1; background:rgba(255, 255, 255,0.3) }
body {
background-color:#9999ff;
color:white;
font-family:arial;
font-size:100px;
font-weight:;
}
div.container4 {
height: 10em;
position: relative }
div.container4 p {
margin: 0;
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%) }
}
</style>
<div class=container4>
<p><font style="font-weight:bold;">Project</font> Lavender<br><font style="font-size:60px;">Coming 2019
</div>
当我使用它时,会出现一个滚动条。我不想只是将它删除,而是让它无论如何都不会出现。下面是滚动条的 图片 在此处输入图片说明
解决方案
只需将其添加到正文中:
overflow: hidden;
推荐阅读
- javascript - 让 Javascript 代码更小更优化
- git - VS19 为 Git 分支名称添加大写
- java-8 - 在 flink 可查询状态 [version-1.7.2] 下没有得到查询响应
- python - 如何使用最接近的值在 3D numpy 数组中组合 NaN 的前向和后向填充?
- python - 如何有效地从 redis 中获取与模式匹配且小于某个值的所有键
- node.js - 使用 Parcel V2 (modern-syslog) 捆绑节点二进制文件
- c++ - 在多级继承中表达虚拟祖先
- java - 在 Deque 中打印最大元素
- javascript - 刷新页面,直到它更改 chrome 扩展
- python - Systemparsenow 让我的壁纸变黑