How do I break down files in a similar way to torrents?
It's trivial to "break down" files as you put it. You'll need an algorithm to disassemble them, and then to reassemble them later, presumably by a browser since you mentioned HTML and CSS. Bittorrents implements this, and additionally the ability upload and download from a distributed "swarm" of peers also interested in the same data. Without reinventing the wheel by creating your own version of bittorrent, and again assuming you want to use this data in a browser, you'll want to create a torrent of all the HTML, CSS and other files relevant to your web application, and seed that using bittorrent. Next you'll want to create a bootstrap "page" that makes use of one of the several Javascript bittorrent clients now available to download the torrent, and then load the desired pages and resources when the client completes the download.
I am trying to make a program that breaks down files like HTML or CSS into chunks like that of a torrent. I am completely unsure how to do this. They need to be broken down, than later reassembled in order. anybody know how to do this?
It doesn't have to be in Python, that was just my starting point.