37

Given a basic four-column layout with a simple continuous paragraph of text, along with just one image spanning three columns, top-right aligned, how can we span our image over the final three columns so that our text flows automatically around the image?

enter image description here

.quatroColumns{}             /* css multi column 4 columns */
.imageSpanning2Columns{}     /* align to top-right */
.imageSpanning3Columns{}     /* align to top-right */
.imageDescription{}          /* description box over image */

http://jsfiddle.net/Vbr9d/205/ (a pain to find where the image should go: not simple & not elegant)
http://jsfiddle.net/Vbr9d/206/ (looks ugly, but HTML starts elegantly seperating image & text pragraph)

Sam
  • 15,254
  • 25
  • 90
  • 145
  • 2
    Question, are the column widths fixed or variable? – KimvdLinde Oct 31 '15 at 05:05
  • 5
    Before even attempting to solve this I'd like to clarify something. Looking at your jsfiddles you only have one

    tag with a huge text block inside it. That's really not an ideal way of writing. A

    tag is supposed to just be one paragraph of text. A more ideal markup would, imho.

    ...

    – stenehall Oct 31 '15 at 10:12
  • 1
    @KimvdLinde Good question! Since this problem (*with only ONE paragraph of continuous text and only ONE image*) seems already vastly complex and impossible to solve elegantly as of yet, let's stick to Fixed width! At least until the year 2050, by which time *hopefully* CSS will be matured enough to allow for such basic layouts online – Sam Nov 01 '15 at 16:58
  • Okay, in that case my solution below does the job (including firefox). Flexible column width will remain an issue of course. – KimvdLinde Nov 02 '15 at 15:08
  • 3
    @KimvdLinde I don't really see your solution as a solution to the problem given that you actually split the text to make it all look ok. That's the one restriction that I interpreted as important, not to split up the paragraph. – stenehall Nov 02 '15 at 23:06
  • 2
    @stenehall I personally think splitting data over two divs so that it works at all browsers is preferably ober a solution that does not work at all in some browsers. But that is me. It is really easy to propose solutions that do not yet work and depends on implementation of features. And as far as I can see, the OP asks explicitly that: "Provided solution needs to work only on current, major browsers __FireFox__ InternetExplorer Chrome Safari." – KimvdLinde Nov 03 '15 at 01:10
  • @KimvdLinde I also provide a solution that works perfectly ok in Firefox without splitting up the paragraphs. But I still find the question vague regarding what browsers to support. I interpreted the capitalized part as the most important and based my main solution on that. – stenehall Nov 03 '15 at 07:12
  • 2
    @stenehall The capatalized part was the second part of a sentence starting with "Alternative javascript tryouts for splitting the paragraph text into different divs automagically are welcome too, but ..." That was for __javascript__ solutions, not css solutions. Anyway, the second solution you added seems to work on all browsers. – KimvdLinde Nov 03 '15 at 14:54
  • 2
    @stenehall sorry if am vague in my question I will clarify then give you space to ask Anything you like, which I promise to answer! Reason why I waited commenting was because I wanted to be polite and leave room for other stackoverflowers to participate, comment, and not "preach in my on church" (old Dutch saying) In other words: I give others room to reply before replying myself as the first person. – Sam Nov 03 '15 at 18:19
  • 2
    Clarifications: solution should work in these major browsers FF IE Safari Chrome, all in their newest/current versions. Total column width is fixed for normal monitor screen width. Very big bonus for @stenehall thinking about other smaller sizes like mobile/tablet media css and automatically downsizing from three column image span to two or just one. Bravo for coming up with this AND trying to solve the problem elegantly. Also thanks KimvdLine for your ideas and contributions sofar. – Sam Nov 03 '15 at 18:19
  • I wonder how you'll make four columns look good in a browser, given none of them have hyphenation or even slightly sophisticated line breaking algorithms.. – Thomas Ahle Nov 10 '15 at 12:10
  • @Thomas Ahle hyhens ARE possible in CSS check out this link: https://css-tricks.com/almanac/properties/h/hyphenate/ – Sam Nov 13 '15 at 10:11

4 Answers4

28

This is a cleaned up solution that should work in all major browsers. It relays on an absolute positioned image instead of using column-span since Firefox not yet supports that.

