How to properly use bootstrap push and pull - html

I've been trying to re-order my bootstrap columns when in mobile view but my code is just not working. Most probably because I am doing something incorrect.
Here is my markup:
<div class="container">
<div class="row text-center">
<div class="col-12">
<h2 class="mb-lg-4 mb-sm-3">Early Stages</h2>
</div>
<div class="col-md-7 col-sm-push-5">
<p>Also known as &apos;the Poor Fellow-Soldiers of Christ and of the Temple of Solomon&apos;, the Knights Templars were originally founded circa 1120 CE, by Hugues de Payens, as a means to protect Christian pilgrims to the Holy Land. It was originally intended that nine Templars would protect the pilgrims.</p>
</div>
<div class="col-md-5 col-sm-push-7">
Image Here
</div>
</div><!--/row-->
</div>
What I am trying to do is essentially make the "Image Here" section go above the "also known as the poor etc." section when in mobile view (col-sm). I looked at Bootstraps guide but I think I am understanding it incorrectly, can someone show me how its done?
Thanks in advance

Try this HTML
<div class="container">
<div class="row text-center">
<div class="col-12">
<h2 class="mb-lg-4 mb-sm-3">Early Stages</h2>
</div>
<div class="col-md-5 col-sm-push-7">
Image Here
</div>
<div class="col-md-7 col-sm-pull-5">
<p>Also known as &apos;the Poor Fellow-Soldiers of Christ and of the Temple of Solomon&apos;, the Knights Templars were originally founded circa 1120 CE, by Hugues de Payens, as a means to protect Christian pilgrims to the Holy Land. It was originally
intended that nine Templars would protect the pilgrims.</p>
</div>
</div>
<!--/row-->
Link for reference
hope this helps..

Related

Text-Center on Div not Centering the Text? (Twitter Bootstrap 3)

I'm currently working on the John's Hopkins HTML/CSS and Javascript course on Coursera coding the David Chu's China Bistro using Bootstrap 3.6 (outdated, I know). I came across a problem where the copyright line ended up underneath the third column (my site screensho) rather than centered at the bottom of the footer (official site screenshot). Here is the code for that footer section:
<footer class="panel-footer">
<div class="container">
<div class="row">
<section id="hours" class="col-sm-4">
<span>Hours:</span><br>
Sun-Thurs: 11:15am-10:00pm<br>
Fri: 11:15am - 2:30pm<br>
Saturday collapsed<hr class="visible-xs">
</section>
<section id="address" class="col-sm-4">
<span>Address:</span><br>
7105 Resterstown Road<br>
Baltimore, MD 21215
<p>* Delivery area within 3-4 miles, with minimum order of
$20 plus $3 charge for all deliveries.</p>
<hr class="visible-xs">
</section>
<section id="testimonials" class="col-sm-4">
<p>"The best Chinese restaurant I've been to! And that's saying
a lot, since I've been to many!"</p>
<p>"Amazing food! Great service! Couldn't ask for more! I'll be
back again and again!"</p>
</section>
<div class="text-center">© Copyright David Chu's China Bistro 2016</div>
</div>
</div>
</footer>
Now I understand that it isn't centered because the div with the copyright symbol should not be inside the div with class="row", but regardless I don't understand why the div is underneath the third column. All of the sections as per Bootstrap should be floated meaning that they are taken out of normal document flow. However, the copyright statement is not floated, so shouldn't that take up the entire width and be centered in the middle of the page? Sorry, I'm a bit of a beginner at HTML/CSS!
The solution is just to move it up one level outside and I think it will be solved.
<footer class="panel-footer">
<div class="container">
<div class="row">
<section id="hours" class="col-sm-4">
<span>Hours:</span><br>
Sun-Thurs: 11:15am-10:00pm<br>
Fri: 11:15am - 2:30pm<br>
Saturday collapsed<hr class="visible-xs">
</section>
<section id="address" class="col-sm-4">
<span>Address:</span><br>
7105 Resterstown Road<br>
Baltimore, MD 21215
<p>* Delivery area within 3-4 miles, with minimum order of
$20 plus $3 charge for all deliveries.</p>
<hr class="visible-xs">
</section>
<section id="testimonials" class="col-sm-4">
<p>"The best Chinese restaurant I've been to! And that's saying
a lot, since I've been to many!"</p>
<p>"Amazing food! Great service! Couldn't ask for more! I'll be
back again and again!"</p>
</section>
</div>
<div class="text-center">© Copyright David Chu's China Bistro 2016</div>
</div>
</footer>
If issue still exists, try to use p tag for copyright instead of div

