The equivalent of CSS is the LaTeX class (.cls) or package (.sty) file. It is possible to separate content from presentation almost completely in LaTeX, especially if you define your own commands.
There is an important difference between the two systems, though. CSS controls how a browser displays the contents of an HTML page, with a direct mapping between input file and display. What you see in the browser is the HTML file but displayed according to CSS rule.
LaTeX, by contrast, interprets typesetting commands in the input file to produce a DVI or PDF that may differ widely from the structure of the input file, including (as egreg notes in the comments) automatically generated text like table of contents, context-sensitive quotation marks, line drawings, etc. LaTeX only appears to be a markup language; really it is a macro-expansion language specifically for print typesetting.
Possibilities for customization with LaTeX
In the example below I show about one percent of how much you can change the appearance of a single input file by changing the class. Instead of writing separate class files, here I use class options to make the changes.
(Please note that I am not saying the things I demonstrate are aesthetically good or representing good programming practices! I have not tried to provide a simple example.)
Comparison
The rainbow title is a good example for comparison between LaTeX and CSS: I am not just setting a color property of a document element as one would in CSS, but I actually use loops, conditionals, branching, and recursion to iterate over the letters of the title, increment a counter, select a color from a kind of lookup table based on the counter, and print the letter in that color.
Nevertheless, the input file contains nothing about color, and with different command definitions you could create variable output.
Output using \documentclass[rainbowtitle]{example1}:

Output using \documentclass[palatino,notranslation]{example1}:

Input file: example.tex
\documentclass[rainbowtitle]{example1}
% Available class options:
% palatino -- use palatino fonts with different arrangement of styles
% notranslation -- hide the translation in poemtranslation environment
% rainbowtitle -- display the title in rainbow colors!
\title{Cascading Styles in \LaTeX}
\begin{document}
\maketitle
\section{Introduction}
This is an example of a \LaTeX{} file whose appearance can be changed drastically by using a different class.
\section{Custom Commands}
The difference between \code{article} and \code{memoir} classes is striking enough, not to mention \code{beamer}.
\keyword{Packages} or (in older terminology) style files can be used with multiple classes to change only one aspect, while the \keyword{class} file is more comprehensive, including packages.
\section{Custom Environments}
\begin{notabene}
Please note that this list is not exhaustive.
\end{notabene}
\begin{itemize}
\item \code{article}
\item \code{report}
\item \code{book}
\item \code{memoir}
\end{itemize}
Here is another example of a custom environment that can be completely redefined.
\begin{poemtranslation}
\begin{original}
Uno, dos, tres, cuatro, \eol
cinco, seis, siete, \eol
nuevo, diez.
\end{original}
\begin{translation}
One, two, three, four \eol
five, six, seven, \eol
eight, nine.
\end{translation}
\end{poemtranslation}
\end{document}
Class file with options: example1.cls
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{example1}[2016/09/28 Example 1 of changeable formatting]
\LoadClass{article}
% Available class options:
% palatino -- use palatino fonts with different arrangement of styles
% notranslation -- hide the translation in poemtranslation environment
% rainbowtitle -- display the title in rainbow colors!
\newif\iftranslation
\translationtrue
\DeclareOption{notranslation}{\translationfalse}
\newif\ifpalatino
\palatinofalse
\DeclareOption{palatino}{\palatinotrue}
\newif\ifrainbowtitle
\rainbowtitlefalse
\DeclareOption{rainbowtitle}{\rainbowtitletrue}
\ProcessOptions\relax
\ifpalatino
% We can change all the font styles around with one switch.
\RequirePackage{newpxtext,newpxmath}
\let\textsf\textbf
\let\oldscshape\scshape
\let\scshape\itshape
\let\itshape\oldscshape
\else
\RequirePackage{Alegreya, AlegreyaSans}
\fi
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage{microtype}
% Compact lists
\RequirePackage{enumitem}
\setlist{noitemsep}
% We can change the section headings with one command
\RequirePackage{sectsty}
\allsectionsfont{\scshape\color{blue}}
% We can define custom commands and do anything we like with them.
% Some of these are redefined by the font switch above.
\RequirePackage{xparse}
\RequirePackage{xcolor}
\NewDocumentCommand{\code}{}{\textsf}
% Rainbowtitle option puts each letter of title in different
% rainbow color
\ifrainbowtitle
\def\scando{}
\def\scan#1{\scanA#1\end} % thanks to wipet for this code
\def\scanA#1{\ifx\end#1\else\scando#1\expandafter\scanA\fi}
\newcount\rainbowcolor
\def\spectrum#1{%
\textcolor{\getcolor{\the\rainbowcolor}}{#1}\thinspace
\ifnum\rainbowcolor > 4
\rainbowcolor=0
\else
\advance\rainbowcolor by 1
\fi
}
\def\getcolor#1{\ifcase#1 red\or orange\or yellow\or green\or blue\or violet\fi}
\def\rainbow#1{%
\rainbowcolor=0
\let\scando\spectrum
\expandafter\expandafter\scan{#1}
}
\RenewDocumentCommand{\maketitle}{}{%
\begin{center}
\Huge \rainbow{\@title}
\end{center}
\bigskip
}
\fi
% Fancy underlining
\RequirePackage{ulem}
\NewDocumentCommand{\keyword}{ m }{\textcolor{magenta}{\uwave{#1}}}
% Redefinable environment, including font style and spacing
\NewDocumentEnvironment{notabene}{}
{\itshape}
{\par\addvspace{2ex}}
% Another customizable environment, for parallel poetic text and translation
% With one switch we can turn off one of the columns
\RequirePackage[spanish,english]{babel}
\RequirePackage{multicol}
\iftranslation
\NewDocumentEnvironment{poemtranslation}{}
{\footnotesize\raggedright
\begin{multicols}{2}}
{\end{multicols}}
\NewDocumentEnvironment{original}{}
{\selectlanguage{spanish}
\color{red}
\begin{verse}}
{\end{verse}}
\NewDocumentEnvironment{translation}{}
{\columnbreak
\color{blue}
\begin{verse}}
{\end{verse}}
\else
\NewDocumentEnvironment{poemtranslation}{}
{\color{violet}}
{}
\NewDocumentEnvironment{original}{}
{\selectlanguage{spanish}
\begin{verse}}
{\end{verse}}
\RequirePackage{environ}
\NewEnviron{translation}{}[]
\fi
% This could be redefined to, say, `&` if you wanted to use reledmac/reledpar.
\NewDocumentCommand{\eol}{}{\\}
\endinput
bookorarticleclasses, you look atmemoirfor instance, you get something which is instantly a lot easier to tailor to your needs. Or maybe you need to write such a class from scratch. But it isn't impossible once you know the things you want to be able to customise. – ienissei Sep 28 '16 at 18:33