58869333 发表于 2022-5-21 20:45:40

html问题


怎么像这样网页缩小了,但div在屏幕比例不变

白two 发表于 2022-5-21 21:24:45

本帖最后由 白two 于 2022-5-21 21:46 编辑

你是说上面那一块吗?
把 div 宽度设置成 百分比 就行了
<body>
    <div style="margin: 0 auto;white-space:nowrap;">
      <div style="width: 100%;background-color">test0</div>
      <div style="float:left; width: 50%">
            <p>test1</p>
      </div>
      <div style="float:left;width: 50%">
            <p>test2</p>
      </div>
    </div>
</body>
</html>



我也不是很会, 仅作参考

58869333 发表于 2022-5-21 22:23:33

白two 发表于 2022-5-21 21:24
你是说上面那一块吗?
把 div 宽度设置成 百分比 就行了



怎么感觉不对呀

当初约定 发表于 2022-5-25 11:13:23

允许使用boostrap等框架吗?允许的话引入这些框架就非常好布局,不允许的话还是将div的宽高设置成相对大小,建议贴出你的html文本
页: [1]
查看完整版本: html问题