html - 如何删除 HTML/CSS 中两个 div 之间的空格?
问题描述
我有一个简单的 HTML/CSS 代码来获得粉色带和黑色较小的带,没有空格。这是我的 CSS 和 HTML 代码问题是我在两次潜水之间有空格,我从网上尝试了许多解决方案,但没有结果。
请问有什么帮助吗?
.my_bande_rose { background-color: #E6007E;
height: 124px;
width: 100%;
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
.bande_horizontale{ float: right;
width: 83.4%;
height: 5px;
background-color: #000000;
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
.my_logo { height: 124px;
width:225px;
top: 0px;
float:left;
}
.my_title { width:260px;
float:right;
margin:25px auto;
font-weight:bold;
padding:5px;
}
<html>
<head>
<script type="text/javascript"
src="../js/mathjax/MathJax.js?config=AM_HTMLorMML-full">
</script>
</head>
<body>
<div>
<div class="my_bande_rose">
<div class="my_title">
<h5 style="color:#ffffff;" >My tittle</h5>
</div><div class="my_logo">
<img src="https://www.pajemploi.urssaf.fr/pajewebdeclaratif/images/pajeweb/newletter/logo_forme.jpg" alt="Pajemploi, un service des urssaf"/>
</div><div class="bande_horizontale"></div>
</div> <br>
<h2 style="color:#E6007E;" >My tittle again</h2>
</div>
</body>
</html>
解决方案
如果您引用黑色 div 左侧的空间,则需要更改以下.bande_horizontale
属性:
float: left;
width: 100%;
推荐阅读
- python - 使用配置解析器接收列表
- tensorflow - 无法打开 cx_freeze 创建的 exe
- javascript - 为什么我不能在 componentDidMount 中收到 ref?(React)
- prolog - 以系统的方式在 Prolog 中报告 *为什么* 查询失败
- javascript - copyFileSync 在本地工作,但在全局上找不到 src
- lua - Lua 中播放器状态中的变量未按预期更新
- c++ - 问:如何创建有序的字符串对
- android - 在片段 java 类中使用带有 getLastSignedInAccount 的“this”时出现错误
- javascript - 如何在 JavaScript 中返回文本字段的数量
- ios - 检查文本字段、文本视图和图像视图以快速激活按钮