/* Just to make it look a little nicer */
body {
  font-size: 16px;
  line-height: 1.4;
  color: #333;
  padding: 1em;
}


article {
  /* We're giving our article a max-width. This isn't needed if a parent already does this.*/
  max-width: 860px;
  
  /* Create a 4 column layout */
  -webkit-column-count: 4;
     -moz-column-count: 4;
     column-count: 4;

  /* Give each column a little added spacing */
  -webkit-column-gap: 20px;
     -moz-column-gap: 20px;
     column-gap: 20px;
     
  /* To be able to absolute position the image we need to give the parent a position */
  position: relative;
  
  /* This pulls up the first column of text to align with the image */
  padding-top: 225px;
}

article img {
  /* Absolute position our image */
  position: absolute;

  /* Place it in the top right cornet */
  top: 0;
  right: 0;

  /* Give it a height of 200px, this can of course be change if needed. If you update the height here make sure you also change the padding-top of the article and the negative margin later down. */
  height: 200px;
  
  /* We only want the image to spread 3 columns in width, that's 75% of the entire width. We also use 10px (half of the column-gap). */
  width: calc(75% - 10px);

}

/* Give the first paragraph a negative margin to pull it back up. (right now we're only using one parapgrah but if you'd want more in the future lets be specific here) */
article p:first-of-type {
  margin-top: -225px;
}

/* Some media queries to make it look nice on all resolutions */
@media screen and (max-width: 800px) {
  article {
    padding-top: 0;
    -webkit-column-count: 2;
       -moz-column-count: 2;
       column-count: 2;
  }
  article p:first-of-type {
    margin-top: 0;
  }
  article img {
    position: static;
    margin: 0 0 30px;
    width: 100%;
    height: auto;
  }
}
@media screen and (max-width: 600px) {
  article {
    -webkit-column-count: 1;
       -moz-column-count: 1;
       column-count: 1;
  }
}
<article>
  <img src="http://www.robfraser-photographer.co.uk/wp-content/uploads/2012/07/SHOT-9.jpg" />
<p>Het was 17 graden onder nul toen het ijs onder onze benen begon te kraken. Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam. Paragraph Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.Nam liber tempor cum soluta. nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam.Paragraph Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam.Paragraph Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim ass.</p>
</article>

For a scss version of this look at the this codepen

This answer originally contained a solution using column-span (sadly not yet supported by Firefox). For reference I've added this solution as a separate answer to this question.

