Bootstrap 登陆页面布局问题 - 容器无法正确适应屏幕尺寸
P粉214089349
P粉214089349 2023-09-10 21:04:02
[HTML讨论组]

我目前正在使用 Bootstrap 创建登陆页面进行练习。但是,我面临布局问题,容器不适合适当的屏幕尺寸。左右两侧不平衡,导致屏幕向左侧倾斜。

这是说明问题的屏幕截图(链接):文本

我尝试了各种方法,但未能解决问题。我怀疑这可能是 Bootstrap 中网格系统或容器设置的问题。

有人可以指导我如何排查和修复此布局问题吗?任何建议或见解将不胜感激。

此外,以下是一些相关的代码片段:





  
  
  TinDog
  
  




  
  
Dog on a smartphone

Meet new and interesting dogs nearby.

Featured title

Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

Featured title

Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

Featured title

Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

"I no longer have to sniff other dogs for love. I've found the hottest Corgi on TinDog. Woof."

dog image

Pebbles, New York

TechCrunch
Mashable
Business Insider
TNW

A Plan for Every Dog's Needs

Simple and affordable price plans for you and your dog.

Chihuahua

$0/mo

  • 5 Matches Per Day
  • 10 Messages Per Day
  • Unlimited App Usage

Labrador

$15/mo

  • Unlimited Matches
  • Unlimited Messages
  • Unlimited App Usage

Mastiff

$29/mo

  • Pirority Listing
  • Unlimited Matches & Messages
  • Unlimited App Usage

我也检查了容器语法、边距和填充。但我实在不明白这有什么问题..

我真的很感谢你的帮助,这对我这个新手有很大帮助。

提前致谢!!

P粉214089349
P粉214089349

全部回复(1)
P粉186897465

检查容器的位置。在代码片段中,您将容器类与 col-xxl-8 类一起使用。确保容器包裹了要居中的整个内容,并且正确应用了 col-xxl-8 类。

并且认为您应该像这样检查功能部分的所有容器类

col-12 col-sm-8 col-lg-6 用于图像容器,col-lg-6 用于文本容器。

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

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