CSS bar on dynamic div

I have a DIV in my html with dynamic size.Means its height can change according to various parameters. Now I need to put the crossbar through CSS in this DIV . Youtput will look something like this:! [enter image description here] [1]

I tried using CSS

  .DIV1{ width:520px; height:100%; background:url(../images/cross01.png) repeat-y; position:absolute; top:0px; z-index:1000; } 

But the problem in this code is that when a div comes at a different height, it breaks. As you know, this image of the back surface that I use will not grow in accordance with my DIV height. So I'm looking for any CSS solution. Can someone show me the way.

+4
source share
1 answer

Using:

 background-size : auto 100%; 

Additional information here: http://www.w3schools.com/cssref/playit.asp?filename=playcss_background-size&preval=50%25

+3
source

Source: https://habr.com/ru/post/1483782/


All Articles