Hopefully simple bootstrap question: Bootstrap column stacking weirdly on safari desktop?

So I've been using bootstrap for a while, I've got a super simple grid setup that's working perfectly fine on Chrome/Firefox, but is stacking improperly in Safari:
Here's the markup, which I really can't see anything wrong with! Also visible live at www.inspiringtravelcompany.co.uk in case you're looking at any containing divs.
<div class="w-100 pb-5" style="background-color:#f7f7f7">
<div class="container">
<div class="row">
<div class="col-12 col-md-6 order-2 order-md-1">
<p class="fs-20 mb-2 ChronicleDeckSemiBold" style="line-height:1.3;">
You may have seen us recently during your favourite television programmes – and if not we’d love to share our brand new video with you.
</p>
<p class="fs-14 mb-2 ChronicleDeck">
Take a look, and you’ll spot some of our most popular destinations and favourite bucket list spots around the world.
</p>
<p class="fs-14 mb-2 ChronicleDeck">
Here at the Inspiring Travel Company we specialise in bespoke, personalised and tailor-made holidays around the world to the most amazing places; so whether you’re after a relaxing ‘fly and flop’ break or an intrepid tour, a bucket list safari or a trip to catch the world’s premier sporting events, our Travel Specialists are ready and waiting to offer first-hand insight.
</p>
</div>
<div class="col-12 col-md-6 order-1 order-md-2 mb-4 mb-md-0">
<iframe class="w-100" width="640" height="385" src="https://www.youtube.com/embed/x5sqxiO_muk">
</iframe>
</div>
</div>
</div>
</div>
I just don't get what the problem is!

Added code to big commerce home page not showing up responsive

