Generally capacitor gives infinite resistance to dc components(i.e., block the dc components). it allows the ac components to pass through.
The reactance of capacitance is inversely proportional to frequency . For DC supply as frequency is zero ,the reactance of capacitance is infinity . so capacitance behave like a open circuit for DC supply.. So capacitance will work only for AC supply.