- This topic is empty.
-
AuthorPosts
-
December 6, 2011 at 2:26 pm #35501Mark Root-WileyParticipant
I’ve got a nasty layout that I’m really stuck on and looking for any brilliant ideas to get me going.
The layout I’m going for is this: Layout Diagram.
I can get this layout working by changing the source order, but I’m looking for a pure-CSS way to do this.
For me, the ideal source order would be:
...Lots of text...
I’m open to using a wrapper on the sidebar if needed (around multiple asides). I will also need to put a wrapper around the , but have left it out of the example. I’m going for the simplest markup possible and then expanding it once I have the basics down.
I’ve tried variants on absolute faux positioning but can’t get that working. I also looked at masonry.js but I don’t think that’s the right solution either. I wonder whether using a technique inspired by the float:center technique on this blog might work.
Any and all suggestions welcome.
Thanks.
December 6, 2011 at 2:47 pm #91978TheDocMemberThe only thing I’ve got you need to know the image’s height for. http://jsfiddle.net/2Csgq/ You’d probably be able to get the height of the image using some jQuery.
Something like the float center thing could work I think, would just need to tinker.
December 6, 2011 at 4:04 pm #92023Mark Root-WileyParticipantThat seems as good as anything I can expect. I’m using WordPress, so I should be able to get the height of the image server-side, which is a nice consolation prize.
Thanks!
December 6, 2011 at 4:05 pm #92024Mark Root-WileyParticipant(I should add that if other people have other ideas/solutions, I’d still love to see them. I like the layout but it seems like one that’s not all that CSS-friendly.)
December 6, 2011 at 8:01 pm #92046Mark Root-WileyParticipantThe specifics barely matter, but here they are.
container: 940
article: 620
asides: 300
image: 540
(gutter: 20)December 6, 2011 at 9:18 pm #92052Mark Root-WileyParticipantThat is the right layout. I see that on #aside-wrap, though, you use absolute positioning. Unfortunately, I need to let the sidebar have a variable height that the rest of the page pays attention it. (That also means the float:right on #aside-wrap isn’t doing anything.)
TheDoc’s answer worked nicely and I’m pretty much using that solution.
Thanks!
December 6, 2011 at 9:55 pm #92057joshuanhibbertMemberKeeping your source order, here is how I would do it: http://jsfiddle.net/sl1dr/25kQs/
I would personally have the image as a child of the article though.
December 7, 2011 at 12:18 pm #92127Mark Root-WileyParticipantI like the way you illustrated that, Joshua.
I think my big oversight was not considering putting the image inside the article. Doing that seem to work beautifully!
Thanks to everyone who contributed.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.