|
||||
display: flex oder mit float lösen? Textumbruch
Ein CMS gibt mir einen container vor, in den ich zwei Boxen derart reinpacken will, daß ich links (box1) eine feste Breite habe (es ginge auch eine prozentuale Breite) und die Box rechts soll der Breite des Containers folgen und der Text darin soll umbrechen.
HTML-Code:
<!DOCTYPE html > <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>display flex vs. float test</title> <style type="text/css"> * {margin: 0; padding: 0; border: 0;} body { text-align: left; background: #fff; color: #aaa; min-width: 700px; } .aussenabstand {margin:20px 30px 40px 50px;} .container { display: flex; width: 800px; border-width: 1px; border-style: solid; border-color: grey; /* background-color: lightblue; */ } #box1 { width: 100px; height: 200px; background-color: orange; } #box2 { width: auto; height: 200px; background-color: lightblue; } </style> </head> <body> <div class="container"> <div id="box1"> HELLO </div> <div id="box2"> WORLD <br/>1. Der Text soll umbrechen, wenn container kleiner wird.<br/> </div> </div> </body> </html> Grüße Christoph
__________________
-- Viele Grüße Christoph Geändert von Krischu (13.05.2016 um 10:04 Uhr) |
Sponsored Links |
|
|||
Du kannst beides verwenden, kommt nur darauf an, welche Browser deine Besucher verwenden. Ist mit beiden Varianten aber nicht schwer umzusetzen (außer, ich habe da etwas nicht ganz korrekt verstanden )
|
Sponsored Links |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Verschiebungen bei größerem Bildschirm | seelefant | CSS | 4 | 28.07.2014 15:43 |
Navigation positionieren | maybebabe | CSS | 4 | 08.04.2013 22:17 |
CSS von Plugin beisst! | expand | CSS | 0 | 28.09.2012 17:44 |
CSS - CMS - lange Menus Balken/BG oben? | shinobi | CSS | 3 | 13.10.2011 21:12 |
Problem mit einem 3D-Effekt | moep0710 | CSS | 12 | 12.06.2010 14:30 |