Hello! How can div 1
(square) be made div 2
(triangle)?
Scheme:
#rectangle { width: 200px; height: 100px; background-color: red; } #triangle-topleft { width: 0; height: 0; border-top: 100px solid red; border-right: 200px solid transparent; }
<div id=rectangle></div> <br> <div id=triangle-topleft></div>
Source: geometric shapes on CSS .
Look in the direction of css, in principle, this is what you did in 5 minutes:
.up { width: 0px; height: 0px; border-style: inset; border-width: 200px 300px 0px 0px; border-color: #007bff transparent transparent transparent; float: left; } .up p { text-align: left; top: -190px; left: 10px; position: relative; width: 250px; height: 93px; margin: 0px; color: #fff; }
<div class="up"> <p>Ваш текст в трегуольнике Ваш текст в трегуольнике <p> </div>
Source: https://ru.stackoverflow.com/questions/144632/
All Articles