I need a dashed diagonal line inside a div.
in this tread draw diagonal lines in div background with CSS
i found how to make a cross with this code
.crossed {
background:
linear-gradient(to top left,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.8px),
/*rgba(0,0,0,1) 50%,*/
rgba(0,0,0,0) calc(50% + 0.8px),
rgba(0,0,0,0) 100%),
linear-gradient(to top right,
rgba(0,0,0,0) 0%,
rgba(0,0,0,0) calc(50% - 0.8px),
rgba(0,0,0,1) 50%,
rgba(0,0,0,0) calc(50% + 0.8px),
rgba(0,0,0,0) 100%);
}
by commenting out the line as shown above it removes 1 of the lines out of the x and leaves me with the diagonal line as needed.
but how can i make the line dashed?
the fiddle is here: fiddle
thanks!
edit: sorry, saw the 100px width in example code, the div is changing width and hight done by js. this changes the diagonal degrees, so transform: rotate(-45deg); wont work