为什么 border-left border-right 对 Bootstrap 5 Django 不起作用?

Sih*_*Lee 6 django border bootstrap-5

所以我有以下代码:

{% load static %}

<!DOCTYPE html>
<html>
<head>
    <title>Verification Code Email</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
    <style>
        .insta-icon{width:50%; float:right;}
    </style>    
</head>
<body>
    <div class="container">
        <div class="row">
            <div class="col-1 offset-1 border-right">    # This one right here
                <img class="insta-icon"src="{% static '/images/instagram_icon.png' %}">                 
            </div>
            <div class="col-10"> b</div>
        </div>
    </div>
    <div class="container">
    </div>


    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
</body>

</html>

Run Code Online (Sandbox Code Playgroud)

现在,当我执行 just 时border,会显示边框,当我执行border-bottomor时border-top,会显示边框。但是,当我使用border-left或时border-right,不会显示边框轮廓。

另外,我尝试通过向 div 类添加一个insta-nav类来使用样式,并通过添加 来覆盖样式border:1px,但未添加边框。

为什么会是这两个原因呢?任何帮助,将不胜感激

HDP*_*HDP 11

您需要在 bootstrap 5 中使用border-startorborder-end代替border-leftor 。border-right

\n

水平方向敏感变量、实用程序和 mixins 被重命名为更逻辑的名称 \xe2\x80\x94startend代替Bootstrap 5中的left和。right

\n

您可以在此处查看更多 Bootstrap 5 迁移详细信息:\n https://getbootstrap.com/docs/5.0/migration/#sass

\n

  • 我认为这真的很烦人。他们本来可以让它进来,或者添加通过 mixin 或其他东西启用旧风格的可能性。当我想要一个靠右的“先生”时,它就有意义了——即使你不知道引导程序,你也会很容易理解它,并几乎立即在你的脑海中翻译它。LTR 支持很简洁——如果你需要的话——但我不需要。对我可能永远不需要的功能进行抽象层会让人感觉很糟糕。会尝试一下,但 99% 确定我最终会在我自己的 css 中声明所有“旧”边距/填充变化:/ (2认同)