Recently, I wanted to add a little bit of character to a simple text container and decided to try folding over one of the corners. Oxidation number of oxygen atoms in oxygen difluoride. We can generate an equilateral and right-angle triangle with square by setting border color to specific color, and rest are transparent, and width and height should be kept 0px. By setting some borders to transparent, and others to a color we can create various triangles. #triangle_left { width: 0; height: 0; border-top: 70px solid transparent; border-right: 140px solid #6bbf20; border-bottom: 70px solid transparent; } Create a CSS Triangle Right. https://www.growingwiththeweb.com/2013/03/triangles-in-css.html (Microsoft SQL Server). .trp-triangle{ width: 0px; height: 0px; border-left: 50px solid transparent; border-right: 50px solid #000; border-top: 50px solid #000; border-bottom: 50px solid transparent; margin: 20px auto; } Have any public figures faced any consequences for breaking pandemic rules, especially their own? Introducing Clip-path. To set the triangle at the center and at the bottom of div, use the following. Creates a content container with a triangle at the top. How do I style a dropdown with only CSS? To learn more, see our tips on writing great answers. (Microsoft SQL Server). By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy. Only with CSS ? This makes creating triangles difficult, but with clever use of the border property we can create perfect triangles in CSS. border-bottom: 50px solid transparent; This is basically the same concept, but we switch around by defining the top and bottom and using the left and right as offsets with a color. Bottom-right pointing triangle with css div { width: 100px; height: 100px; border-top: solid 50px transparent; border-bottom: solid 50px yellow; border-left: solid 50px transparent; border … @Bigood: This is finest solution i get in this question & tricky ;), @Manoz Even samuel was good, he got my upvote, as that will be cross browser where this is not, but this is real cool. CSS. It consists of having a single colored border, leaving the others transparent. What engine of the period 1855-1865 would have lifted one of Wright brothers' aeroplanes off the ground? You can then add a border to the rotated pseudo element to create the effect you are looking for. Direction. THE SCRIPT. Can a CSS class inherit one or more other classes? You can also use this technique to display the triangle with borders over an image, gradient or any non plain backgrounds : This will be a triangle pointed towards the top. Are visitors to Iran etc still ineligible for the US Visa Waiver Program? Here's a transparent pure css triangle with borders: .container { width: 200px; height: 200px; position: relative; border-top: 4px solid #e74c3c; } .triangle { position: absolute; margin: auto; top: -70px; left: 0; right: 0; width: 137px; height: 137px; transform: rotate(45deg); -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); Asking for help, clarification, or responding to other answers. Connect and share knowledge within a single location that is structured and easy to search. Remove space between 2 tables HTML CSS and image removes background image. Must observables be Hermitian only because we want real eigenvalues, or is more to that? CSS. Here’s how: 1. How to vertically center a “div” element for all browsers using CSS? Why Korean transcriptions of Japanese words uses the letters ㄱ,ㄷ,ㅈ for initial /k/, /t/, /tɕ/ while using ㅋ,ㅌ,ㅊ for other languages?