0

这是分辨率为 1152*864 的页面

这是显示分辨率为 1152*864 的屏幕

在我将其更改为 1024*768 后的同一屏幕,事情变得一团糟,我尝试将container-fluid宽度设置为静态值,响应式设计被破坏了。

我不知道我哪里错了。

页面分辨率1024*768

更新:

<div class="span11" style="margin-top:4%;padding-left:5%;padding-right:5%;"> 
    <ul class="nav nav-pills" style="background-color: rgba(0, 4, 10, 0.71);padding: 5px;border-radius: 11px;"> 
    <li class="active"><a href="#" style="font-size: 18px;font-family: cursive;">Heading 1</a></li> 
    <li class="pull-right"><a href="#" style="font-size: 18px;font-family: cursive;">Heading 6</a></li> 
    </ul> 
</div>
4

4 回答 4

0

无法看到您的代码,我只能提出一些一般性建议:

  1. 用于margin: 0 auto;在页面上水平居中项目。
  2. 用于max-width定义页面上项目的最大宽度。
  3. 使用@media查询在您的设计中创建断点。

    header{
        max-width: 960px;  /* The maximum width for your header item. */
        margin: 0 auto;    /* Center the header on the page. */
    }
    
    @media (max-width: 320px){
        header{
            /* Styles for screens less that 320px wide. */
        }
    }
    

将其用作使简单设计响应式的粗略指南。另请注意,如果max-width 不起作用,请尝试设置width: 100%;display: block;

于 2013-07-29T13:25:16.783 回答
0

这是Ethan Marcotte 的一本关于响应式设计的好书。它将涵盖如何制作响应式网格、响应式图像和媒体查询的所有主题 + 这只有 150 页的小型免费 pdf:D

于 2013-07-29T13:27:24.920 回答
0

来自 css-tricks 的标准设备的媒体查询:

http://css-tricks.com/snippets/css/media-queries-for-standard-devices/

/* Smartphones (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px) {
/* Styles */
}

/* Smartphones (landscape) ----------- */
@media only screen 
and (min-width : 321px) {
/* Styles */
}

/* Smartphones (portrait) ----------- */
@media only screen 
and (max-width : 320px) {
/* Styles */
}

/* iPads (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) {
/* Styles */
}

/* iPads (landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) {
/* Styles */
}

/* iPads (portrait) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) {
/* Styles */
}

/* Desktops and laptops ----------- */
@media only screen 
and (min-width : 1224px) {
/* Styles */
}

/* Large screens ----------- */
@media only screen 
and (min-width : 1824px) {
/* Styles */
}

/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
}
于 2013-07-29T13:54:51.603 回答
0

尝试为 Heading 6 元素添加一些边距右长度。也许这可以解决你的问题。例子:

<style> li.pull-right {margin-right:1cm} </style>

于 2013-07-29T14:21:32.687 回答