Beveled corners using CSS border attribute

Developer
Size
2,136 Kb
Views
10,120

How do I make an beveled corners using css border attribute?

Part of an exploration of bevel techniques, this uses simple borders. Pros: Bevels are transparent to background images. Cons: Interior image cannot full bleed to bevel edge. Unnecessary markup.. What is a beveled corners using css border attribute? How do you make a beveled corners using css border attribute? This script and codes were developed by Scott Dawson on 02 January 2023, Monday.

Beveled corners using CSS border attribute Previews

Beveled corners using CSS border attribute - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Beveled corners using CSS border attribute</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h2>Four Corner Bevel</h2>
<div class="bvc"> <div class="bevel tl tr"></div> <div class="content">Content<br />Goes<br />Here</div> <div class="bevel bl br"></div>
</div>
<h2>Diagonal Bevel 1</h2>
<div class="bvc"> <div class="bevel tr"></div> <div class="content">Top right, bottom left</div> <div class="bevel bl"></div>
</div>
<h2>Diagonal Bevel 2</h2>
<div class="bvc"> <div class="bevel tl"></div> <div class="content">Top left, bottom right</div> <div class="bevel br"></div>
</div>
<h2>One Only</h2>
<div class="bvc"> <div class="bevel tr"></div> <div class="content">One corner, see bottom bevel for spacing ...</div> <div class="bevel no_bevel"></div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>

Beveled corners using CSS border attribute - Script Codes CSS Codes

/* bevel size, left offset and color settings next 3 lines */
.bvc { left: -15px }
.bevel, .content { border-width: 15px }
.bevel, .content { border-color: #efefef; border-style:solid; }
.bvc { width: 90%; /* width of overall box, variable or fixed */ margin: 0 auto; position: relative; margin-bottom: 15px;
}
.bvc .tr, .bvc .tl, .bvc .br, .bvc .bl { height: 0px; width: 100%; }
.bvc .tr, .bvc .tl { border-top: 0; }
.bvc .br, .bvc .bl { border-bottom: 0; }
.bvc .tr, .bvc .br { border-right-color: transparent; }
.bvc .tl, .bvc .bl { border-left-color: transparent; }
.no_bevel { height: 0px; width: 100%; border-bottom: 0; }
.content { background: #efefef url(http://placehold.it/2000x200/efefef) no-repeat; width: 100%; border-top: 0; border-bottom: 0;
}
body { background: url(http://placehold.it/1x2/333/777); margin: 20px;
}
h2 { margin-bottom: 10px; color: white;
}
Beveled corners using CSS border attribute - Script Codes
Beveled corners using CSS border attribute - Script Codes
Home Page Home
Developer Scott Dawson
Username DawsonMediaD
Uploaded January 02, 2023
Rating 3
Size 2,136 Kb
Views 10,120
Do you need developer help for Beveled corners using CSS border attribute?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Scott Dawson (DawsonMediaD) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!