html - CSS Foundation making left div go below right div on small screens -
i have layout header have title bar
, , 2 divs. div on left takes 4 columns
on big screens , 1 on right takes 8 columns
. 1 on right has image takes whole div's width. on small screens left div go below right div, problems on small screens left div disappears under right div. html:
<div class="header row row-wrapper"> <div class="frontpage-header-content"> <?php while ( have_posts() ) : the_post(); ?> <div class="large-4 medium-12 columns lcol"> <h3><?php the_title(); ?></h3> <div class="border"></div> </div> <div class="large-8 medium-12 columns rcol"> <div class="hero-image-wrapper"> <?php the_post_thumbnail(); ?> <div class="overlay"></div> </div> </div> </div> <div class="header-title-bar"> <div class="row"> <div class="large-12 columns"> <div class="title-bar"> <div class="title-bar-left"> <button class="menu-icon" type="button" data-open="offcanvasleft"></button> <span class="title-bar-title">meny</span> </div> <div class="title-bar-right"> <span class="title-bar-title">støtteforeningen kreftrammede</span> </div> </div> </div> </div> </div> </div><!-- /.header -->
and css:
.header-title-bar { position: absolute; top: 0; width: 100%; } .header .columns { padding-right: 0; } .hero-image-wrapper .overlay { position: absolute; bottom: 0; left: 0; width: 100%; height: 16px; background: rgba(255, 255, 255, .3); } @include breakpoint(medium down) { .row-wrapper{ width :100%; display: flex; flex-flow: row wrap; } .lcol{ float:left; order: 2; } .rcol{ float:right; order: 1; } }
this fiddle
if want text on left on large screens underneath on small, need use push
, pull
source ordering provided foundation.
note, had reorder html
, place div
containing text underneath image.
Comments
Post a Comment