Im customizing a theme in Big Commerce and am having issues. I've never used this platform before and I am having trouble finding where and how to add code. On the home page I've added 2 new parts following the product listings. I dont undrstand the {{partial}} blocks of code. I tried adding my own and it didnt work. What did work was just adding my code to an existing {{partial}}. I added the following to the partial="page":
{{#partial "page"}}
{{#each shipping_messages}}
{{> components/common/alert-info message}}
{{/each}}
<div class="main full">
{{#if products.featured}}
{{> components/products/featured products=products.featured columns=theme_settings.homepage_featured_products_column_count}}
{{/if}}
{{#if products.top_sellers}}
{{> components/products/top products=products.top_sellers columns=theme_settings.homepage_top_products_column_count}}
{{/if}}
{{#if products.new}}
{{> components/products/new products=products.new columns=theme_settings.homepage_new_products_column_count}}
{{/if}}
</div>
<div class="message">
<div class="recycle">
<p class="light">Recycling takes a little effort on your part, but</p>
<div class="recycle-image">
<img src="https://res.cloudinary.com/adamscloud/image/upload/v1518463871/recycled-min_vwz3rb.png">
</div>
<p class="light">makes a Big difference to the World</p>
</div>
<div class="mission">
<h2>Our Mission</h2>
<p class="mission-text">
We offer unique hand crafted, recycle, upcycled, repurposed, comfortable, trendy, creative, cutting edge, ironically humorous, catchy, cool, inspiring items that are unisex and are for people of all ages from all walks of life.</p>
<p class="mission-text">Our goal is to put a smile on the Face of the World by inspiring, entertaining, bringing joy and laughter iinto peoples lives while cherishing our Mother Earth.</p>
<h2>READ MORE</h2>
</div>
</div>
<div class="gallery-image">
<div class="pic-group">
<div class="row">
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476220/gal-1_iryamj.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476222/gal-2_xnmdtp.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476220/gal-3_icq64o.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476223/gal-4_ei72ob.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476224/gal-5_yvljkk.png"></div>
<div class="small-12 large-3 columns pic-frame"><img class="pics" src="https://res.cloudinary.com/adamscloud/image/upload/v1518476224/gal-6_lksrsb.png"></div>
</div>
</div>
</div>
<div class="events pic-group">
<h1>You're Cool, We're Cool,</h1>
<p>come see us at a event near you.</p>
</div>
{{/partial}}
My problem is I cannot get it to work on responsive. When I test on mobile the images are stretched out and 2 are set side by side. I though Big commerce uses Foundation? I tried adding columns to the section but it still doesn't work. Could someone please show me how to make this code I added responsive? Any sources on how to code in Big Commerce because it is frustrating. I am using the cornerstone theme.
To make your gallery grid responsive and use built-in Foundation classes in Cornerstone, set this variable to true in assets/scss/settings/global/_global.scss:
$include-html-classes: true !default;
This variable exposes Foundation classes from Citadel, which is a pattern library custom to Stencil. This PR goes into a bit more detail: https://github.com/bigcommerce/cornerstone/pull/1047

Boostrap Grid not aligned

I installed a bootstrap theme for Wordpress but I'm experiencing an issue with grid alignment.
See: Click Here in Products&Services.
'Seed' should be on the left and 'Other Products' on the right aligned with the second element 'LeafLine'.
What could that be?
You can also just add a clearfix element after the leafline div to fix this layout.
<div class="clearfix"></div>
More information can be found here: http://getbootstrap.com/css/#grid-responsive-resets
This is an easy fix. You just need to put the content into either two rows, or two columns. Because there is more text on the first left-side block, the Seed block is getting pushed out. You will just need to increase padding below the rows.
Example with rows: http://www.bootply.com/PjWnLEAOMT
<div class="row">
<div class="col-sm-6">
<div class="media services">
<div class="media-body">
<h3 class="media-heading">Primo</h3>
This is Leaf Space main project. A super lightweight two-stage launch vehicle able to bring up to 50 kg to Low Earth Orbit. The use of composite materials and hybrid proprulsive technology make Primo extremely safe, reliable and enviromental friendly, ensuring precise orbit inserction and extremely low risk of failure. All the components are designed with reusability in mind for future implementation of a reusable launch vehicle. </div>
</div>
</div>
<div class="col-sm-6">
<div class="media services">
<div class="media-body">
<h3 class="media-heading">LeafLine</h3>
A ground stations network exclusively dedicated to nano, micro and smallsats is under development. LeafLine can support several orbits and different transmission protocols. A direct encrypted online link ensures simple and safe data collection and control transmissions to satellite operators. </div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="media services">
<div class="media-body">
<h3 class="media-heading">Seed</h3>
Thanks to its great versatility and reliability, hybrid propulsion can be used for several applications. Leaf Space is developing Seed, a next generation hybrid rocket motor designed for in space applications such as:
<ul>
<li>orbital maneuvers</li>
<li>re-orbiting</li>
<li>de-orbiting</li>
</ul>
The first design is dedicated to nano and microsats, other future improved versions will serve also heavier satellites. </div>
</div>
</div>
<div class="col-sm-6">
<div class="media services">
<div class="media-body">
<h3 class="media-heading">Other Services</h3>
Other Services
To complete the offer of Leaf Space, a series of services dedicated to nano and microsatellites will be available, also in collaboration with other companies. Among them:
<ul>
<li>transportations</li>
<li>technical advice</li>
<li>satellite integration in the payload vain</li>
<li>safety and law issues</li>
</ul> </div>
</div>
</div>
</div>
Example with two columns: http://www.bootply.com/bms2sLZ1ZJ
<div class="row">
<div class="col-sm-6">
<div class="media services">
<div class="media-body">
<h3 class="media-heading">Primo</h3>
This is Leaf Space main project. A super lightweight two-stage launch vehicle able to bring up to 50 kg to Low Earth Orbit. The use of composite materials and hybrid proprulsive technology make Primo extremely safe, reliable and enviromental friendly, ensuring precise orbit inserction and extremely low risk of failure. All the components are designed with reusability in mind for future implementation of a reusable launch vehicle. </div>
</div>
<div class="media services">
<div class="media-body">
<h3 class="media-heading">Seed</h3>
Thanks to its great versatility and reliability, hybrid propulsion can be used for several applications. Leaf Space is developing Seed, a next generation hybrid rocket motor designed for in space applications such as:
<ul>
<li>orbital maneuvers</li>
<li>re-orbiting</li>
<li>de-orbiting</li>
</ul>
The first design is dedicated to nano and microsats, other future improved versions will serve also heavier satellites. </div>
</div></div>
<div class="col-sm-6">
<div class="media services">
<div class="media-body">
<h3 class="media-heading">LeafLine</h3>
A ground stations network exclusively dedicated to nano, micro and smallsats is under development. LeafLine can support several orbits and different transmission protocols. A direct encrypted online link ensures simple and safe data collection and control transmissions to satellite operators. </div>
</div><div class="media services">
<div class="media-body">
<h3 class="media-heading">Other Services</h3>
Other Services
To complete the offer of Leaf Space, a series of services dedicated to nano and microsatellites will be available, also in collaboration with other companies. Among them:
<ul>
<li>transportations</li>
<li>technical advice</li>
<li>satellite integration in the payload vain</li>
<li>safety and law issues</li>
</ul> </div>
</div></div>
</div>
Obviously the second produces a cleaner result as far as padding goes.

Hpple in Objective-C can't find a particular object (XML/HTML Parser)

For those veterans who haven't tried Hpple, it's great. It uses Xpath for searching through HTML/XML documents. It gets the job done and it's easy enough for a newbie like me to understand. However, I'm having trouble.
I have this chunk of HTML:
<ul class="challengesList dailyChallengesList">
<li>
<div class="corner topLeft"></div>
<img id="ctl00_mainContent_dailyChallengesRepeater_ctl00_challengeImage" title="Gunslinger" src="/images/reachstats/challenges/0.png" alt="Gunslinger" style="border-width:0px;">
<div class="info">
<div class="rFloat">
<p id="ctl00_mainContent_dailyChallengesRepeater_ctl00_challengeExpiration" class="timeDisplay dailyExpirationCountdown"><span>0d</span><span>19h</span><span>9m</span><span class="seconds">37s</span></p>
<p>1500cR</p>
</div>
<h5>Gunslinger</h5>
<p class="description">Kill 150 enemies in multiplayer Matchmaking.</p>
<div class="reward">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl00_progressBox" class="barContainer">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl00_progressBar" class="bar" style="width:21%;"><span></span></div>
<p>31/150</p>
</div>
</div>
</div>
<div class="clear"></div>
</li>
<li>
<div class="corner topLeft"></div>
<img id="ctl00_mainContent_dailyChallengesRepeater_ctl01_challengeImage" title="A Great Friend" src="/images/reachstats/challenges/0.png" alt="A Great Friend" style="border-width:0px;">
<div class="info">
<div class="rFloat">
<p id="ctl00_mainContent_dailyChallengesRepeater_ctl01_challengeExpiration" class="timeDisplay dailyExpirationCountdown"><span>0d</span><span>19h</span><span>9m</span><span class="seconds">37s</span></p>
<p>1400cR</p>
</div>
<h5>A Great Friend</h5>
<p class="description">Earn 15 assists today in multiplayer Matchmaking.</p>
<div class="reward">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl01_progressBox" class="barContainer">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl01_progressBar" class="bar" style="width:40%;"><span></span></div>
<p>6/15</p>
</div>
</div>
</div>
<div class="clear"></div>
</li>
<li>
<div class="corner topLeft"></div>
<img id="ctl00_mainContent_dailyChallengesRepeater_ctl02_challengeImage" title="Cannon Fodder" src="/images/reachstats/challenges/2.png" alt="Cannon Fodder" style="border-width:0px;">
<div class="info">
<div class="rFloat">
<p id="ctl00_mainContent_dailyChallengesRepeater_ctl02_challengeExpiration" class="timeDisplay dailyExpirationCountdown"><span>0d</span><span>19h</span><span>9m</span><span class="seconds">37s</span></p>
<p>1000cR</p>
</div>
<h5>Cannon Fodder</h5>
<p class="description">Kill 50 infantry-class foes in the Campaign today.</p>
<div class="reward">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl02_progressBox" class="barContainer">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl02_progressBar" class="bar" style="width:0%;"><span></span></div>
<p>0/50</p>
</div>
</div>
</div>
<div class="clear"></div>
</li>
<li>
<div class="corner topLeft"></div>
<img id="ctl00_mainContent_dailyChallengesRepeater_ctl03_challengeImage" title="Heroic Demon" src="/images/reachstats/challenges/3.png" alt="Heroic Demon" style="border-width:0px;">
<div class="info">
<div class="rFloat">
<p id="ctl00_mainContent_dailyChallengesRepeater_ctl03_challengeExpiration" class="timeDisplay dailyExpirationCountdown"><span>0d</span><span>19h</span><span>9m</span><span class="seconds">37s</span></p>
<p>1500cR</p>
</div>
<h5>Heroic Demon</h5>
<p class="description">Kill 30 Elites in Firefight Matchmaking on Heroic or harder.</p>
<div class="reward">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl03_progressBox" class="barContainer">
<div id="ctl00_mainContent_dailyChallengesRepeater_ctl03_progressBar" class="bar" style="width:0%;"><span></span></div>
<p>0/30</p>
</div>
</div>
</div>
<div class="clear"></div>
</li>
</ul>
The nutty part is, I cannot get Hpple to "see" the <div class="reward">. I'm using the following to find it:
NSArray * rawProgress = [doc search:#"//ul[#class='challengesList']
/li/div[#class='info']
/div[#class='reward']/p"];
This always returns an empty array. It's driving me nuts, as the same kind of thing worked for all of the other elements in this project...
Any help would be appreciated :)
EDIT
This works:
NSArray * rawDescriptions = [doc search:#"//ul[#class='challengesList']
/li/div[#class='info']
/p[#class='description']"];
This doesn't:
NSArray * rawProgress = [doc search:#"//ul[#class='challengesList']
/li/div[#class='info']
/div[#class='reward']
/div[#id]//p"];
Furthermore, trying to list the child nodes of rFloat or reward produces a crash :(
Your "p" element is not an immediate child of div class="reward".
Using XML you provided, XPath expression
div[#class='info']/div[#class='reward']//p
will work.
See this SO question for a similar report on problems with Hpple and a list of alternatives.
You may be seeing a bug. According to this page,
It's classified as an experimental
project by the developer, but so far
it's "worked for me"
UPDATE: seems to be kinda broken now.
Anyone got a better solution?
You may want to enter a bug report, and if the project is still being maintained, maybe the developer will respond with a fix or solution. Or you could leave a comment on this page that recommended hpple, and see if that blogger or one of his readers can address the problem or tell you if hpple is active at all.
You could also see if you can find HyperParser. "It's a simple HTML parser that has API similar to NSXMLParser. Designed specially to parse semi-valid HTML." But it doesn't seem to be there at the link where it used to be.