As an Attorney and past Realtor I can ONLY speak as to how its handled in our state. Here the real estate taxes are "typically" handled/paid at closing of the transaction, at least all current and possibly those due in the immediate future. A "Warranty Deed" guarantees the title to be free and clear of liens and encumbrances, so if Title Insurance is involved you can be sure all bills and taxes (unless exempted) are likely current. Regarding which party pays which portion, that depends upon the purchase agreement and they may be pro rated (to actual date of transfer) or depending on when last paid and when due again, the sales contract may state something like Seller is responsible for the Spring/Fall installment of 2012 taxes due and payable in May/November of 2013 and Buyer is responsible for all afterwards.. With that information (and other such as fees and closing costs and title insurance etc etc) in hand the closing agent can pay all bills and distribute funds. The capital gains is a function of the "base" versus the net sales price AFTER expenses.
As to most legal or tax related questions I must advise in good faith that you consult a local competent trained professional (Real Estate Attorney or CPA) experienced in the laws of your state before you act. Bad advice could cost you big bucks when the IRS audits grrrrrrrrrrrr lol its not worth it to take a chance in my opinion but its your money and your decision as to how to handle the tax issue...
Best wishes and God Bless
John T Country Lawyer