应该如何:http : //prntscr.com/59nrxz
情况如何:http://prntscr.com/59nsfg
我的HTML:
<div class="col-md-6 logo" id="header-logo">
<a href="{{ path('static_page', {template:'home'}) }}" title="Return Home">
<img alt="logo" src="static/img/Risne-Logo.png"></img>
<span class="logo_left">RISNE</span>
<span class="logo_right">STARS</span>
</a>
</div>
我的CSS:
.logo_left, .logo_right {
font-family: "Droid Sans";
font-size: 34px;
top: -20px;
}
.logo_right {
color: #FECD0F;
}
.logo_left {
color: #234371;
}
我不在乎字体或其他任何东西,我只需要让文本移动到正确的位置即可。
根据您的需求,一个简单的方法position: relative
就可以解决问题。
.logo{
position: relative;
top: -20px; /* This will move it 20px up */
left: 20px; /* This will move it 20px to the right */
}
假设您将两个都放在类别为span
的div
(或标题)中logo
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句