css - html在不同尺寸浏览器窗口中页面排版混乱
PHP中文网
PHP中文网 2017-04-17 13:55:39
[HTML讨论组]

浏览器放至最大显示没有问题,但是改变浏览器窗口大小,出现混乱

截图如下,出现堆叠:

希望达到的效果如下:

代码:
html




    
    test
    
    
    
    


首页

问题

专栏

用户

特色

在线客服

css

.row {
    background-color: rgba(51, 51, 51, 1);
    height: 60px;
    width: inherit;
    box-shadow: 0 5px black inset;
}

#a1 {
    position: absolute;
    height: 64px;
    width: 172px;
    margin-left: 60px;
    margin-top: 3px;
}

#a2 {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin-top: 15px;
    margin-left: 240px;
    position: absolute;
}


#a3,#a4,#a5,#a6,#a7,#a8 {
    position: absolute;
    color: white;
    margin-top: 15px;
    font-size: 18px;
    float: none;
}
#a3 {  color: #FFCC00;  margin-left: 55%;  }
#a4 {  margin-left: 61%;  }
#a5 {  margin-left: 65%;  }
#a6 {  margin-left: 71%;  }
#a7 {  margin-left: 79%;  }
#a8 {  margin-left: 85%;  }


#a_1,#a_2,#a_3,#a_4,#a_5,#a_6 {
    position: absolute;
    color: white;
    margin-top: 15px;
}
#a_1 {  margin-left: 60%;  }
#a_2 {  margin-left: 64%;  }
#a_3 {  margin-left: 70%;  }
#a_4 {  margin-left: 78%;  }

`
麻烦大家帮我看看怎么实现?谢谢

PHP中文网
PHP中文网

认证0级讲师

全部回复(4)
高洛峰

固定宽度~~

迷茫

既然引用了bootstrap就可以给p和img加个类啊,class="col-sm-1",这样就是响应式布局,缩小还能保持良好的结构

高洛峰

设置padding

迷茫

= =不明白为什么要设置那么多margin-left。。。。个人觉得对于导航栏用table可以比较好地排版。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号