2014-07-11 136 views
0

我在固定布局网站上遇到问题。在固定布局网站上获取网站宽度错误

我已经手动编码它,不知道如何解决它。我仍处于学习阶段。 你能告诉我我做错了什么吗?

问题:http://i.stack.imgur.com/jhDae.jpg 您可以检查工作here。上传的文件释放域名。

或检查JS fiddle ...

<div class="navbar"> 
    <div class="wrapper"> 
     <h3><a class="" href="#intro">Nature Experience</a></h3> 
    </div> 
</div> 
<section id="intro"> 
    <div class="wrapper slogan"> 
     <h2>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type </h2> 
    </div> 
</section> 
<section id="second"> 
    <div class="wrapper"> 
     <h3 class="">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type </h3> 
     <p class=" ">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type </p> 
     <div class="container"> 
      <div class="blogcontainer "> 
       <div class="row"> 
        <div class="text"> 
         <strong class="">Lorem Ipsum is simply dummy</strong> 
         <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> 
        </div> 
       </div> 
       <div class="row"> 
        <div class="text"> 
         <strong class="">Lorem Ipsum is simply dummy</strong> 
         <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> 
        </div> 
       </div> 
       <div class="row"> 
        <div class="text"> 
         <strong class="">Lorem Ipsum is simply dummy</strong> 
         <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
</section> 
<section id="contact"> 
    <div class="wrapper"> 
     <h3 class="">Lorem Ipsum is simply dummy text of the printing</h3> 
     <div class="container"> 
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> 
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> 
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> 
     </div> 
    </div> 
</section> 
<section id="footer"> 
    <div class="wrapper"> 
     <div class="left"> 
      <a href="#">CONTACT</a> 
     </div> 
    </div> 
</section> 


/*Reset css*/ 
html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, 
ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, 
thead, tr, th, td,article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary,time, mark, audio, video { 
    margin: 0; 
    padding: 0; 
    border: 0; 
    font-size: 100%; 
    font: inherit; 
    vertical-align: baseline; 
} 
/* HTML5 display-role reset for older browsers */ 
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { 
    display: block; 
} 
body { 
    line-height: 1; 
} 
ol, ul { 
    list-style: none; 
} 
blockquote, q { 
    quotes: none; 
} 
blockquote:before, blockquote:after, 
q:before, q:after { 
    content: ''; 
    content: none; 
} 
table { 
    border-collapse: collapse; 
    border-spacing: 0; 
} 
body, html { 
    height: 100%; 
} 
body{ 
    font-family: 'Arvo', serif; 
    text-align: center; 
} 
h3{ 
    font-size: 30px; 
} 
.wrapper{ 
    width: 1140px; 
    margin: 0 auto; 
} 
.container{ 
    width: 1100px; 
    padding: 10px 20px; 
    float: left; 
} 
.navbar { 
    margin: 0; 
    padding: 15px 20px; 
    position: fixed; 
    width: 100%; 
    background: #fff; 
    z-index: 999; 
} 
#intro { 
    background: url("http://hdwallpaperszon.in/wp-content/uploads/2014/06/HD-Black-Car-Wallpaper_31.jpg") no-repeat fixed 50% 0/cover rgba(0, 0, 0, 0); 
    margin: 0; 
    position: relative; 
    width: 100%; 
    height: 100%; 
} 
#intro h2 { 
    font-size: 24px; 
} 
#intro .slogan { 
    padding-top: 130px; 
} 
#second{ 
    float: left; 
    width: 100%; 
    padding: 65px 0 55px; 
    background: #666666; 
    color: #fff; 
} 
#second .blogcontainer{ 
    float: left; 
} 
#second .blogcontainer .row{ 
    float: left; 
    text-align: left; 
    padding: 10px 0; 
} 
#second .blogcontainer .row .text{ 
    font-size: 18px; 
    line-height: 26px; 
    padding: 14px 0; 
} 
#contact{ 
    float: left; 
    width: 100%; 
    padding: 65px 0 70px; 
    background: #ECE8E1; 
    color: #000; 
} 
#footer{ 
    float: left; 
    width: 100%; 
    padding: 20px 0 35px; 
    background: #666666; 
    color: #fff; 
} 
#footer .left{ 
    float: left; 
    width: 50%; 
    text-align: left; 
    padding-top: 25px; 
} 
#footer .left a{ 
    color: #fff; 
    font-size: 20px; 
} 

感谢

+0

请参阅http://stackoverflow.com/help/mcve – Mooseman

+0

张贴图像不会帮助请小提琴和问你的问题吗? –

+0

似乎在Firefox(?) – ggdx

回答

1

尝试做看差异this

CSS

body { 
min-width: 1140px; 
} 
+0

否:(通过这个网站将变得响应,我需要它是固定的,没有内容包装。 。你在脸书上看到,当你减少浏览器的宽度/分辨率时,内容不会换行,但会出现一个水平滚动条..我需要。 –

+0

检查[this](http:// jsfiddle。净/ mDFN8/4 /) – Tushar

+0

是的:)但我不明白为什么身体要求最小宽度?你能解释一下吗? –

0

我认为你已经使用用于身体或容器分割宽度像素。尝试%为宽度。

例如

body or container (which u have used) { 
width:100%; 
margin-left:auto; 
margin-right: auto; 
} 

另请参阅图像大小的宽度和高度。它应该是%而不是像素,因为它是具有固定大小的单个图像。

因为您的示例页面在1024 x 768或更高分辨率下看起来不错(它也在查找1024 x 768分辨率的确切问题...)。

编辑:

更新乌尔包装和容器的CSS代码

JSFIDDLE

现在,美国可以通过改变结果截面宽度和高度在此的jsfiddle

+0

你能看到这里:http://jsfiddle.net/mDFN8/ 水平滚动,你可以看到问题 –

+0

看到更新的答案plz –

+0

不,它仍然不工作..检查http://s30.postimg.org/ ycsrir22p/Untitled.jpg我需要背景颜色的全宽,但当你滚动y时,你会看到切割的数据 –