enter image description here

enter image description here

enter image description here Actually, I want to trigger a onClick on the body where discussion and icons are positioned. However, onClick on the body is not having any problems. The spacing area, however, is where it breaks. I wish to close this gap. but are unable to. Is there a fix for the space that would allow me to make the entire body clickable?

 <div class="d-flex flex-column border border-primary mt-2 " style="max-width: 400px ;  height: 130px;">
        <div class="w-100 bg-warning text-center p-2">
          <a href="">Somecontent from a map</a>
        </div>
        <div class="d-flex flex-column align-items-strentch " onclick="alert('hey')">
          <div class="d-flex align-items-stretch justify-content-between pt-4 pb-2 px-2 flex-1 d-inline-block"  >
            <text class="bg-warning "> discussed </text>
            <div  onclick="alert('hey click me')">icons here</div>
          </div>
        </div>
      </div>

推荐答案

对于onclick div人,你没有义务使用弹性体位. 你可以加上h-100来获得onclick div%的高度

您可以使用以下命令:

<body>
  <!DOCTYPE html>
  <html lang="en">

  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Static Template</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  </head>

  <body>
    <div class="d-flex flex-column border border-primary mt-2 " style="max-width: 400px ;  height: 130px;">
        <div class="w-100 bg-warning text-center p-2">
          <a href="">Somecontent from a map</a>
        </div>
        <div class="h-100 " onclick="alert('hey')">
          <div class="d-flex align-items-stretch justify-content-between pt-4 pb-2 px-2 flex-1 d-inline-block"  >
            <text class="bg-warning "> discussed </text>
            <div  onclick="alert('hey click me')">icons here</div>
          </div>
        </div>
      </div>
      
  </body>

Html相关问答推荐

如何将值从Google Sheets侧边栏中的表单中的输入传递到Google Sheets单元格中使用Textile()

使用tauri构建的Next.js应用程序不显示我的404页面

如何使用bslb设置可导航页面侧边栏的样式

输入表单在奇怪的地方舍入的标签

将ANGLE模板高效地迁移到ANGLE 17中引入的新语法

如何修复与导航栏重叠的css网格?

如何在用css使用网格视图时设置宽度?

仅在过渡之前删除填充

希望平稳过渡到悬停状态

rvest: Select 不包含链接的段落(<;p>;)

如何根据剪辑路径边缘设置文本边距?

我真的需要一个容器来让行和列正常工作吗? ( bootstrap 程序 v5)

使用HTML和CSS构建简历网站.无法使body元素内的div元素跨越整个网站高度

XPATH Select h2标签和

标签之间或h2标签和 标签之间的td元素,以立即为准

使用 css 将内容居中并向左对齐?

html tailwindcss 给 li 标签添加边框

基本上,我想要两列包含文本和图像,但第二列是倒置的

使用 htmloutput 在shiny 的应用程序中呈现文本

两个按钮范围滑块的 CSS

是否有一种静态方式可以根据暗模式 Select 一张或另一张图像?