Do taxis take credit cards or is it euro only?
Sometimes yes and sometimes no. Always ask before you get in. Even if you see a credit card terminal, sometimes it is "broken." The alternative is, of course, euro. Don't even think about $$$$. There is no hard and fast rules that says they have to take credit cards.
Yes, in Barcelona all taxis are "ccard-ready" and they accept VISA or Mastercard so, in principle, they should accept one.
However, note not all US-issued ccards have the international standards we use here in Europe, so some ccards are either not accepted or may have trouble with certain businesses. If you've never used your current ccard outside the US do check with your bank before travelling.
Also, as Frank mentioned, some drivers say the terminal "isn't working" because they prefer to be paid in cash. This is happening less these days because major credit card companies have reduced their abusive fees.