This is the image I’m talking about.
https://i.stack.imgur.com/WTkhd.jpg
Right now it works as a background of my news content. The brown area is the title, yellow are is the content.
When I write a long text into the content area, the text go out of the div because the picture isn’t big enough.
I want to split the image into 3 pieces.
- Header
- Middle
- Footer
Header and footer will always be applied once. Middle has to repeat itself depending on how long the text is.
How can I achieve this in CSS?
PS: You may call the split images “header.png, middle.png. and footer.png”
HTML
Let’s say the Image has a width of 300px.
CSS
More about background-repeat.
Note that the image will be repeated, which won’t look really good, I suggest that give the middle a fixed height, and use,
overflow:auto;which will create a scrollbar when contents exceeds the size.