Html 在固定布局网站中获取网站宽度时出错

Html 在固定布局网站中获取网站宽度时出错,html,css,Html,Css,我在固定布局的网站上遇到了问题 我已经手动编码,不知道如何修复它。我还在学习阶段。 你能告诉我我做错了什么吗 问题: 你可以检查工作。上传文件到免费域 或检查js Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是业界标准的虚拟文本,当时一家不知名的打印机在打印时使用了一个厨房 Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是业界标准的虚拟文本,当时一家不知名的打印机在打印时使用了一个厨房 Lorem

我在固定布局的网站上遇到了问题

我已经手动编码,不知道如何修复它。我还在学习阶段。 你能告诉我我做错了什么吗

问题: 你可以检查工作。上传文件到免费域

或检查js


Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是业界标准的虚拟文本,当时一家不知名的打印机在打印时使用了一个厨房
Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是业界标准的虚拟文本,当时一家不知名的打印机在打印时使用了一个厨房

Lorem Ipsum只是印刷和排版行业的虚拟文本。自16世纪以来,Lorem Ipsum一直是业界标准的虚拟文本,当时一家不知名的打印机在打印时使用了一个厨房

Lorem Ipsum只是一个傀儡 Lorem Ipsum只是印刷和排版行业的虚拟文本。Lorem Ipsum只是印刷和排版行业的虚拟文本

Lorem Ipsum只是一个傀儡 Lorem Ipsum只是印刷和排版行业的虚拟文本。Lorem Ipsum只是印刷和排版行业的虚拟文本

Lorem Ipsum只是一个傀儡 Lorem Ipsum只是印刷和排版行业的虚拟文本。Lorem Ipsum只是印刷和排版行业的虚拟文本

Lorem Ipsum只是印刷的虚拟文本 Lorem Ipsum只是印刷和排版行业的虚拟文本。Lorem Ipsum只是印刷和排版行业的虚拟文本

Lorem Ipsum只是印刷和排版行业的虚拟文本。Lorem Ipsum只是印刷和排版行业的虚拟文本

Lorem Ipsum只是印刷和排版行业的虚拟文本。Lorem Ipsum只是印刷和排版行业的虚拟文本

/*重置css*/ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,首字母缩写,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、字段集、表单、标签、图例、表格、标题、tbody、tfoot、, thead、tr、th、td、article、side、canvas、details、embed、figcaption、footer、header、hgroup、menu、nav、output、ruby、section、summary、time、mark、audio、video{ 保证金:0; 填充:0; 边界:0; 字体大小:100%; 字体:继承; 垂直对齐:基线; } /*旧浏览器的HTML5显示角色重置*/ 文章、旁白、详细信息、图表、页脚、页眉、H组、菜单、导航、章节{ 显示:块; } 身体{ 线高:1; } ol,ul{ 列表样式:无; } 区块报价,q{ 报价:无; } blockquote:before,blockquote:after, 问:之前,问:之后{ 内容:''; 内容:无; } 桌子{ 边界塌陷:塌陷; 边界间距:0; } 正文,html{ 身高:100%; } 身体{ 字体系列:“Arvo”,衬线; 文本对齐:居中; } h3{ 字体大小:30px; } .包装纸{ 宽度:1140px; 保证金:0自动; } .集装箱{ 宽度:1100px; 填充:10px 20px; 浮动:左; } navbar先生{ 保证金:0; 填充:15px 20px; 位置:固定; 宽度:100%; 背景:#fff; z指数:999; } #介绍{ 背景:url(“http://hdwallpaperszon.in/wp-content/uploads/2014/06/HD-Black-Car-Wallpaper_31.jpg)无重复固定50%0/覆盖rgba(0,0,0,0); 保证金:0; 位置:相对位置; 宽度:100%; 身高:100%; } #简介h2{ 字体大小:24px; } #介绍口号{ 填充顶部:130px; } #第二{ 浮动:左; 宽度:100%; 填充:65px 0 55px; 背景#666666; 颜色:#fff; } #第二,博客容器{ 浮动:左; } #第二,blogcontainer.row{ 浮动:左; 文本对齐:左对齐; 填充:10px0; } #第二,blogcontainer.row.text{ 字号:18px; 线高:26px; 填充:14px0; } #接触{ 浮动:左; 宽度:100%; 填充:65px 0 70px; 背景:#ECE8E1; 颜色:#000; } #页脚{ 浮动:左; 宽度:100%; 填充:20px 0 35px; 背景#666666; 颜色:#fff; } #页脚。左{ 浮动:左; 宽度:50%; 文本对齐:左对齐; 填充顶部:25px; } #页脚。左a{ 颜色:#fff; 字体大小:20px; }

谢谢

我想您已经使用像素作为主体或容器划分宽度。请尝试%的宽度

e、 g

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

因为您的示例页面在1024 x 768或更高分辨率下看起来还不错(在精确的1024 x 768分辨率下也出现了一些问题…)

编辑:

更新了ur包装器和容器css代码

现在,您可以通过在这个JSFIDLE中更改结果部分的宽度和高度来看到差异

CSS


请参阅发布图片不会有帮助,请制作小提琴并询问您的问题?在Firefox中似乎没问题(?)您使用固定宽度的
.container
.wrapper
类。将其更改为100%,这是我上传的地方
<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;
}
body or container (which u have used) {
width:100%;
margin-left:auto; 
margin-right: auto; 
}
 body {
min-width: 1140px;
}