Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialShimaa Gamal
188 Pointssource ordering for small grid
in the following code i see source ordering applied in large and medium view but not in small: < div class="medium-8 push-4">title< /div> < div class="medium-4 pull-8">img< /div>
in small each columns will be 100% but i want them to be switched as the img shows before the title. how to do that in foundation 5?
19 Answers
Patrick Gerrits
14,614 PointsBecause you only mention the medium. So it will be medium up. If you also want small, then you should use the small-8 and small-4.
Shimaa Gamal
188 Pointsyes if i use small-8 small-8 it will work but i wanted to be small-12 small-12
Patrick Gerrits
14,614 PointsI think you should also add the columns class. Then you put in:
<div class="small-12 medium-8 push-4 columns">title< /div> < div class="small-12 medium-4 pull-8 columns">img< /div>
Shimaa Gamal
188 Pointsiam using columns class in my code, the title still shows up first in the small grid when i used ur code
Patrick Gerrits
14,614 PointsAhhh i'm sorry. Now i see the problem.
u need to select the format you want to push. zo small-push-2 or medium-push-8
Shimaa Gamal
188 Pointstheres no small-push-12 in the foundation.css file
<div class="medium-8 small-12 small-push-12 push-8">title</div>
<div class="medium-4 small-12 small-pull-12 pull-8">img</div>
in the small devices, i want the img and title to take up 100% of the screen, the img comes first in the browser but in the html file the title is written first for SEO
Patrick Gerrits
14,614 PointsOf Course there is no small-push-12. Because that does not make any sense. The width is 12 columns max. So where should is push to? small-push-11 is the highest you can do.
Do this:
<div class="row">
<div class="medium-4 small-12 medium-push-8 columns">img</div>
<div class="medium-8 small-12 medium-pull-4 columns">title</div>
</div>
Shimaa Gamal
188 Pointsso theres no way i show the img above the title in small grid?
Patrick Gerrits
14,614 PointsAgain... use my code:
<div class="row">
<div class="medium-4 small-12 medium-push-8 columns">img</div>
<div class="medium-8 small-12 medium-pull-4 columns">title</div>
</div>
Shimaa Gamal
188 Pointsi used ur code and the result for small was https://dl.dropboxusercontent.com/u/26481347/Capture.PNG and for large and medium was https://dl.dropboxusercontent.com/u/26481347/Capture%202.PNG
Patrick Gerrits
14,614 PointsUse my latest code. I made a type error and corrected it really quickly. U are using the old one. (you are really quick if you catched that)
Shimaa Gamal
188 Pointsi notice u wrote the img first in the html but i want the title first
Patrick Gerrits
14,614 Pointsjust use it. please.
Shimaa Gamal
188 Pointsnow the large and medium r wrong lool
Patrick Gerrits
14,614 PointsSorry but when i run it like that. It shows the word title on the left. on the same row it show image.
when i shrink the viewport to small then the image is on top....
Shimaa Gamal
188 Pointsyes what u saying is right, but what i want to achieve is large/medium: img left, title right..on small:img first title under it.. in the html the title col written first zn img col. i want to ask the question on dif way.. is it possible to source order a col that takes 100% to show up second on the screen?
Shimaa Gamal
188 Pointsplz check this http://cdpn.io/njkgs
Dennis Skoko
12,860 PointsHave you tried swapping place with img and title. That way when the browser will read the img code first and then reads the title code, that way the title goes under it. Then apply the codes from foundation to get the image of the left and title on the right at medium and higher. I used you codepen. and replaced you HTML code to this:
<div class="row">
<div class="medium-4 small-12 columns">img</div>
<div class="medium-8 small-12 columns">title</div>
</div>
Shimaa Gamal
188 Pointsthat make sense but what if i want the title first for SEO purposes, plus theres other situation in my code where i wanna switch 2 columns in the small grid only and they also small-12 coz if its small-11 and smaller zn no problem with push and pull, the problem here is when its small-12.. is there any solution for this in foundation 5?