Is $\mathfrak{so}(2n)$ contained in $\mathfrak{sl}(2n)$? Let $\mathfrak{so}(2n) = D_n  =\left\{ \begin{pmatrix} A&B \\ C&-A^T \end{pmatrix}:  A,B,C\in M_n(K), B=-B^T, C=-C^T \right\}$ . Of course the matrices in $D_n$ have trace zero. This could lead me to conclude that $\mathfrak{so}(2n) \subseteq \mathfrak{sl}(2n)$, but this doesn’t seem right as for the inclusion of the respective Dynkin diagrams: in fact, it is not true that $D_n$ is contained in $A_n$. What am I missing here?

There is nothing wrong in what you did. The fact that a simple Lie algebra $\mathfrak g_1$ is a subalgebra of another simple Lie algebra $\mathfrak g_2$ doesn't imply the existence of a connection between their Dynkin diagrams (as your own example shows).