stenehall
  • 1,145
  • 7
  • 9
  • 1
    +1 stenehall for your idea and great elaboration! Unfortunately in my *most used* browser FireFox (newest version) the result is still far from complete. Have you seen the result yourself? SooO strange why FireFox chose to stay behind others! Maybe someone has a fix for this, in that case your suggestion is *the* answer! (that is why I waited hoping for good news/FireFox fix) – Sam Nov 03 '15 at 09:08
  • 2
    If you look at my last codepen that solution does work in Firefox, even if it's not as clean an the first one. From what I know there's no solution to get column-span working in Firefox. – stenehall Nov 03 '15 at 09:12
  • 1
    HOLD YOUR HORSES!! @stenehall Bravo for your additional steps! Let us have a new look at your new proposal! (Please remove the part that does NOT work on FireFox and place that as a different answer!) Let us test your final link, the one that also does works in FireFox and other major browsers in our different browsers in their current versions (FF, IE, Chrome, Safari) and platforms and report back here in the footnotes check wheather it looks okay on your machine/browser combination. I will break the ice in the following comment: – Sam Nov 03 '15 at 17:35
  • 1
    OH NO! I tried your html and css myself, but it does NOT work in Firefox 41 NOR Internet Explorer 11! Inside the codepen.io demo it "looks like" working in their own demo, however when I built it up in a real world html file with css (with -moz added in your css) it all breaks apart in both browsers! Why is that??? Can you please clean up your answer, and provide ONE example that works in FireFox when tested without code pen? Your current final codepen does not work in FIrefox and IE 11 if tested separately, try it yourself! – Sam Nov 05 '15 at 21:23
  • I've been very busy last two days and haven't had time to clean it up, sorry. Will try to do that tomorrow. As to why your implementation of it is broken I can't say without looking at your code. My codepen only contains the parts needed for this and shows that it does indeed work. The most likely case is that you've added something to your own site that breaks the layout. – stenehall Nov 05 '15 at 21:24
  • great if you want to look tomorrow at it! No I tested your own clean code and in FireFox 41 and IE 11 both did not work. Try for yourself! Strange in codepen it works but not when the html and css are copied into a plain true html file and tested online! – Sam Nov 05 '15 at 21:28
  • 1
    And did you copy the scss or css version? If you copied the code directly from the codepen you would most likely have copied the scss version. That needs to be run throw a scss interpolater + an autoprefixer to work. I've cleaned up my response above, that uses the css version of – stenehall Nov 05 '15 at 21:40
  • thanks for your update! I understand! See this version! how do you like it? I like it very much, please check it if you have any improvements or suggestions for futureproofing it, and edit this version: http://jsfiddle.net/Vbr9d/222/ FINAL QUESTION: how to add a few words of description? I suggest the image alt text or separate div or quote text could function as the title box over the photo, bottom-right aligned. How you suggest this should be done in my modded example? By now you have an idea to whom my bounty goes ;) – Sam Nov 06 '15 at 00:04
  • 1
    This is how I'd add the drop caps and the caption for the image. http://jsfiddle.net/Vbr9d/224/ The reason I'm not using the alt text is because there's no clean way to show that. There's hacky ways to display the alt text as img:before but no proper way. Wraping the image in an figure and adding a figcaption IS the correct way of doing it. I'll see if I have the time to update my original codepen with this later tonight. – stenehall Nov 06 '15 at 09:02
  • +1 great! Your added lineheight fixed the drop cap in IE. THIS VERSION I SLIGHTLY MODDED >> http://jsfiddle.net/Vbr9d/228/ now PERFECTLY on IE 11, FF 42 and CHROME. However, in Safari the image spans over all 4 columns, covering the first column entirely!! If you find time, please address this problem that occurs only in Safari. – Sam Nov 06 '15 at 11:52
  • +500 congrats @stenehall With honor I award you my 500 bounty points for such excellent answer that tackled the problem very elegantly and timelessly (eventhough it does not work on Safari, I am sure we will find a resolution for that too) – Sam Nov 06 '15 at 15:38
  • most probably reason why it doesnt work in my Safari is because im testing it it old (yet newest) version 5 for Windows?! Can you confirm that this solution *does* work on your Safari on Macs? – Sam Nov 07 '15 at 16:15
  • 1
    Thank you for the +500 :) It's been fun to figure this layout out as well. Apple stoped developing Safari for Windows a long time ago and the usebase is extreamly small, if not completely gone. The solution does work on Safari for OS X (https://www.dropbox.com/s/bwxfasz2es1k3au/Screenshot%202015-11-07%2019.26.30.png?dl=0) – stenehall Nov 07 '15 at 18:28
  • 1
    Consider adding `hyphens`: https://developer.mozilla.org/en/docs/Web/CSS/hyphens it will make the columns look a little better at least. – Thomas Ahle Nov 10 '15 at 12:15
  • @Thomas Ahle, +1 thanks very much for your suggestion, I am experimenting with this indeed, looks much better more readable too getting rid of the long spaces, however, this does not work on Chrome and on Internet Explorer: http://stackoverflow.com/questions/33683971/automatic-hyphenation-of-words-in-a-clean-easy-simple-css-only-solution-for-ff-a – Sam Nov 23 '15 at 12:50
  • @stenehall, a question about line alignment. Depending on the height of the image, I experience that the lines on the first column are not always aligned to the other three columns. Is there a setting to afix the lines on a baseline grid, or alternatively set a lineheight that at least fixes all four columns lines to the same grid? At this moment I am trying to find which css parameters are respondible for the lineheight shift on the first and three rest columns... – Sam Nov 23 '15 at 12:53
  • 1
    @Sam, I don't know about the IE hyphenation, but check https://github.com/bramstein/typeset which also uses the Knuth line breaking algorithm for more even spacing. – Thomas Ahle Nov 23 '15 at 15:00
  • @Thomas Ahle, +1 gosh that is sweet, and it complements the js version of browserproof hypehing: check out: http://hyphenator.googlecode.com/svn/trunk/mergeAndPack.html I will implement your js into this and see hwo the combination works. Meanwhile, any idea how to level all four lines onto a baseline grid sothat nomatter the height of the image, the first and the rest of the three columns text are aligned? – Sam Nov 23 '15 at 18:27
  • Does not work with Chrome (mac OSX): Added a new post: https://stackoverflow.com/questions/46848645/css-column-count-3-image-floating-spanning-2-chrome-not-playing-why and a fiddle https://jsfiddle.net/20drzb3k/5/ - Chrome hides the text affected by negative top margin. – Daniela Oct 20 '17 at 12:04
