我有一个 css header ,不允许我使用 .我想 header 有一个奇怪的默认值,不允许我这样做,我该如何防止默认值或者我还可以使用什么来代替?
HTML
h3>Size:</h3>
<?php echo "<span class='sP'>".$pSize ."</span><br>"?>
CSS
h3{
margin-top: 0;
margin-bottom: 0;
color: #7C7C7C;
font-size: 20px;
font-weight: bold;
text-align: left;
font-family: "Lucida Sans Typewriter", "Lucida Console", monaco, "Bitstream Vera Sans Mono", monospace;
}
.sP{
color: #7C7C7C;
font-family: "Lucida Sans Typewriter", "Lucida Console", monaco, "Bitstream Vera Sans Mono", monospace;
}
最佳答案
我认为这就是您正在寻找的答案 - 只需输入 display:inline-block
即可。我已经提供了一个带有答案的工作示例。请尝试一下,如果有任何问题请询问。
h3{
margin-top: 0;
margin-bottom: 0;
color: #7C7C7C;
font-size: 20px;
font-weight: bold;
text-align: left;
font-family: "Lucida Sans Typewriter", "Lucida Console", monaco, "Bitstream Vera Sans Mono", monospace;
display:inline-block;
}
.sP{
color: #7C7C7C;
font-family: "Lucida Sans Typewriter", "Lucida Console", monaco, "Bitstream Vera Sans Mono", monospace;
display:inline-block;
}
<h3>Size:</h3>
<span class='sP'>hi</span><br>
关于html - header 不允许 <span> 在同一行中对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44948451/