gpt4 book ai didi

html - 当@media screen and (max-width : 360px) it should be at center

转载 作者:行者123 更新时间:2023-11-28 09:43:52 25 4
gpt4 key购买 nike

how to center the div content in float right div when it is text-align:left

<html><head></head><body>
<div class="top">top</div>
<div class="fleft"></div>
<div class="fright">
<h1>this is heading</h1>
<p>* test 1test 1test 1 </p>
<p>* test 1test 1test 1 </p>
<p>* test 1test 1test 1 </p>
<p>* test 1test 1test 1 </p>
</div>
</body>
</html>

link

最佳答案

只需将 text-align:center 添加到您的媒体查询中

   @media screen and (max-width : 360px) {

.top{width: 100%;}

.fleft{width: 100%;}

.fright {
width:100%;
text-align:center;
}
}

http://jsfiddle.net/wilsoda/4yv8emm1/

如果您希望内容环绕居中但文本左对齐,只需添加 Inner div 即可。

@media screen and (max-width : 360px) {
.top {
width: 100%;
}
.fleft {
width: 100%;
}
.fright {
width:100%;
}
.inner {
width:70%;
margin:0 auto;
}
}

http://jsfiddle.net/wilsoda/5g2ccd4p/

希望对您有所帮助!

关于html - 当@media screen and (max-width : 360px) it should be at center,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25327187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com