Can short term or long term losses be used to offset dividend income?

pretty straightforward.  I am going to take some larger short term losses this year.  i also have dividend income, but it will be much smaller.  so say if i have 30K of short term losses, but 7K of dividend income, can i apply those short term losses to flatted out the dividend income?