L
L
Lici2013-03-18 18:50:50
css
Lici, 2013-03-18 18:50:50

CSS: how to fill sidebars with an image?

I draw a menu. I want it to end with a picture on the left and right of the rectangular div-block of the menu. Interested in 2 options:
1) The picture fills the edge inside the div block
2) The picture is “glued” to the left and right to the div block
Tell me how to implement this. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Softlink, 2013-03-18
@Softlink

Why don't you consider the option with a border ? After all, it is very similar to dashed. Or am I missing something somewhere?

X
xripunov, 2013-03-18
@xripunov

You can also use :before and :after to contrive

A
anathem, 2013-03-18
@anathem

If they had thrown at least schematically, it would have been better.
1. Edge inside the block:
Menu

.menu {
  background-image: url('yourimage.png');
  background-repeat: repeat-y;
  background-position: 0px 0px;
}

There will be a fill along the left edge (along the y-axis) ... To do it on the right, we play with background-position.
2. The easiest way is to put the div in another div, set the width of the wallpaper (width), outer padding (padding), and the outer do the same :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question