Beveled corners using CSS border attribute
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 - 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;
}
Developer | Scott Dawson |
Username | DawsonMediaD |
Uploaded | January 02, 2023 |
Rating | 3 |
Size | 2,136 Kb |
Views | 10,120 |
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!
Name | Size |
Bootstrap 3 Variable-Width Modal | 2,666 Kb |
Rock Paper Scissors | 2,428 Kb |
Top Ribbon Visible on Scroll | 2,724 Kb |
CSS Regions for Codepen.io Pattern Rodeo | 2,879 Kb |
Fading Message Notification | 2,441 Kb |
Testing Pesky IE8 and Font Awesome | 1,999 Kb |
Floating Footer Notification | 2,290 Kb |
Problem with Chrome Row Hover | 1,859 Kb |
SCSS is More | 3,264 Kb |
LESS is More | 3,387 Kb |
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!
Name | Username | Size |
CSS Colors | Alexpate | 2,232 Kb |
Dribbble Template | ExtremelyGinger | 2,204 Kb |
A bit of elegance | Hackthevoid | 9,095 Kb |
Awesome | Samarthpd | 2,901 Kb |
Sass Get Function | Lukewatts | 2,155 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
Simple star rating using js and data-uri | TheEnd | 5,795 Kb |
Scifi-style Radio-based Tab | Aaronchuo | 4,427 Kb |
A Pen by Anoop | Anoopjohn | 330,760 Kb |
Alumni ECA | MatheusLima92 | 3,777 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!