The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> CSS Help
|
New Member - Divs utilising space
Discuss Divs utilising space in the CSS Help forum on Dev Shed. Divs utilising space Cascading Style Sheets (CSS) forum discussing all levels of CSS, including CSS1, CSS2 and CSS Positioning. CSS provides a robust way of applying standardized design concepts to your web pages.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

September 24th, 2012, 02:02 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
|
New Member - Divs utilising space
Hi all I wonder if you can help.
I am trying to create an effect similar to Pinterest.com.
If you visit designercurtains.biz/screen.png you will note that the divs do not like doing this style.
Scarf should be under dog bandana, and jeans should be under cushion. Is there a simple way of making the divs use the available space?
Each box is a div classed as 'frame'.
Code:
.frame {
float: left;
width: 150px;
margin: 10px;
background: #fff;
padding: 10px;
border: 1px #888 solid;
}
.frame:hover {
-moz-box-shadow: 2px 4px 4px 3px #ccc;
-webkit-box-shadow: 2px 4px 4px 3px #ccc;
box-shadow: 2px 4px 4px 3px #ccc;
}
Thanks in advance.
|

September 24th, 2012, 02:04 PM
|
 |
For POny!
|
|
Join Date: Apr 2012
Location: Amsterdam
|
|
|
give the .frames a height.
and make sure the content is being limited by the serverside script
Last edited by aeternus : September 24th, 2012 at 02:07 PM.
|

September 24th, 2012, 02:27 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
Quote: | Originally Posted by aeternus give the .frames a height.
and make sure the content is being limited by the serverside script |
Thanks for your help aeternus.
I've given the divs heights but 'Jeans' doesn't use up the space between itself and Cushion.
See designercurtains.biz/screen2.png
Also when I increase the height of Pillow, it pushes scarf and jeans to the right and down another line...
And I'm not sure how I make sure the content is being limited by serverside script...
sorry!
|

September 24th, 2012, 02:44 PM
|
 |
For POny!
|
|
Join Date: Apr 2012
Location: Amsterdam
|
|
|
Hi rdbrotherton,
I understand that you are testing this locally, but without seeing any mark-up and how your declared styles are applied to it, no one can really help.
If you want me to check it out, post a link to a online page where you say you applied the style and it is not working for some reason.
See ya
- as for limiting stuff server side. depending on the cms you are using this should be done in the backed. If not, just tell these client that they should limited the amount of characters used. Or more use:
.frame{ overflow:hidden} this will cutt off extra stuff. But that might not be so pretty.
Last edited by aeternus : September 24th, 2012 at 02:49 PM.
|

September 25th, 2012, 12:13 AM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
|
aeternus,
Thanks for your help so far its most appreciated.
I've uploaded the index and css file to rdb.x10.mx/de
As you can see, jeans wdoes not move up below cushion, it sits on its line. If I increase the size of pillow (frame3) it pushes both scarf and jeans down even further.
Do you think I going to have to use position absolute attributes to achieve the look I want?
Thanks again.
|

September 25th, 2012, 10:06 AM
|
 |
For POny!
|
|
Join Date: Apr 2012
Location: Amsterdam
|
|
Quote: | Originally Posted by rdbrotherton aeternus,
Thanks for your help so far its most appreciated.
I've uploaded the index and css file to rdb.x10.mx/de
As you can see, jeans wdoes not move up below cushion, it sits on its line. If I increase the size of pillow (frame3) it pushes both scarf and jeans down even further.
Do you think I going to have to use position absolute attributes to achieve the look I want?
Thanks again. |
Position absolute is by far the last thing you should look at. Position absolute takes elements out of the normal flow of the document. To get the desired result with that you will have to do a lot of extra coding.
Let keep it efficient.
I see that you assigned a height to .frame1 .frame2 .frame3 .frame4 They all have a hieght of 250px; except for .frame2
So if you remove the height from all these frames and just combine them in 1 rule it is much more efficient (the same is true for all your other properties, combine everything if they use the same stuff, it saves you time money, bandwidth and troubles
Code:
.frame1, .frame2, .frame3, .frame4 {
background: #fff;
border: 1px solid #888;
float: left;
height: 250px;
margin: 10px;
padding: 10px;
width: 150px;
}
Hope this helps! good luck!
-edit: ones you gave all these frames the same properties you can if needed overwrite this by a simple statement like
Code:
.frame2{background:red}
Last edited by aeternus : September 25th, 2012 at 10:09 AM.
|

September 25th, 2012, 02:27 PM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
|
Thanks mate, I'm quite new to CSS, and while I know some of the basics, stuff like house keeping I haven't done much on.
So to be clear, it would take quite a bit of coding to get my frame divs to position the way I want them?
Thanks again.
|

September 25th, 2012, 03:26 PM
|
 |
For POny!
|
|
Join Date: Apr 2012
Location: Amsterdam
|
|
|
I cant really respond good because i destroyed my motherboard. Anyway added th div should take you 1 min
|

September 25th, 2012, 03:37 PM
|
 |
CSS & JS/DOM Adept
|
|
Join Date: Jul 2004
Location: USA
|
|
CSS alone is not sufficient to do what you seem to want with dynamic content. The jQuery Masonry plugin can be used for that, however.
Quote: | Originally Posted by aeternus I cant really respond good because i destroyed my motherboard. |
Ouch. How'd that happen? What brand was your MB?
|

September 25th, 2012, 03:39 PM
|
 |
For POny!
|
|
Join Date: Apr 2012
Location: Amsterdam
|
|
Quote: | Originally Posted by Kravvitz CSS alone is not sufficient to do what you seem to want with dynamic content. The jQuery Masonry plugin can be used for that, however.
Ouch. How'd that happen? What brand was your MB? | a facking expensive dell xps :-P damn frauds ;-) prolly a cheap *** mb ;-) i might have played to much games ii guess B-)
Last edited by aeternus : September 25th, 2012 at 05:26 PM.
|

September 26th, 2012, 07:23 AM
|
|
Registered User
|
|
Join Date: Sep 2012
Posts: 22
Time spent in forums: 3 h 20 m
Reputation Power: 0
|
|
Quote: | Originally Posted by Kravvitz CSS alone is not sufficient to do what you seem to want with dynamic content. The jQuery Masonry plugin can be used for that, however. |
That is exactly what I'm after. Thank you both for all your help. I'll definitely come here again if have another problem!
Cheers.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|