Coder Social home page Coder Social logo

Something not quite right about zen-grids HOT 4 CLOSED

johnalbin avatar johnalbin commented on May 14, 2024
Something not quite right

from zen-grids.

Comments (4)

gavin-webstuff avatar gavin-webstuff commented on May 14, 2024

Hey Alan,

Its Gavin i was looking at this layout your snippet indicates a 9 list item and your sketch indicates a 6 item list
I played around with this layout (Went with a 6 block list item). I think the problem your getting is that your not clearing item #2 but when you do clear #2 that you will have a problem with 3,4,5,6 with a white-space line break and i don't have a good solution for that yet...

I did come up with a solution but its not flexible as it relies on absolute positioning to bring item #3 , #4, #5 to top but then if there is meant to be un-equal heights or extra content in #1,2,3,4,5 it will push #6 down.
here is a working example
http://jsfiddle.net/webstuff/Xq3aa/1/

SCSS http://pastebin.com/syFhCQaZ

I think this is a good argument when more html is needed to achieve the desired effect....

from zen-grids.

alanburke avatar alanburke commented on May 14, 2024

Thanks Gavin - I'll give that a spin

from zen-grids.

JohnAlbin avatar JohnAlbin commented on May 14, 2024

The grid items that are in a single row need to be adjacent siblings in the HTML source.

Right now your first row is: 1, 3, 4, 5 and your second row is 2, 6. As you can see those aren't adjacent siblings (2 is not next to 6 in the source order since 3, 4, and 5 are between them.)

The reason for this is pretty straight-forward. In order to create a new row, you have to take the first element in that row (as determined by HTML source order) and clear the items in the previous row. When you do that, you prevent all following grid items from being able to sit in previous rows (unless you resort to absolute positioning.)

Note, however, that you could still achieve the source order that you want, but you would have to add an additional wrapping element around 1 and 2. Then you would position the wrapping element of 1 and 2 in the first row along with 3, 4 an 5. And on the second row, you'd just have 6.

from zen-grids.

alanburke avatar alanburke commented on May 14, 2024

Thanks John!
Yea it's a sticky one - I got around it in the end, but only by cheating and assuming certain things wouldn't change.
The markup is also your work - Drupal's menu block module!
Thanks, and looking forward to catching up soon sometime.

from zen-grids.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.