css - 如何从标题中删除css中的空格
问题描述
我试图在一些单词上方放置一个标题,但我的标题下面有一个空格,我的 css 是
.title{
grid-template-areas:"image" "title"
}
.title_word{
grid-area: title;
}
.title_img{
grid-area: img;
}
<div class="title">
<p class="title_word">hello</p>
<img src="https://live.staticflickr.com/5549/10549969363_76ccf43946_b.jpg" alt="not working" class="title_img">
</div>
如您所见,这可行,但是在 Firefox 和 chrome 中,它给了我很多空白
解决方案
如果要删除下面的空格,请添加:
margin-bottom: 0;
给你的
.title
最后它应该看起来像这样。
.title {
grid-template-areas:"image" "title"
margin-bottom: 0;
}
推荐阅读
- mysql - 查找按时间间隔分组的响应时间
- java - android studio中菱形断点和圆形断点有什么区别?
- python - Flask 项目在本地工作,但不在 Heroku 中
- mysql - 如何在特定时间范围内显示来自不同表的值 MYSQL
- r - 如何获得点(纬度和经度)以显示在我的 shapefile 地图上?
- docker - 在 RUN 部分 Dockerfile 中设置环境变量
- google-api - Classroom API getMaterials 不返回主题下的材料
- javascript - JavaScript:无需轮询即可侦听特定标签上的 DOM 更改
- asp.net-mvc - 将默认选项添加到 SelectList 不起作用
- automation - 如何在空手道请求的 URL 参数中使用响应中的参数