Css 在标志中居中显示文本
我怎样才能使下图中的文本居中 我有这个Css 在标志中居中显示文本,css,Css,我怎样才能使下图中的文本居中 我有这个 .flag{ background: url('flag.png') no-repeat; width:120px; height:120px; } </style> <div class="flag">WOW</div> 这就是它目前的表现 试试: .flag{ background: url('flag.png') no-repeat; width:120px;
.flag{
background: url('flag.png') no-repeat;
width:120px;
height:120px;
}
</style>
<div class="flag">WOW</div>
这就是它目前的表现
试试:
.flag{
background: url('flag.png') no-repeat;
width:120px;
height:120px;
text-align:center;
line-height:120px;
}
尝试:
使用
使用
请正确标记您的问题。请正确标记您的问题。
.flag{
background: url('flag.png') no-repeat;
width:120px;
height:120px;
text-align:center;
line-height:120px;
}
.flag{
background: url('flag.png') no-repeat;
width:120px;
height:120px;
line-height:120px; /* same as height */
text-align:center;
}