html5 - Moving a particular column element to the top of a row in bootstrap -
i need align section information shown in figure. here's desktop view :
and here's mobile view, section header "welcome" should move top of row in mobile view shown in figure
but in program, sticks paragraph expected , comes down under image.
note: image shown desired output i'm not getting. new css , need solve issue. here's code
.col-centered { text-align: left; padding-top: 10px; padding-bottom: 10px; }
<div class="row"> <div class="col-sm-5 col-centered"> <img class="img-responsive" src="./assets/welcome_image.png" alt="welcomeimage" /> </div> <section class="col-sm-7 col-centered"> <h2 id="textheading">welcome</h2> <p>provide highest quality education students. give studnets more promise them.children of ages between 18 months , 6 years extremely receptive. kids planet kids pre-schools' fun filled programme makes of encouraging childrens understand , develop socail skills, gross , fine major skills , creativity @ same time, throug songs, music , imaginative play.</p> <p><mark> read more </mark></p> </section> </div> <div class="row"> <div class="col-sm-5 col-centered"> <img class="img-responsive" src="./assets/aboutusimage.png" alt="aboutusimage" /> </div> <section class="col-sm-7 col-centered"> <h2 id="textheading">about us</h2> <p>kids planet leading education , test preparation comapny, head quartered in secunderabad, has grown specialist, multi-location, multi-programme training provider having 118 cities across india. kids planet leading education , test preparation comapny, head quantered in secunderanbad. has grown specialist, multi-location, multi-programme training provider having 118 cities across india.</p> <p><mark> read more </mark></p> </section> </div>
updated
now, new information, need make use of helper classes show/hide elements
i created duplicate h2
element show/hide according width of viewport , placed on top of image. this:
<div class="visible-xs-block col-xs-6 col-xs-offset-3"> <h2 id="textheading">welcome</h2> </div> <div class="col-xs-6 col-xs-offset-3 col-sm-5 col-sm-offset-0"> <img class="img-responsive" src="http://lorempixel.com/300/300" alt="welcomeimage" /> </div> <section class="col-xs-6 col-xs-offset-3 col-sm-7 col-sm-offset-0"> <h2 id="textheading" class="visible-sm-block visible-md-block visible-lg-block">welcome</h2> ... </section>
i removed need col-centered
, made use of col-xs-offset-#
needed.
let me know if not work :)
see updated demo:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <!-- latest compiled , minified css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-bvyiisifek1dgmjrakycuhahrg32omucww7on3rydg4va+pmstsz/k68vbdejh4u" crossorigin="anonymous"> <!-- optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rhyon1irsvxv4nd0jutlngaslcjuc7uwjduw9svrlvryoopp2bwygmgjqixwl/sp" crossorigin="anonymous"> <!-- latest compiled , minified javascript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-tc5iqib027qvyjsmfhjomalkfuwvxzxupncja7l2mcwnipg9mgcd8wgnicpd7txa" crossorigin="anonymous"></script> <div class="row"> <div class="visible-xs-block col-xs-6 col-xs-offset-3"> <h2 id="textheading">welcome</h2> </div> <div class="col-xs-6 col-xs-offset-3 col-sm-5 col-sm-offset-0"> <img class="img-responsive" src="http://lorempixel.com/300/300" alt="welcomeimage" /> </div> <section class="col-xs-6 col-xs-offset-3 col-sm-7 col-sm-offset-0"> <h2 id="textheading" class="hidden-xs">welcome</h2> <p>provide highest quality education students. give studnets more promise them.children of ages between 18 months , 6 years extremely receptive. kids planet kids pre-schools' fun filled programme makes of encouraging childrens understand , develop socail skills, gross , fine major skills , creativity @ same time, throug songs, music , imaginative play.</p> <p><mark> read more </mark></p> </section> </div> <div class="row"> <div class="hidden-sm hidden-md hidden-lg col-xs-6 col-xs-offset-3"> <h2 id="textheading">about us</h2> </div> <div class="col-xs-6 col-xs-offset-3 col-sm-5 col-sm-offset-0"> <img class="img-responsive" src="http://lorempixel.com/300/300" alt="aboutusimage" /> </div> <section class="col-xs-6 col-xs-offset-3 col-sm-7 col-sm-offset-0"> <h2 id="textheading" class="visible-sm-block visible-md-block visible-lg-block">about us</h2> <p>kids planet leading education , test preparation comapny, head quartered in secunderabad, has grown specialist, multi-location, multi-programme training provider having 118 cities across india. kids planet leading education , test preparation comapny, head quantered in secunderanbad. has grown specialist, multi-location, multi-programme training provider having 118 cities across india.</p> <p><mark> read more </mark></p> </section> </div>
old answer deleted after clarifications
Comments
Post a Comment