【问题标题】:Why my button is not under my div in HTML为什么我的按钮不在 HTML 中的 div 下
【发布时间】:2022-12-22 23:04:48
【问题描述】:

我的按钮有问题。就像您在屏幕上看到的那样,按钮在我的文本上而不是在下面。如果你有任何想法......我真的不明白为什么。

谢谢!

.bouton-degrade {
    background: linear-gradient(135deg, #e30613 0%, #95030FFF 80%);
    color: #FFF;
    padding: 10px 20px;
    border-radius: 10px;
    transition: 0.2s;
    text-decoration: none;
    font-weight: 700;
    border: none;
}

.bouton-degrade:hover {
    background: linear-gradient(-135deg, #e30613 0%, #95030F 80%);
    transition: 0.2s;

}

边距顶部:1000px;

边距底部:-1000px

Screen

【问题讨论】:

  • 不幸的是我看不到,你没有提供 HTML。 minimal reproductible example
  • 对不起,我忘记了 pu 截图
  • 现在是好人
  • 你必须显示 html 文件 + 我看不到这个 div 类(在 css 内)。按钮与其位置无关。尝试使用 flexbox。
  • 无需查看 HTML 代码。我只能说您可以尝试在段落后添加不间断空格 (&nbsp)。

标签: html css


【解决方案1】:

有机会看到 HTML 吗?

也可能是按钮在您的 HTML 中的位置,或者像拼写错误的类名这样愚蠢的东西?在没有看到 HTML 的情况下,很难说出它为什么会出现问题。

【讨论】:

    【解决方案2】:

    在你添加 margin-bottom: -1000px 的地方删除它。 margin-bottom: -1000px

    【讨论】:

      猜你喜欢
      • 2018-08-09
      • 2013-01-04
      • 2022-08-18
      • 1970-01-01
      • 2015-07-08
      • 1970-01-01
      • 2021-01-31
      • 1970-01-01
      • 2014-01-12
      相关资源
      最近更新 更多