Even if selling a website for millions, the initial cost is just the domain name.
Yes and No.
First let me say that this issue can only really be answered by a tax accountant/lawyer in your jurisdiction, as tax law varies widely.
The first thing you need to determine is what exactly are you selling? Is it just the domain name, is it the code, is it hardware, is it an entire business? Each of these are treated differently to some extent, but the overall concept remains the same. If you sell a business consisting of a factory, the price is determined by some multiple of future earnings, and the cost is determined by the residual value of the equipment or assets. The same holds true for a website, the difference is simply that most websites have very few assets, if any at all. In my case, I operate almost entirely expenses, servers are rented, even domain name is "rented", phone, internet, everything expensed.
Your code could be considered an asset but you would have had to of capitalized it over the years, and I doubt that this is done normally, but ask your accountant.
So yes the proceeds will likely be close to 100% cap gains, but a good tax accountant will be help you minimize the taxes paid.