gpt4 book ai didi

html - 使 div 内容响应

转载 作者:太空狗 更新时间:2023-10-29 13:19:32 26 4
gpt4 key购买 nike

我的内容目前没有响应。我已经在 iPhone 上对其进行了测试,文本会在屏幕上显示。

我已经将容器的 CSS 更改为:

#container2 {
width: 960px;
max-width: 90%;
position: relative;
left: 50%;
margin-left: -480px;
line-height: 1.4em;
}

当我在更改后对其进行测试时,内容消失了。我读到 putting max-width:90%;将允许它不超过边界宽度( http://webdesignerwall.com/tutorials/5-useful-css-tricks-for-responsive-design )但显然它没有用。我做错了什么?

最佳答案

试试这个 CSS:

/* Show in default resolution screen*/
#container2 {
width: 960px;
position: relative;
margin:0 auto;
line-height: 1.4em;
}

/* If in mobile screen with maximum width 479px. The iPhone screen resolution is 320x480 px (except iPhone4, 640x960) */
@media only screen and (max-width: 479px){
#container2 { width: 90%; }
}

这里是演示:http://jsfiddle.net/ongisnade/CG9WN/

关于html - 使 div 内容响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12632500/

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