Creating a seamlessly repeating pattern image involves making the image yourself, and ensuring it's seamless on all sides in a variety of ways. you can then select it and choose Edit... > Define Pattern.... That adds your chosen image as a pattern to Photoshop's available pattern options.
You can load or save new patterns using the
Layer Style popup (double click the empty part of a layer in the layers palette or choose Layer > Layer Style... > Pattern Overlay...) by clicking on the small gearwheel icon when you choose a pattern.
Ensuring your pattern is seamless can be tricky. Sometimes a clever choice of your unit cell is all you need, but it can be much trickier than that. Especially turning a photo image into a seamless pattern will involve copying parts of your unit cell to the opposite end and applying a gradient mask to the copied part.
css, you could use such a resulting image as a repeating background—no need to specify anything,
background-repeat is set to
repeat-y by default.
There are alternatives, like making your pattern in all
css like with Patternify, a browser-based repeating pattern builder, or using and/or tweaking one of the patterns in the CSS3 Patterns Gallery, among others.