An electro-optical device includes a pair of substrates including a first
substrate and a second substrate, an electro-optical material sandwiched
between the pair of substrates, a shading film having a predetermined
pattern which is at least partially embedded in the first substrate at
the surface facing the electro-optical material, display electrodes which
are placed on the second substrate at the surface facing the
electro-optical material, and lines connected to the display electrodes
directly or through switching elements. In accordance with the
electro-optical device having such a shading film, it is possible to
reduce or prevent coating defects in an alignment layer, nonuniform
rubbing treatment to the alignment layer, and cracking of a counter
electrode due to the steps in the upper layers resulting from the
formation of the shading film.