【问题标题】:Elements aligned to right inside 1200px元素在 1200px 内对齐
【发布时间】:2020-04-04 04:42:03
【问题描述】:

目前我在这个网站上有以下页面,在我的屏幕上看起来非常好屏幕截图 #1 但是当调整屏幕大小并测试更大显示器的响应能力时出现问题屏幕截图 #2

我怎样才能在不同的屏幕尺寸上保留此部分?让文字不会移动太远?

谢谢你们!

【问题讨论】:

  • 请添加一些代码并执行您迄今为止尝试过的操作

标签: html css media-queries responsive


【解决方案1】:

在您的主要内容容器样式上,添加max-width: 1200px;。如果您还没有,请将其居中添加margin: 0 auto;

【讨论】:

  • 鉴于他没有提供任何可以测试的标记,你怎么这么肯定会解决他的问题? How To Answer
【解决方案2】:

以css媒体查询为例

@media only screen and (min-width:960px){
        /* styles for browsers larger than 960px; */
        body{
          background: red;
        }
    }

如果你喜欢,你可以使用

@media only screen and (max-width: 600px) {
/* styles for browsers smaller than 960px; */
 /* write your css here*/
}`enter code here`

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-09
    • 1970-01-01
    • 1970-01-01
    • 2017-08-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多