• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Flexbox - run-around

LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

Does anyone know if a Flex column can run-around another Flex column?

For example: I have 2 columns set as 50% wide each in a Flex parent container. At a specific break point I set the 2nd column, which contains a background image, to 300px high.

What I want to happen is for the 1st Flex column, which contains text, to runaround (under the image) to fill up the width of the parent Flex container.

I can do this conventionally using float/block at the break point but as I'm using Flexbox it would be good to find a Flexbox only solution, maybe it's not Flexible enough to wander outside of a column structure?

Os

Views

6.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

Not 100% certain what you are asking, but you can nest a Flexbox layout within a Flexbox layout.

Or are you wishing to do something like the use of css exclussions?

https://msdn.microsoft.com/library/hh673558(v=vs.85).aspx

If css exclussions, it is only currently implemented in IE10+, but you can simulate it using css shapes, (firefox and IE require pollyfil for shapes, though in development).

You can also simulate exclussions, depending on layout by using multi-column with the break-before/after property, webkit uses a none standard break property in older browsers/devices.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

This is what I'm trying to do. Yellow box on left goes to the right at 768px and the height is set at 250px. I want the text to runaround/below the yellow box to fill the width of the parent container. I don't think Flexbox can do this.

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8"/>

<title>Profiles</title>

<style>

* {

box-sizing: border-box;

}

body {

font-size: 15px;

line-height: 28px;

font-family: helvetica, sans-serif;

}

.profile-wrapper {

display: flex;

justify-content: space-between;

background-color: #FBF9FA;

}

@media screen and (max-width: 768px) {

.profile-wrapper {

padding: 30px;

}

}

figure {

margin: 0;

padding: 0;

width: 50%;

/* background-image: url(images/profile_1.jpeg);*/

background-size: cover;

background-position: center, center;

background-color: yellow;

}

@media screen and (max-width: 768px) {

figure {

order: 2;

height: 250px;

width: 250px;

}

}

.profile {

width: 50%;

padding: 40px 50px;

}

@media screen and (max-width: 768px) {

.profile {

padding: 0;

}

}

.profile h2 {

margin: 0;

padding: 0;

}

</style>

</head>

<body>

<div class="profile-wrapper">

<figure>

</figure>

<div class="profile">

<div class="profile-text">

<h2>Lorem ipsum dolor.</h2>

<h4>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab aperiam corporis.</h4>

<p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium amet animi atque facere incidunt ipsam laudantium maxime modi recusandae repellendus. Cupiditate deserunt eaque inventore, ipsum iure laboriosam officiis perspiciatis voluptates. A accusantium ad beatae corporis, ducimus enim eos error ipsam iusto laboriosam laborum laudantium libero quaerat repudiandae rerum tempore velit veniam veritatis. Aut commodi ea eos molestiae quidem repellendus repudiandae!

</p>

<p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. In, ut vero. A ab accusantium aspernatur beatae commodi culpa deleniti dolorem dolores dolorum ducimus eos error esse, fugiat hic itaque labore libero magni necessitatibus nobis odit perferendis perspiciatis praesentium provident quaerat quam, qui quibusdam ratione, reiciendis rem sed sit soluta tempore tenetur voluptas voluptate voluptates voluptatibus? Atque autem commodi consectetur consequatur ducimus explicabo, iste magnam minima non quibusdam quidem quo sint sunt. Dignissimos doloribus libero porro saepe tempora veniam veritatis vitae.

</p>

<p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. In, ut vero. A ab accusantium aspernatur beatae commodi culpa deleniti dolorem dolores dolorum ducimus eos error esse, fugiat hic itaque labore libero magni necessitatibus nobis odit perferendis perspiciatis praesentium provident quaerat quam, qui quibusdam ratione, reiciendis rem sed sit soluta tempore tenetur voluptas voluptate voluptates voluptatibus? Atque autem commodi consectetur consequatur ducimus explicabo, iste magnam minima non quibusdam quidem quo sint sunt. Dignissimos doloribus libero porro saepe tempora veniam veritatis vitae.

</p>

<p>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus architecto aspernatur dolore, eius eligendi eveniet laboriosam nemo pariatur praesentium rem? Ad dolorum ipsum quibusdam repellendus vel voluptas! Eum, fuga reiciendis!

