实现方法:
(推荐教程:html教程)
1、文本居中:
text-align: center;line-height: 100px; (=height)
登录后复制
2、标签居中
立即学习“前端免费学习笔记(深入)”;
margin: 0 auto; 其中0指的是margin-top:0
登录后复制
具体代码:
nbsp;html>搜索论坛 .item1{ height: 100px; width: 100px; background-color: red; text-align: center; line-height: 100px; margin: 0 auto; } .item2{ height: 100px; width: 100px; background-color: wheat; text-align: center; line-height: 100px; margin: 100px auto; }11112222
登录后复制
以上就是html中如何实现文本与标签居中的详细内容,更多请关注【创想鸟】其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2826211.html