Bit of a bizarre question, but does anyone know the actual limit to the length of a webpage, and why it is the limit?
有点奇怪的问题,但有没有人知道网页长度的实际限制,为什么它是限制?
As an experiment, I'm using HTML and CSS to make a site that represents a journey to a scale of 1:1. I have a ul list of markers along the way that I have separated with large margins in the css. However, the longest margin I can get to work so far is
作为一项实验,我使用HTML和CSS制作一个代表1:1比例的旅程的网站。我有一个标记的列表,我在css中以大边距分隔。但是,到目前为止我可以开始工作的最长保证金是
top-margin:100000cm;
Since there are 43 list items, that equates to 4,300,000cm, or 43Km. Does anyone know why it's hitting a limit around this mark, or how I might go about getting it longer? I'm using Safari for testing currently.
由于有43个列表项,相当于4,300,000厘米,或43公里。有没有人知道为什么它会达到这个标记的限制,或者我怎么可能更长时间?我目前正在使用Safari进行测试。
8 个解决方案
#1
3
It appears to simply be a maximum value that margin-top property can be set to. I've tried values up to 400,000cm with 100 elements and the page loads them all fine. I even tried incrementing that up to 1000 elements to see if the number was affected by load time, but nothing. It does appear to be an exact number somewhere between 400,000 and 500,000 that it cuts off at and shortens down past that value.
它似乎只是margin-top属性可以设置为的最大值。我已尝试使用100个元素的值达400,000cm,页面加载它们都很好。我甚至尝试将最多1000个元素递增以查看该数字是否受加载时间影响,但没有。它看起来确实是一个介于400,000到500,000之间的确切数字,它会切断并缩短超过该值。
Code I used (which worked, showed in full):
我使用的代码(工作,完整显示):
<?php
print "<ul>";
for ($i = 1; $i <= 1000; $i++) print "<li style=\"margin-top: 400000cm;\">{$i}</li>";
print "</ul>";
die();
?>
#2
6
There is no limit, as per any HTML/XHTML specification, so this is just the practical limit of the browser that you're hitting. How long a webpage can be is the same as asking how long a book can be.
根据任何HTML / XHTML规范,没有限制,因此这只是您正在尝试的浏览器的实际限制。网页的长度与询问图书的长度相同。
#3
4
Just a guess but 2147483647; max int value (probably pixels)
只是一个猜测,但2147483647; max int value(可能是像素)
Interestingly though IE9 seems to go up to 214748.3px and when I go higher it goes into the negative.
有趣的是,虽然IE9似乎上升到214748.3px,当我走高时,它进入负面。
#4
3
18.939 kilometers, to be exact: http://worlds-highest-website.com/
准确地说是18.939公里:http://worlds-highest-website.com/
#5
2
This will depend on the browser. There shouldn't be any clear limit on the length of the HTML file. The pure "length", as in pixels, shouldn't have any clearly defined limit either. Only, the more elements there are in the page, the more the browser has to do, and the sooner it may run out of memory. Memory is about the only limit there is.
这取决于浏览器。 HTML文件的长度不应有任何明确的限制。纯度“长度”(以像素为单位)也不应具有任何明确定义的限制。只是,页面中的元素越多,浏览器必须做的越多,内存越快就会耗尽。记忆是唯一的限制。
#6
2
There is no limitation. Even in terms of size of integer, you can create divs in other divs and have all of them biggest value of margin value so your page will not be limited.
没有限制。即使在整数大小方面,您也可以在其他div中创建div,并且所有div都具有最大的保证金值,因此您的页面不会受到限制。
#7
2
- It's a browser / memory / os architecture issue.
- 这是一个浏览器/内存/操作系统架构问题。
- Measuring it in anything but pixels won't be very useful unless you are referring to the size of a printed webpage on a specific paper size, orientation and scale. Screens have different sizes and DPI's.
- 除非您指的是特定纸张尺寸,方向和比例的打印网页尺寸,否则在像素以外的任何地方进行测量都不会非常有用。屏幕有不同的尺寸和DPI。
#8
1
Besides a possible maximum int value, you need to consider the load time for the page. If your web page takes longer than a few seconds to show any interesting content, than you will lose people browsing your content. That's a more meaningful metric than a 1:1 scale metric.
除了可能的最大int值之外,还需要考虑页面的加载时间。如果您的网页显示任何有趣内容的时间超过几秒钟,那么您将失去浏览内容的人。这是一个比1:1比例衡量标准更有意义的指标。
#1
3
It appears to simply be a maximum value that margin-top property can be set to. I've tried values up to 400,000cm with 100 elements and the page loads them all fine. I even tried incrementing that up to 1000 elements to see if the number was affected by load time, but nothing. It does appear to be an exact number somewhere between 400,000 and 500,000 that it cuts off at and shortens down past that value.
它似乎只是margin-top属性可以设置为的最大值。我已尝试使用100个元素的值达400,000cm,页面加载它们都很好。我甚至尝试将最多1000个元素递增以查看该数字是否受加载时间影响,但没有。它看起来确实是一个介于400,000到500,000之间的确切数字,它会切断并缩短超过该值。
Code I used (which worked, showed in full):
我使用的代码(工作,完整显示):
<?php
print "<ul>";
for ($i = 1; $i <= 1000; $i++) print "<li style=\"margin-top: 400000cm;\">{$i}</li>";
print "</ul>";
die();
?>
#2
6
There is no limit, as per any HTML/XHTML specification, so this is just the practical limit of the browser that you're hitting. How long a webpage can be is the same as asking how long a book can be.
根据任何HTML / XHTML规范,没有限制,因此这只是您正在尝试的浏览器的实际限制。网页的长度与询问图书的长度相同。
#3
4
Just a guess but 2147483647; max int value (probably pixels)
只是一个猜测,但2147483647; max int value(可能是像素)
Interestingly though IE9 seems to go up to 214748.3px and when I go higher it goes into the negative.
有趣的是,虽然IE9似乎上升到214748.3px,当我走高时,它进入负面。
#4
3
18.939 kilometers, to be exact: http://worlds-highest-website.com/
准确地说是18.939公里:http://worlds-highest-website.com/
#5
2
This will depend on the browser. There shouldn't be any clear limit on the length of the HTML file. The pure "length", as in pixels, shouldn't have any clearly defined limit either. Only, the more elements there are in the page, the more the browser has to do, and the sooner it may run out of memory. Memory is about the only limit there is.
这取决于浏览器。 HTML文件的长度不应有任何明确的限制。纯度“长度”(以像素为单位)也不应具有任何明确定义的限制。只是,页面中的元素越多,浏览器必须做的越多,内存越快就会耗尽。记忆是唯一的限制。
#6
2
There is no limitation. Even in terms of size of integer, you can create divs in other divs and have all of them biggest value of margin value so your page will not be limited.
没有限制。即使在整数大小方面,您也可以在其他div中创建div,并且所有div都具有最大的保证金值,因此您的页面不会受到限制。
#7
2
- It's a browser / memory / os architecture issue.
- 这是一个浏览器/内存/操作系统架构问题。
- Measuring it in anything but pixels won't be very useful unless you are referring to the size of a printed webpage on a specific paper size, orientation and scale. Screens have different sizes and DPI's.
- 除非您指的是特定纸张尺寸,方向和比例的打印网页尺寸,否则在像素以外的任何地方进行测量都不会非常有用。屏幕有不同的尺寸和DPI。
#8
1
Besides a possible maximum int value, you need to consider the load time for the page. If your web page takes longer than a few seconds to show any interesting content, than you will lose people browsing your content. That's a more meaningful metric than a 1:1 scale metric.
除了可能的最大int值之外,还需要考虑页面的加载时间。如果您的网页显示任何有趣内容的时间超过几秒钟,那么您将失去浏览内容的人。这是一个比1:1比例衡量标准更有意义的指标。