If you don’t need support for older browsers (IE 8 and less) you can use box-shadow
:
.border {
padding : 35px 20px 20px 20px;
box-shadow: inset 0 0 0 15px red, inset 0 15px 0 15px teal;
}
More Related Contents:
- Placing border inside of div and not on its edge
- border curved css – circle with curved end
- How to increase space between dotted border dots
- HTML5 / CSS3 Circle with Partial Border
- Borders disappear in Chrome when I zoom in
- Giving a border to an HTML table row,
- Slanted diagonal line in html or css?
- Border with a transparent centred arrow
- How to make a border overlay child div?
- How can I apply a border only inside a table?
- CSS border color switch animation: “from” color not correct
- Border around specific rows in a table?
- CSS Inset Borders
- Create wavy borders in CSS for top and bottom borders
- Object-fit not affecting images
- word-wrap break-word does not work in this example
- How do I stretch a background image to cover the entire HTML element?
- Making a div that covers the entire page
- Word wrap a link so it doesn’t overflow its parent div width [duplicate]
- centering a div between one that’s floated right and one that’s floated left
- CSS override rules and specificity
- How to select classes with spaces
- How to place Text and an Image next to each other in HTML?
- How to change style of radio and checkbox input [duplicate]
- How can I control the height of an Option element in Webkit?
- How to make rounded border in IE8 with CSS?
- How to create a ribbon shape in CSS
- Markdown and image alignment
- How to get equal width of input and select fields
- CSS – make div’s inherit a height