</p>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium architecto commodi, doloribus esse et facere inventore laborum modi nam, nihil quam repellat, tempore ut voluptate.</p>

</div>

<!-- end profile-text -->

</div>

<!-- end profile -->

</div>

<!-- end profile-wrapper -->

</body>

</html>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

Sorry Os, but you have lost me. All i am seeing is 2 columns l/h yellow, r/h with text.

Correct me if i am wrong on this, (and don't forget, i am only working from an ipad) you want the yellow box to fill both columns at 760px, be a height of 250px then the text to continue under the box?

If so then what you are after is css regions, (there is a polyfill). With regions, (and it does work with flexbox) you tell the text how to flow, (from box to box, so to speak). IE uses an iframe for the content that will flow into the boxes, but there is also a polyfill to have it work without the iframe.

If you want a demo, and can wait until Wednesday, (when i get back home) I am almost certain i did one a few years back for someone, (no prizes for guessing who). Regions was a simple way of telling text, (and other content) how to flow into various regions of a page.

A simple explanation is at -

https://msdn.microsoft.com/en-gb/library/hh673537.aspx

Just a bit of background history for those interested, css regions was implemented in Chrome, and is the only spec i have ever seen removed from a browser support. It was also an Adobe created spec, and its removal was the start of Adobe loosing interest in html5 and css3.

Just as a quick update to the final comment.

Safari, IE10+ and Edge do support css regions, but the removal from Chrome, started one of the worst 'temper tantrums' i have ever seen, (read about) between 2 major companies.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

pziecina  wrote

Sorry Os, but you have lost me. All i am seeing is 2 columns l/h yellow, r/h with text.

Correct me if i am wrong on this, (and don't forget, i am only working from an ipad) you want the yellow box to fill both columns at 760px, be a height of 250px then the text to continue under the box?

No, at 768px I want the yellow box which is on the left  to swap places with the column of text, which can be done using Flex order, plus its height to reduce to 250px, which is not a problem. The problem is the column of text, which has now gone from right to left, doesn't wrap itself under the yellow box/column, which is now only 250px high, it just stays in its own column rather than span the whole of the parent Flex container.

Just thought it might be able to be done somehow using Flexbox only rather than having to de-flex everything at the break-point and use float/display: block which is easy enough to do but creates more css.

Maybe there is a clue in the name Flex'box' - nothing seems to be able to break out of a boxy column grid.

No rush I'm just experimenting with a couple of layouts at this stage. I'd be surprised if it can be done using Flexbox only but if it could it would be neat.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

What you describe is a case for using css regions, as the text from the first column, could be automatically continued under the 'yellow' box when the 'yellow' box moves to the right, as you tell it how the content should flow. It does not have to be linear, but you can miss 'boxes' out which is what would be required.

The main problem with using regions is that you have to redefine the flow depending on browser/device viewport, which in itself is what none flexbox users are doing anyway. It just takes away some of the advantages of using flexbox.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

Here is something for you that shows how regions works, and yes it can also be done with flexbox -

https://rachelandrew.co.uk/archives/2016/03/25/css-grid-and-css-regions/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

pziecina  wrote

Here is something for you that shows how regions works, and yes it can also be done with flexbox -

https://rachelandrew.co.uk/archives/2016/03/25/css-grid-and-css-regions/

Humm........ ok I'll drill down into it a bit more tomorrow. Its just something I came upon accidentally as I don't often include text-wrap arounds in many of my projects, for some reason. As I'm now incorporating Flexbox when ever I can obviously it would be nice to achieve such an effect using that workflow.

Happy days!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

Just remember what i keep trying to tell web developers, if you can do it in a magazine layout, or using inDesign, you can if you know what to use, and are willing to use polyfills, do it for the web now.

Mind you, not many people listen or want to listen, especially those using a certain framework.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2017 May 26, 2017

Copy link to clipboard

Copied

pziecina  wrote

Just remember what i keep trying to tell web developers, if you can do it in a magazine layout, or using inDesign, you can if you know what to use, and are willing to use polyfills, do it for the web now.

Mind you, not many people listen or want to listen, especially those using a certain framework.

Yeah. You'll not be able to see this on a pad - might need a desktop as its only an experimental mock-up done by some 'out there' developer:

geospace

I think its pretty different and the way things are going to go from where we are now, which is getting rather boring in terms of innovative layouts.

Edited:

Actually you might be able to see something on a pad - most of the layout features have been simplified for mobile though, its best viewed on a desktop.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2017 May 31, 2017

Copy link to clipboard

Copied

Arrived back home about 1.5 hrs ago, any quickly put this together to give you an idea of how css regions works. My original thoughts when I first tried css regions, was that it would make an ideal small site system for e-comm, (about a dozen items max) as it would only require the text/images updating to change any content.

Here is a quick demo of using regions, (I cut/pasted code from other test pages, so not ideal) to give you an idea of using css regions.

http://www.pziecina.com/Adobe/regions/fb_start_regions.html

I did not include the IE code though as I know you are on a Mac, so do not require it. The js polyfill file is used so that you can download it if you wish. Don't forget that the polyfill does require the '-adobe-' prefix in the css.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2017 May 31, 2017

Copy link to clipboard

Copied

After looking into css regions and doing a bit of trickery pokery I'm not sure css regions can do what I wanted using Flexbox. It might be able to do it when css grid arrives but I think Flexbox is fairly linear in its workflow. Going back to my original problem - I dont have another container to flow text into - the text just literally needed to flow around and under the <div> which had been shortened in height at the media query break point.

The example that Rachel uses is just literally a series of empty containers- linked together via css regions. I dont have any empty containers.

In my view the someone who invented Flexbox missed this completely - they needed to allow for text content in a column to span 2 columns if required and flow around and under a shortened column for it to be truely useful, but hey-ho nothing is perfect, it is what it is.

Using float is probably the correct solution as that is what float was originally intended for - to make text flow around an image. Its just a bit of a pain having to de-flex some elements at a given break point - well not really  - quite simple but it could have been cleaner if the Flexbox spec had taken this into consideration, maybe it just cant and I'm hoping for toooooo much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2017 May 31, 2017

Copy link to clipboard

Copied

If you had IE I could show how to do that using css exclusions.

MS is waiting to include css shapes when level 2 is finalized, and the other browsers are planning on including css exclusions along with css shapes level 2. So don't expect an easy way until both specs are updated.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2017 May 31, 2017

Copy link to clipboard

Copied

pziecina  wrote

If you had IE I could show how to do that using css exclusions.

MS is waiting to include css shapes when level 2 is finalized, and the other browsers are planning on including css exclusions along with css shapes level 2. So don't expect an easy way until both specs are updated.

I'll probably have another layout issue to address once all that is finalised which can only be done by something else which is not included, as yet.....infinite circle.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2017 May 31, 2017

Copy link to clipboard

Copied

osgood_  wrote

I'll probably have another layout issue to address once all that is finalised which can only be done by something else which is not included, as yet.....infinite circle.

You'll probably be long retired by the time they include them, so I would not worry about layout problems, lying in bed problems will be your biggest worry .

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 31, 2017 May 31, 2017

Copy link to clipboard

Copied

pziecina  wrote

You'll probably be long retired by the time they include them, so I would not worry about layout problems, lying in bed problems will be your biggest worry .

Quite right, I think this one is off my radar, I'll leave that to the 'kids' to have fun with. I've done my time 10x over.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

Hi Os,

Even though i don't think you will be using this in the near future, the css wg, has published the overflow module level 4, which some time in the future, could also be used to achive the 'wrap arround text flow' on a page.

The overflow module level 4 -

https://www.w3.org/TR/2017/WD-css-overflow-4-20170613/

As it is a Mozilla spec, and given that Chrome will probably never include css regions again, it may be worth users watching browser/spec developments of css overflow 4, as a combination of css exclussions and this new module may be more readily included in Firefox and Chrome, than css regions would be.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

pziecina  wrote

Hi Os,

Even though i don't think you will be using this in the near future, the css wg, has published the overflow module level 4, which some time in the future, could also be used to achive the 'wrap arround text flow' on a page.

The overflow module level 4 -

https://www.w3.org/TR/2017/WD-css-overflow-4-20170613/

As it is a Mozilla spec, and given that Chrome will probably never include css regions again, it may be worth users watching browser/spec developments of css overflow 4, as a combination of css exclussions and this new module may be more readily included in Firefox and Chrome, than css regions would be.

Interesting, still would not have sorted out my original problem. I just wanted the text from one flex column to simply run-around an image which was in another 'shortened' flex column in the same parent container but NOT as a 2 columns layout, just the one column. Float sorted that out and thats ok because that was what float was originally intended to be used for, so all was good. I didn't feel I should  not use float because in a situation like I was facing it was legitimate to use according to the spec.

I can see the concept of the text flowing to another container (like css regions) or another container being created if the content runs out of room which may be useful in months/years ahead. I suspect in a few years the way we develop websites will yet again be completely different, given the myriad of new concepts on the horizon. Whether or not I'll still be doing this when they arrive only time will tell.

Its a beautiful sunny day here and I'm in the garden for much of the afternoon, not stuck behind some desk pushing out what is largely boring repetitive coding and even more, pointless websites usually destroyed by the client before they get off the ground, or shortly after if they have access to a CMS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

not stuck behind some desk pushing out what is largely boring repetitive coding

Good onya!

When you get back to the desk, try some of the wonderful extensions for Dreamweaver to take on the boring bits of a project.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

BenPleysier  wrote

When you get back to the desk, try some of the wonderful extensions for Dreamweaver to take on the boring bits of a project.

Unfortunately they don't do what I personally need and require. I'm not the kind of person that settles for second best, regardless of how boring it gets. If a jobs worth doing its worth doing well, not using some second rate solution which are what they are and offer limited options. I guess some people are satisied, just not me. Different strokes for different folks. I always find the more useless a devloper is the less they complain as they have low standards to meet.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

I always find the more useless a devloper is the less they complain as they have low standards to meet.

You can't help your cantankerous self can you. It is always best to put others down to make yourself look better, Well done!

As a side note to others reading this, using the excellent Dreamweaver extensions from DMXzone, I have managed to cut my development time to 25%. I have been testing their latest extension due on Wednesday that allows me to add an HTML editor to any text-area with one click.

The flexibility of the extension allows editing a webpage directly as per Using App Connect Medium Editor Regions - YouTube or changing a text-area (e.g. comments in a contact form or part of the CMS) as per Using App Connect Medium Editor Textarea - YouTube.

Of course I could code this myself, but with testing included, it would take me a number of hours rather than a number of minutes.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

BenPleysier  wrote

I always find the more useless a devloper is the less they complain as they have low standards to meet.

You can't help your cantankerous self can you. It is always best to put others down to make yourself look better, Well done!

Its not my fault I may set myself higher standards than yourself, that's just the way it is, try raising yours. Why expect someone else to come down to your level?

I'd consider myself not as good as I want to or need to be and have always said so in this forum, its nothing about making myself look better, thats a ridiculous suggestion, which could only come from someone who has low standards.

BenPleysier  wrote

As a side note to others reading this, using the excellent Dreamweaver extensions from DMXzone, I have managed to cut my development time to 25%. I have been testing their latest extension due on Wednesday that allows me to add an HTML editor to any text-area with one click.

At what cost, to produce something which in many good developers eyes may be second best? Extensions can only offer a very limited amount of options and come with no finesse. That may or may not be good enough for some. Like that's new. I had an inline html editor solution using ajax at least a year back. Are they any good, yes, in some simple senarios, in others they are useless.

BenPleysier  wrote

I always find the more useless a devloper is the less they complain as they have low standards to meet.

Of course I could code this myself, but with testing included, it would take me a number of hours rather than a number of minutes.

As I said you get what an extension gives you and IF that's acceptable then that's fine. Once you move on a bit and can imagine it you will want to code it, no extension is capable of that. Anyone can use a framework and a handful of extensions to knock out a 'poor' website in a matter of minutes, just depends on ones own expectation of the final user experience and what the result should be. Our opinions are way apart, no surprise there then.

And grief since you posted you've also frightened the sun away.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

And grief since you posted you've also frightened the sun away.

The sun and I are on the same wave, we both shy away from you.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

BenPleysier  wrote

And grief since you posted you've also frightened the sun away.

The sun and I are on the same wave, we both shy away from you.

You I can and am willing to accept, the sun no.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2017 Jun 13, 2017

Copy link to clipboard

Copied

  wrote

   wrote

And grief since you posted you've also frightened the sun away.

The sun and I are on the same wave, we both shy away from you.

You I can and am willing to accept, the sun no.

Facts cannot be disputed.

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines