Horizontally; flat — describes a position or orientation across the horizontal plane.
疲れたのでソファに横に寝転んだ。
I was tired, so I lay down sideways on the sofa.
写真は縦ではなく横に並べてください。
Please arrange the photos horizontally, not vertically.
箱を横にしてから階段を運んだ方が安全だ。
It's safer to turn the box on its side before carrying it down the stairs.
Across; sideways; crosswise — indicating movement or position across the side, beside, or abreast.
彼は私の横に並んで歩いた。
He walked beside me.
道路を横に渡ると公園がある。
Cross the road sideways and there's a park.
本を横にして棚に入れた。
I put the book into the shelf on its side.