4

To keep the original suggested solution using column-span instead of an absolute positioned image.


Here's my suggested solution for this. The only thing you need to know is the height of the image, this might not be ideal but I think this solution is as close to perfect as it gets.

No javascript is used to calculate the columns, no added elements or classes are needed to make it work. I split up the block of text into multiple paraphrase since I think that's a more correct way of doing it. However this solution does not depend on the multiple paragraphs, you could remove them and it would still work the same. I just randomly added paragraphs to get a more natural text.

The following are the important parts.

article{
  column-count: 4; /* Create 4 columns */

  img {
    /* For an image to work with column-span it needs to be a 
       block element */   
    display: block;

    /* Now we can let the image expand to all columns */
    column-span: all;

    /* We'll need to give the image a fixed height.
       A problem here is if we want a responsive layout. This wont 
       respect the aspect ratio of the image. That could be solve
       by only allowing an adoptive layout and set hard heights
       on the image. */
    height: 200px;

    /* Give it some margin to the columns under it */
    margin-bottom: 25px;

    /* Now comes the trick, first we want to push the image one 
       column to the right, that will be 25%, we're also adding
       some extra spacing to make it look nicer */
    margin-left: calc(25% + 10px); 

    /* Since we've pushed it one column to the right we only
       want it to take up 75% (3/4) of the total width. */
    width: calc(75% - 10px);
  }

  /* Lastly we want to give the first paragraph a negative margin
     equal to the image height. This will move the first column
     up to align with the top of the image. */
  p:first-of-type { margin-top: -($imageHeight+25); }
}

The full, working, example

/* Just to make it look a little nicer */
body {
  font-size: 16px;
  line-height: 1.4;
  color: #333;
  padding: 1em;
}

article {
  max-width: 860px;
  -webkit-column-count: 4;
     -moz-column-count: 4;
          column-count: 4;
  -webkit-column-gap: 20px;
     -moz-column-gap: 20px;
          column-gap: 20px;
}
article img {
  display: block;
  -webkit-column-span: all;
     -moz-column-span: all;
          column-span: all;
  height: 200px;
  width: calc(75% - 10px);
  margin-bottom: 25px;
  margin-left: calc(25% + 10px);
}
article p {
  margin-bottom: 1.3em;
}
article p:first-of-type {
  margin-top: -225px;
}

@media screen and (max-width: 800px) {
  article {
    -webkit-column-count: 2;
       -moz-column-count: 2;
            column-count: 2;
  }
  article p:first-of-type {
    margin-top: 0;
  }
  article img {
    margin: 0 0 30px;
    width: 100%;
    height: auto;
  }
}
@media screen and (max-width: 600px) {
  article {
    -webkit-column-count: 1;
       -moz-column-count: 1;
            column-count: 1;
  }
}
<article>
  <img src="http://www.robfraser-photographer.co.uk/wp-content/uploads/2012/07/SHOT-9.jpg" />
  <p>Het was 17 graden onder nul toen het ijs onder onze benen begon te kraken. Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam. Paragraph Duis autem vel eum
    iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
  <p>Nam liber tempor cum soluta. nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
    Ut wisi enim ad minim veniam.</p>
  <p>Paragraph Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore
    te feugait nulla facilisi.</p>
  <p>Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim
    ad minim veniam.</p>
  <p>Paragraph Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore
    te feugait nulla facilisi.</p>
  <p>Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim ass.</p>
</article>

Please run the demo in full screen mode to see the responsive columns.

On a side not, you can actually span images without added wrappers as seen in my example.

To make it a little bit nicer I also added two media queries. The layout will go from 4 to 2 to 1 column based on the width of the screen. The nice part of keeping the image as the first element is that on smaller screens it will show up first.

