html - 如何更改边框宽度和高度,使其环绕文本?
解决方案
使用填充和显示:inline-block;在跨度标签上。
或者这样做:
span {
padding: 10px;
border: 5px solid black;
display: inline-block;
}
<span>Is this long enough? Is this long enough? Is this long enough? Is this long enough? Is this long enough? Is this long enough? Is this long enough? Is this long enough? Is this long enough? Is this long enough? </span>
推荐阅读
- ios - AVAudioSession.sharedInstance().outputVolume 不始终返回正确的音量
- google-cloud-platform - 如何使 Ansible Dynamic Inventory 与 Google Cloud Platform (Google Compute Engine)、GCP 一起使用
- python - 设置远程python解释器时删除默认参数
- magento-1.9 - 我可以在创建时明确设置 Magento 1.9 订单增量 ID
- gradle - org.gradle.api.UncheckedIOException:无法为文件创建 MD5 哈希
- node.js - 为什么 node.js (Express) 不为这条路线提供服务?我该如何解决?
- javascript - 从 2 个或更多 spritesheets 创建动画 - Phaser
- sql - 如何使用条件搜索历史表并在同一个表中更新?
- html - VBA IE与大表单交互
- sql - laravel 使用控制器向数据库添加和删除列