如何指定一个以十进制数开头的列表? [英] How to specify a list to start with decimal number?

查看:346
本文介绍了如何指定一个以十进制数开头的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个页面,名称是all_list.php,其中包括其他三个页面:list_one.php,list_two.php和list_three_php。在这三个页面上,我有一个列表,我希望按顺序显示列表。三个页面上的样式是相同的

我希望我的列表是十进制格式,它确实如此。但是当list_two.php和3上的列表显示时,它们从1开始。我希望list_two上的列表从2开始,list_three.php上的列表从3开始。



这是我的输出我的输出



这就是我需要的



我怎样才能实现这个目标?



这是我的代码

我的风格:

I have created a page and name is all_list.php which include other three pages, list_one.php, list_two.php, and list_three_php. On this three pages I have a list where by I want to display the list in order. The style on the three pages is the same
I want my list to be in decimal format, which it does. But when the list on list_two.php and three are displayed they start from 1. I want the list on list_two to to start from 2 and the one on list_three.php to strat from 3.

This is my output My Output

This what i need

How can i achieve this?

Here is my code
My Style:

<style type="text/css">
	.my_list
	{
		font : 12px Futura, 'Trebuchet MS', Arial, sans-serif;		
	}
	p
	{
		margin: 0.33em;
	}
	h4, h5
	{
	    display: block;
		margin: 0.33em;
	    font-weight: bold;	   
	}
	h4
	{
		 font-size : 14px;
	}
	h5
	{
		 font-size : 13px;
	}
	/* ul
	{
		margin-left: -3.3em
	} */
	ol 
	{
		counter-reset: item;
	}
	ol li 
	{
		display: block;
		position: relative;
	}
	
	ol li:before
	{
		content: counters(item, ".")".";
		counter-increment: item;
		position: absolute;
		margin-right: 100%;
		right: 10px;
	} 
</style>





all_list.php



all_list.php

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>All my List</title>
</head>
	<body>
			<div class="container">			
				<div class ="content">				
					<h1>Sammarry of Programming Langauges</h1>
					<?php include "list_one.php";?>			
					<?php include "list_two.php";?>				
					<?php include "list_three.php";?>												 
				</div>
			</div>	
	</body>
</html>





我尝试了什么:



我试图在list_two上创建ol以2开头,并在list_three.php中以ol开头以3开头,这有效,但这不支持小数。我想以十进制格式显示列表。



What I have tried:

I have tried to make ol on list_two to start with 2 and ol in list_three.php to start with 3, which works but this does not support decimal. I want to display the list in decimal format.

推荐答案

如果你想操纵那些文件中的数据,那么你需要打开文件,读取数据,格式化它,然后显示它。



你可以,如果你这样做(正确的方式)也可以对它进行排序,并以其他方式对数据进行操作有用。



另一方面,只需粘贴文件就能准确显示文件中的内容(最多)。





If you want to manipulate the data in those files then you need to open the files, read the data, format it, and then display it.

You could, if you do it this way (the right way) also sort it and otherwise operate on the data for any purpose that's useful.

On the other hand, just pasting in files gives you exactly what's in the files (at best).




这篇关于如何指定一个以十进制数开头的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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