Próbuję zrobić coś takiego i mi nie wychodzi.
Czy są jakieś programy graficzne które zrobią mi z DIVów jak ponizej w CSS ?
Pokaż kod jaki masz, co tam w nim nie wyszło, pomogę naprawić bo robiłem takie cuda.
Zrobiłem to tak jak poniżej.
Można to jakoś uprościć ?
Kolory nie muszą być identyczne
Z obramowaniem jest problem
<http://december.com/html/4/element/style.html> body { margin: 0 auto; } .box1 { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background-color: grey; } .box2 { width: 600px; height: 400px; margin-top: -2.5em; margin-left: 4.5em; } .green { float: left; width: 30%; height: 20%; background-color: green; } .green2 { float: left; width: 30%; height: 20%; background-color: green; display: flex; justify-content: center; } .orange { float: left; width: 30%; height: 20%; background-color: #fab949; display: flex; align-items: center; justify-content: center; } .yellow { float: left; width: 22%; height: 20%; background-color: #fae248; display: flex; align-items: center; justify-content: center; } .yellow2 { float: left; width: 22%; height: 20%; background-color: #eeff41; display: flex; align-items: center; justify-content: center; } .red { float: left; width: 30%; height: 20%; background-color: red; display: flex; align-items: center; justify-content: center; } .red2 { float: left; width: 30%; height: 10%; background-color: red; } .grey { float: left; width: 50%; height: 100%; background-color: grey; } .rozowy { float: left; width: 30%; height: 100%; background-color: #ffc0cb; display: flex; align-items: center; justify-content: center; } .blue { float: left; width: 30%; height: 10%; background-color: blue; } .blue2 { float: left; width: 30%; height: 20%; background-color: blue; display: flex; align-items: center; justify-content: center; } .blue3 { float: left; width: 30%; height: 10%; background-color: blue; } .fiolet { float: left; width: 8%; height: 20%; background-color: #871F78; } .fiolet2 { float: left; width: 8%; height: 20%; background-color: #871F78; } .fiolet3 { float: left; width: 30%; height: 14%; background-color: #871F78; display: flex; align-items: center; justify-content: center; } .brazowy { float: left; width: 30%; height: 10%; background-color: #8E2323; } .brazowy2 { float: left; width: 30%; height: 10%; background-color: #8E2323; display: flex; justify-content: center; } .szary { float: left; width: 30%; height: 4%; background-color: #cccc99; } .szary2 { float: left; width: 38%; height: 20%; background-color: #cccc99; display: flex; align-items: center; justify-content: center; /* border: 3px solid black; */ } .szary3 { float: left; width: 38%; height: 6%; background-color: #cccc99; } .mietowy { float: left; width: 22%; height: 20%; background-color: #669900; display: flex; align-items: center; justify-content: center; } .White { float: left; width: 22%; height: 6%; background-color: white; } </http://december.com/html/4/element/style.html> <http://december.com/html/4/element/body.html> <http://december.com/html/4/element/div.html class="box1"> <http://december.com/html/4/element/div.html class="box2"> <http://december.com/html/4/element/div.html class="orange">1</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="green"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="red">3</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="rozowy">4</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="green2">2</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="red2"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="blue"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="yellow">5</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="fiolet"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="blue2">6</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="yellow2">7</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="fiolet2"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="blue3"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="brazowy"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="fiolet3">8</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="brazowy2">9</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="szary"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="mietowy">10</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="szary2">11</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="white">12</http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="szary3"></http://december.com/html/4/element/div.html> </http://december.com/html/4/element/div.html> </http://december.com/html/4/element/div.html> </http://december.com/html/4/element/body.html>
Ten sposób pozycjonowania DIV uniemożliwia dodanie oczekiwanego obramowania.
Takie schematy robiłem na pozycjonowaniu absolutnym, nakładałem element na ten pod nim stosując z-index.
Miałbyś czas coś takiego zrobic ?
Zrób sobie kontener o rozmiarze X i Y position: relative
a w nim umieszczaj div position absolute; top:Y; left:Y; z-index:X
lepjej zrobić coś samemu bo wtedy się uczysz, niż wziąć gotowca i pozbyć się całej otoczki nauki
Ale spoko zaraz zrobię wstęp, mojego pomysłu jak podpasi to dokończysz sobie.
To początek podpowiadający jak to możesz zrobić, uważam że resztę dodasz bez najmniejszego problemu.
<!DOCTYPE html> <http://december.com/html/4/element/html.html> <http://december.com/html/4/element/body.html> <http://december.com/html/4/element/style.html> .container { width:600px; height:600px; background-color: yellow; position: relative; } .bdr { webkit-box-shadow: inset 0px 0px 0px 4px red; -moz-box-shadow: inset 0px 0px 0px 4px red; box-shadow: inset 0px 0px 0px 4px red; } .d1 { width: 200px; height: 100px; position: absolute; z-index: 1; background-color: green; } .d2 { width: 200px; height: 200px; position: absolute; left: 200px; z-index: 1; background-color: #866a6a; } .d8 { width: 200px; height: 260px; position: absolute; top: 200px; left: 200px; z-index: 1; background-color: #651068; } .d5 { width: 150px; height: 100px; position: absolute; z-index: 1; background-color: #dfa620; } .d7 { width: 150px; height: 100px; position: absolute; top: 97px; z-index: 1; background-color: #e1c47f; } </http://december.com/html/4/element/style.html> <http://december.com/html/4/element/div.html class="container bdr"> <http://december.com/html/4/element/div.html class="d1 bdr"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="d2 bdr"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="d8 bdr"> <http://december.com/html/4/element/div.html class="d5 bdr"></http://december.com/html/4/element/div.html> <http://december.com/html/4/element/div.html class="d7 bdr"></http://december.com/html/4/element/div.html> </http://december.com/html/4/element/div.html> </http://december.com/html/4/element/div.html> </http://december.com/html/4/element/body.html> </http://december.com/html/4/element/html.html>
Udało się Dzięki za pomoc.
<!DOCTYPE html> <html> <body> <style> body { margin: 0 auto; } .box { position: absolute; display: flex; align-items: center; justify-content: center; background-color: white; width:100%; height:100%; margin-top: -0.0em; margin-left: em; } .container { width:547px; height:570px; background-color: yellow; position: relative; } .bdr { webkit-box-shadow: inset 0px 0px 0px 4px red; -moz-box-shadow: inset 0px 0px 0px 4px red; box-shadow: inset 0px 0px 0px 4px red; } .salon { width: 204px; height: 475px; position: absolute; top: 96px; z-index: 2; background-color: #e1c47f; } .jadalnia { width: 204px; height: 100px; position: absolute; top: 292px; z-index: 2; background-color: ###; } .kuchnia { width: 204px; height: 133px; position: absolute; top: 435px; z-index: 2; background-color: ###; } .sypialnia { width: 200px; height: 200px; position: absolute; left: 200px; z-index: 2; background-color: #e1c47f; } .holl { width: 200px; height: 243px; position: absolute; top: 196px; left: 200px; z-index: 2; background-color: #e1c47f; } .garderoba { width: 150px; height: 100px; position: absolute; z-index: 2; background-color: #e1c47f; } .lazienka2 { width: 150px; height: 100px; position: absolute; top: 96px; z-index: 2; background-color: #e1c47f; } .wiatrolap { width: 150px; height: 94px; position: absolute; top: 435px; left: 200px; z-index: 2; background-color: #e1c47f; } .taras { width: 200px; height: 96px; position: absolute; top: 0px; left: 0px; z-index: 3; background-color: white; } .ganek { width: 142px; height: 42px; position: absolute; top: 529px; left: 204px; z-index: 3; background-color: white; } .lazienka1 { width: 152px; height: 125px; position: absolute; left: 396px; z-index: 2; background-color: #e1c47f; } .biuro { width: 152px; height: 200px; position: absolute; top: 121px; left: 396px; z-index: 2; background-color: #e1c47f; } .pralnia { width: 152px; height: 95px; position: absolute; top: 317px; left: 396px; z-index: 2; background-color: #e1c47f; } .pokoj { width: 202px; height: 165px; position: absolute; top: 408px; left: 346px; z-index: 1; background-color: #e1c47f; } .drzwi_dom { width: 40px; height: 4px; position: absolute; top: 525px; left: 258px; z-index: 4; background-color: #e1c47f; } .drzwi_wiatrolap { width: 40px; height: 4px; position: absolute; top: 435px; left: 258px; z-index: 4; background-color: #e1c47f; } .drzwi_salon { width: 4px; height: 43px; position: absolute; top: 392px; left: 200px; z-index: 4; background-color: #e1c47f; } .drzwi_lazienka2 { width: 4px; height: 40px; position: absolute; top: 320px; left: 346px; z-index: 4; background-color: #e1c47f; } .drzwi_lazienka1 { width: 4px; height: 40px; position: absolute; top: 15px; left: 396px; z-index: 4; background-color: #e1c47f; } .drzwi_gabinet { width: 4px; height: 40px; position: absolute; top: 230px; left: 396px; z-index: 4; background-color: #e1c47f; } .drzwi_pralnia { width: 4px; height: 40px; position: absolute; top: 345px; left: 396px; z-index: 4; background-color: #e1c47f; } .drzwi_sypialnia { width: 38px; height: 4px; position: absolute; top: 196px; left: 354px; z-index: 4; background-color: #e1c47f; } .drzwi_garderoba { width: 38px; height: 4px; position: absolute; top: 196px; left: 262px; z-index: 4; background-color: #e1c47f; } .drzwi_pokoj { width: 40px; height: 4px; position: absolute; top: 435px; left: 353px; z-index: 4; background-color: #e1c47f; } </style> <div class="box"> <div class="container"> <div class="taras"> </div> <div class="salon bdr"> </div> <div class="jadalnia"> </div> <div class="kuchnia"> </div> <div class="sypialnia bdr"> </div> <div class="holl bdr"> <div class="garderoba bdr"> </div> <div class="lazienka2 bdr"> </div> </div> <div class="wiatrolap bdr"> </div> <div class="ganek"> </div> <div class="lazienka1 bdr"> </div> <div class="biuro bdr"> </div> <div class="pralnia bdr"> </div> <div class="pokoj bdr"> </div> <div class="drzwi_dom"> </div> <div class="drzwi_wiatrolap"> </div> <div class="drzwi_salon"> </div> <div class="drzwi_lazienka2"> </div> <div class="drzwi_lazienka1"> </div> <div class="drzwi_sypialnia"> </div> <div class="drzwi_garderoba"> </div> <div class="drzwi_gabinet"> </div> <div class="drzwi_pralnia"> </div> <div class="drzwi_pokoj"> </div> </div> </div> </body> </html>
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)