There are bunch of good UX principles baked into HTML and CSS. Plus to become good at HTML and CSS you will be exposed to a lot of UX talk as well.
So one could argue it's really hard to get really good at HTML and CSS and not care about UX at all.
But yes, a fool with a tool is still a fool - if that's the point you're trying to make.