首页 > 解决方案 > css 选择器在使用 boostrap 时不起作用

问题描述

我正在尝试使用引导程序进行简单设计...但是,我遇到了一个问题,即每次我想从 CSS 中为某些元素添加一些编辑时,似乎没有任何变化,这很奇怪,因为一开始,它工作正常,但由于任何原因,它停止工作。这是 PHP 文件中的一段代码:

        <div class="popupbox d-flex flex-column top-0 justify-content-center position-fixed border border-2 border-dark">
            <p class="mensaje text-center">hola</p>
        </div>  

    <div class="background">

        <div class="contenedor">
            <div class="contenedor-margen container p-5">
                    <div class="separacion">
                        <h2 class="form_titulo text-center">Registrar</h2>
                    </div>
            </div>
     </div>

在这里,我正在尝试使用以下代码编辑弹出框:

.popupbox{
    width: 500px;
    height: 200px;
    background: red;
}

.background{
    width: 100%;
    height: 100vh;
    background:#171717;
    display: flex;
    flex-direction: row;
}

.contenedor{
    height: 100%;
    width: 40%;
    background: #EDEDED;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

正如我之前所说,CSS 选择器工作得非常好,我可以通过元素.background 和 .contenedor 来判断。还有两件事要说:使用属性style="background:red; width:500px; height:200px;" 它可以工作,但不能在 CSS 文件中,当我想删除 CSS 中任何元素的属性时,它无法删除......我不明白这个

标签: cssbootstrap-4css-selectors

解决方案


推荐阅读