How can I show only corner borders?

You can achieve that using multiple linear gradients as a background image. div { width: 100px; height: 100px; background: linear-gradient(to right, black 4px, transparent 4px) 0 0, linear-gradient(to right, black 4px, transparent 4px) 0 100%, linear-gradient(to left, black 4px, transparent 4px) 100% 0, linear-gradient(to left, black 4px, transparent 4px) 100% 100%, linear-gradient(to bottom, black 4px, …

Read more

How to use border with Bootstrap

Unfortunately, that’s what borders do, they’re counted as part of the space an element takes up. Allow me to introduce border’s less commonly known cousin: outline. It is virtually identical to border. Only difference is that it behaves more like box-shadow in that it doesn’t take up space in your layout and it has to …

Read more

Double border with different color [duplicate]

Alternatively, you can use pseudo-elements to do so 🙂 the advantage of the pseudo-element solution is that you can use it to space the inner border at an arbitrary distance away from the actual border, and the background will show through that space. The markup: body { background-image: linear-gradient(180deg, #ccc 50%, #fff 50%); background-repeat: no-repeat; …

Read more