如何中心HTML有序列表号 [英] How to center ordered list number in HTML

查看:176
本文介绍了如何中心HTML有序列表号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在学习HTML编程。我有一个问题:

I am currently learning HTML programming. I have a problem:

如果我把这样的:

<html>
<body align="middle">
HEADLINE
<ol>
<li>First Item</li>
</ol>
</body>
</html>

现在的问题是数(1)是在左边时,我想它的标题下对齐。我怎样才能得到整个列表项中产?

The problem is the number (1.) is on the left when I wanted it to be aligned under the headline. How can I get the whole list item to the middle?

我需要至少在10美誉添加图片,所以我会提供一个链接到另一个网站,您看到的画面:调心

I need atleast 10 reputation to add pictures so I'll provide a link to another website for you to see the picture: ALIGNING

推荐答案

您正在调整中的正文部分。

You are aligning texts in the body.

试试这个:

<html>
<body>

<h4 align="center">HEADLINE</h4>
    <ol class="center">
    <li>First Item</li>
    </ol>

<style type="text/css">
 .center { text-align: center; list-style-position:inside;}
</style>

</body>
</html>

希望这有助于!

Hope this helps !

这篇关于如何中心HTML有序列表号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