Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 对中固定割台_Html_Css_Positioning - Fatal编程技术网

Html 对中固定割台

Html 对中固定割台,html,css,positioning,Html,Css,Positioning,我正在处理我的投资组合: 我希望文本“Bryan Bell”能够居中显示,但在用户滚动时也能固定 实现这一目标的最佳方式是什么 多谢各位 如果希望图像不在标题上方,请使用此选项 #header { position:fixed; text-align:center; width:100%; } .header { .... position: fixed; top: 0px; width: 100%; background-color: black;

我正在处理我的投资组合:

我希望文本“Bryan Bell”能够居中显示,但在用户滚动时也能固定

实现这一目标的最佳方式是什么


多谢各位

如果希望图像不在标题上方,请使用此选项

#header {
  position:fixed;
  text-align:center;
  width:100%;
}
.header {
   ....
   position: fixed;
   top: 0px;
   width: 100%;
   background-color: black;
   z-index: 300;
}

.app1{
   margin-top: 184px;
}

嘿,现在习惯了这个css*样式表*

.header
位置固定
现在给
左0
右0
顶部0
并给
z索引最大值

.header {
    left: 0;
    position: fixed;
    right: 0;
    text-align: center;
    top: 0;
    z-index: 999;
}

如果你不在问题中包含CSS(而不是链接),这将永远不会帮助其他人。@GeorgeStocker我现在意识到,这是一个n00b错误。我会添加它。@wesleymurch我本来打算添加CSS供其他人查看,但你关闭了它:[很好的尝试,但你仍然可以编辑问题来添加CSS。它是标签下面的“编辑”链接。如果你编辑它,请标记问题(或发表评论),我会看到它,然后为您重新打开它。那么这会使它位于标题下而不是顶部?