0

I have a w3.css card and in it a header, main, and footer. I want the main - which has a background-image - to behave like w3-rest in the columns of a row of the w3.css fluid-grid, filling in all the width. In other words, I want it to stretch and hold the whole area available between the header and footer VERTICALLY, filling in all the HEIGHT.

See for example my code here:http://jsfiddle.net/pashute/qnj1ptu2/

<section id="section--theme-results" class="w3-card-4">
  <header class="w3-theme"><h4>Theme results</h4></header>
  <main id="secphone" 
        class="w3-card-4" 
        style="background-size: cover; 
               background-image: url('images/cellphone.png');">
    it is only showing a few lines of text<br>
    but I want it to span the whole height <br>
    and show the background phone image inside<br>
    I should not have to fill this with content<br> 
    and I want the whole bg image to show. 
  </main>
  <footer>The end</footer>
</section>

I want the whole main section to show all the rows so that the background image is totally shown.

How do I do so with w3.css? Or is there a semantic tag in HTML5 for such behavior?

Or must I style it manually in the style with display: flex; flex-direction: column; (as in answer here How to create div to fill all space between header and footer div which is not working in any case...) ?

pashute
  • 3,965
  • 3
  • 38
  • 65
  • 2
    Welcome to Stackoverflow, Without code we can't help you, Please create snippet so someone has quickly fixed your issue. Cheers. – jaydeep patel Nov 26 '18 at 10:47
  • I'm not exactly a newbee... :-) but your right. So edited. Question is for people who know w3school's w3.css well. – pashute Nov 26 '18 at 11:55
  • and btw, the flex is not working with the w3.css for some reason... See my latest fiddle: (set with: `background-repeat: no-repeat;` and with: `background-size: cover` remarked out) http://jsfiddle.net/pashute/qnj1ptu2/ – pashute Nov 26 '18 at 13:26
  • Bump. Can anybody take a look? – pashute Sep 08 '20 at 13:41

0 Answers0