【发布时间】:2021-11-14 16:52:43
【问题描述】:
所以我的html代码是这样的结构。
<div className="App">
<header className="App-header">
<Container fileType={this.state.currentFileType} file= this.state.currentFile} />
<Board handleClick={() => this.handleClick()} />
</header>
</div>
这是包含文本的容器 div。数据只是调用一个基本的 .txt 文件,两句话长。
<div className="NoteContainer">
<object data={"/Notes/" + props.file} />
</div>
我的 CSS 看起来像这样
.App{
text-align: center;
background-color: #a461f2;
}
.App-header {
height: 100vh;
width: 100vw;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.NoteContainer {
padding:40px;
display: flex;
text-align: center;
}
由于某种原因,我无法将来自 note1.txt 的文本置于中心位置。任何帮助将不胜感激。
【问题讨论】:
标签: javascript html css center text-align