I think that the standard Spanish d is the same as the standard Spanish t, but with d being voiced, while t is voiceless.
That is, in both phonemes the tip of the tongue is pressed to the back of the upper teeth, but pointing slightly down. Maybe the part of the tongue just next to the tip is just[touching the alveolar ridge. It is actually a denti-alveolar consonant. Sometimes the tongue does not actually touch the teeth, so the consontant is not totally oclusive (approximant consonant).
If you put the tongue between the upper and lower teeth you will get a sound more like
/z/ instead of
/d/. That is usual and somewhat accepted for a d at the end of a word, such as in "Madrid" or "id" (imperative of "ir"), but not for other places.
In relaxed speech, particularly in intervocalic positions, the d sound is sometimes relaxed. This is done by keeping a gap between the tongue and the teeth (not lower the tongue) and preventing the stop of the air flow.
In extreme cases the d may even disappear, such as in "estoy cansa(d)o".
Note that the t sound cannot be relaxed this way, maybe because it is voiceless.