CSS-寻找一个盒子,里面放一些文字。内部示例

问题描述 投票:0回答:1

这里是一个例子example.

现在,这是我的第一次尝试:

.generated_text {
    display: inline-block;
    width: 50px;
    border: 1px solid #000;
    text-align: center;
    border: 1px;
    position: absolute;
    top: 54%;
    left: 36%;
    margin: -150px 0 0 -150px;
    width:700px;
    height:400px;
}

注意:generated_text是一个div,它输出从flask api生成的文本。

当我运行它时,它最终看起来像这样:

enter image description here

我是CSS方面的新手,因此非常感谢您的帮助。

编辑:我进行了一些更新,但仍然遇到一些问题:

.generated_text {
    display: inline-block;
    width: 50px;
    font-family:'Gudea' !important;
    text-align: left;
    color:#000 !important;
    background:#fff !important;
    border: 30px !important;
    border-color: #4b4b4b !important;
    position: absolute;
    top: 54%;
    left: 38.5%;
    margin: -150px 0 0 -150px;
    width:560px;
    height:170px;
}

哪个产量:

enter image description here

关于为什么不显示边框颜色的任何想法?

html css
1个回答
0
投票

尝试!important,当您从api这样接收到数据时:

.generated_text {
   color:#000 !important;
   background:#fff !important;
   width:100%;
   text-align: center;
   clear:both;
   display:block;
   font-size:25px;
   border:0;
}
© www.soinside.com 2019 - 2024. All rights reserved.