天蓬老师2017-04-17 11:38:43
Probably not possible. .
The outline attribute only needs outline-width outline-style outline-color, and under webkit there is also outline-offset
For this kind of problem, you can
F12 to see what attributes are available
You can also check MDN https://developer.mozilla.org/en-US/docs/Web/CSS/outline
天蓬老师2017-04-17 11:38:43
No. But you can put outline: none;
and then set border
to achieve that.
PHPz2017-04-17 11:38:43
Of course not supported.
Black magic time: You can use cropping to cut off the sides where the outline overflows...
Crops include overflow:hidden
, clip
. There is also clip-path
that is newer, but it seems that chrome has stopped supporting it.
https://jsfiddle.net/4npvyfn8/3/
Because it is black magic, it doesn’t matter if the code is beautiful or not=w=
大家讲道理2017-04-17 11:38:43
Outline looks very similar to border settings, but outline cannot declare the style of a single side like border.
黄舟2017-04-17 11:38:43
In fact, you can wrap another layer of p outside the content and set a border.