I've also added a codepen example of what it would look like written in scss with the image height as a variable and using autoprefixer to keep the css a bit more clean. Since we're using column we of course limit the browser support but that seemed to be an ok solution.

http://codepen.io/stenehall/pen/yYEEva?editors=110

Please not that this solution only works in Chrome and Safari but not Firefox. Since firefox does not yet support column-span https://developer.mozilla.org/en-US/docs/Web/CSS/column-span. According to that article Internet Explorer should work but I've not tested it.

stenehall
  • 1,145
  • 7
  • 9
  • Actually, it does not work with Chrome. Added a new post: stackoverflow.com/questions/46848645/… and a fiddle jsfiddle.net/20drzb3k/5 - Chrome hides the text affected by negative top margin. – Daniela Oct 20 '17 at 12:08
1

I think that splitting the text in two blocks is currently the only solution. Bascially, you float the image right, place a first single column diff with the first text next to it and than place a second four column diff with the remaining text under it.

This solution works in firefox!

HTML:

<div>
    <img src="http://www.robfraser-photographer.co.uk/wp-content/uploads/2012/07/SHOT-9.jpg" class="imageSpanning3Columns"/>
</div>
<div>
    <p class="singleColumns border">Het was 17 graden onder nul toen het ijs onder onze benen begon te kraken. Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam. Paragraph Duis autem vel eum iriure dolor in hendrerit in </p>
</div>
<div>
    <p class="quatroColumns border">vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam. Paragraph Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam. Paragraph Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim ass.

CSS:

.quatroColumns{             /* css multi column 4 columns */
    -webkit-column-count: 4; -webkit-column-gap: 20px; /* Chrome, Safari, Opera */   
    -moz-column-count: 4; -moz-column-gap: 20px; /* Firefox */
    column-count: 4; column-gap: 20px;
    width: 860px;
    font-size: 15px;
    text-align: justify;
}

.singleColumns{             /* css multi column 4 columns */
    -webkit-column-count: 1; -webkit-column-gap: 20px; /* Chrome, Safari, Opera */   
    -moz-column-count: 1; -moz-column-gap: 20px; /* Firefox */
    column-count: 1; column-gap: 20px;
    width: 198px;
    font-size: 15px;
    text-align: justify;
}

.singleColumns:first-child:first-letter {
    float: left; font-size: 67px; margin:  7px 5px -10px 20px;
}

.imageSpanning3Columns{     /* align to top-right */
    width:640px;
    top: 0 px;
    float:right;
}

.border{
    border: solid 0px;
    margin: 0px;
}

Here is a fiddle with an example:http://jsfiddle.net/1ye9tyhq/

KimvdLinde
  • 587
  • 8
  • 19
  • 1
    +1 Eventhough your method still needs manual labour to separate our text between the columns, instead of having the css multicolumn do the magic for us. Nevertheless I upvoted your answer for your idea+tryout! Every bit helps and inspires towards a timeless solution. – Sam Nov 03 '15 at 08:30
1

Hello: Please find an example of my answer HERE

HTML CODE

<div id="news_paper">

    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat.
    </p>
    <img id="news_paper_image" src="http://lorempixel.com/600/275/">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </p>   
</div>

CSS CODE

#news_paper{
  margin: 7rem auto;
  width: 70%;
}

#news_paper > p{
  width: 22%;
  float: left;
  padding: 1%;
  text-align: justify;
}

#news_paper > p:first-child{
  margin-top: -1rem;
}

p{
  font-family:sans-serif;
}
#news_paper > p:first-child::first-letter{
  font-size: 2.5rem;
  color: whitesmoke;
  float: left;
  margin-top: -0.25rem;
  padding: 0 0.25rem 0.25rem;
  background-color: tomato;
}

#news_paper_image{
  width: 70%;
  float: left;
  margin-left: 1%;
}

THANKS T04435

T04435
  • 12,507
  • 5
  • 54
  • 54
  • thanks and +1 for your answer and for your example. I see your answer is inspired by (it functions essentially the same as) that of KimvdLinde. Are you, like KimvdLinde proponent of including the image in the paragraph? if Yess, can you explain in your answer why you think this is the best solution? Because this needs more manual labour and changing the text needs changing the place where the image is placed. – Sam Nov 05 '15 at 14:21