简体   繁体   English

如何将标题向右移动?

[英]How do I move the title a bit to the right?

I have aligned my text to that it is central, however because of a navigation bar it is slightly to the left of center. 我已将其文本对齐至居中,但是由于导航栏的原因,该文本略位于中心的左侧。 How do I adjust the position of it ever so slightly? 我如何稍微调整一下它的位置?

This is the title code: 这是标题代码:

 <div id="header"> <u><h1 style="font-family:sans-serif; text-align:center">Search Engines</h1><u> </div> 

Thanks :) 谢谢 :)

Setup the padding-left parameter. 设置padding-left参数。 Here an example with 50 pixels to the right: 以下是右侧50像素的示例:

 <div id="header"> <u><h1 style="font-family:sans-serif;padding-left:50px; text-align:center">Search Engines</h1><u> </div> 

Use padding-left to increase the leading space, which shifts it over to the right: 使用padding-left来增加前导空间,这会将其向右移动:

 h1 { padding-left: 100px; } 
 <div id="header"> <u><h1 style="font-family:sans-serif; text-align:center">Search Engines</h1></u> </div> 

Use text-indent or padding-left. 使用text-indent或padding-left。

<div id="header">
<u><h1 style="font-family:sans-serif; text-indent: 5px; text-align:center">Search Engines</h1><u>
</div>

You can add 你可以加

<div id="header">
<u><h1 style="padding-left: 20px; font-family:sans-serif; text-align:center">Search Engines</h1><u>
</div>

You can play with the padding-left value to get the result you want. 您可以使用padding-left值来获得所需的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM