反应迅速的网页设计/容器
我正在创建一个网站以显示数据使用情况,但是当我调整窗口大小时,该页面根本没有响应。有什么办法可以为此添加响应式包装器或CSS样式,因此如果我使窗口较小,它会响应吗?同样,如果有一种方法可以在一定量的数字后添加从MB到GB的转换,它也将减少数字的长度。
这是原始代码:
<Row className="box-container">
<div className="box" >
{this.props.loading?this.renderSpinner():null}
{textDisplay}
<Row>
<p>Active </p>
</Row>
<Row>
<p>Inactive </p>
</Row>
<Row>
<p>Suspend </p>
</Row>
</div>
<div className="box">
Current Period Usage
{this.props.loading?this.renderSpinner():null}
<h2>17777777777777777777777777777777777777777777777777MB</h2>
</div>
<div className="box">
Added This Period
</div>
</Row>
和CSS文件看起来像这样:
.box-container{
margin: auto;
width:85%;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
grid-template-rows: minmax(auto, auto);
grid-auto-flow: dense;
grid-gap:20px
}
.box-container .box {
border-radius: 15px;
border: 3px solid black;
padding: 20px;
display: grid;
place-items: center;
text-align: center;
grid-column: unset;
grid-row: unset;
}
I am creating a website to display data usage but when i resize the window, the page is not responsive at all. Is there any way I can add a responsive wrapper or CSS style to this so it is responsive if I made the window smaller? Also if there is a way to add a convertion from MB to GB after a certain amount of number it will also reduce the length of the number.
Here is the original code:
<Row className="box-container">
<div className="box" >
{this.props.loading?this.renderSpinner():null}
{textDisplay}
<Row>
<p>Active </p>
</Row>
<Row>
<p>Inactive </p>
</Row>
<Row>
<p>Suspend </p>
</Row>
</div>
<div className="box">
Current Period Usage
{this.props.loading?this.renderSpinner():null}
<h2>17777777777777777777777777777777777777777777777777MB</h2>
</div>
<div className="box">
Added This Period
</div>
</Row>
And the CSS file looks like this:
.box-container{
margin: auto;
width:85%;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
grid-template-rows: minmax(auto, auto);
grid-auto-flow: dense;
grid-gap:20px
}
.box-container .box {
border-radius: 15px;
border: 3px solid black;
padding: 20px;
display: grid;
place-items: center;
text-align: center;
grid-column: unset;
grid-row: unset;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用Word-break: https://developer.mozilla.org.org.org.org.org.org.org.org.org.org /en-us/doc/web/css/word-break 。在CSS样式表中添加单词break
use word-break: https://developer.mozilla.org/en-US/docs/Web/CSS/word-break. In CSS stylesheet add the word-break