![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
CSS Gurus inside please
For those that know CSS pretty well should have no issue at all with this, but it's something I've never taken the time to learn how to do properly.
I want to create 4 boxes per row, in CSS, based on a specified sized wrapper. So let's say we have a wrapper of 500px, how can I add in the CSS so that no matter how many boxes it creates, it only positions 4 per row (at around 120px each with 5 pixel padding). What's the easiest way to accomplish this? I've seen it done with listed items, but I can't remember how it's been done. The reason I want to do this in the first place is I've always done it with tables, but I want to get away from tables as much as I can and it's less backend coding if I'm doing it the CSS route. Thanks in advance! ![]() ![]()
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Location: Currently Incognito
Posts: 13,827
|
Code:
<div style="width:500px;"> <div sytle="width:120px:float:left;padding:0 2px;">content</div> <div sytle="width:120px:float:left;padding:0 2px;">content</div> <div sytle="width:120px:float:left;padding:0 2px;">content</div> <div sytle="width:120px:float:left;padding:0 2px;">content</div> <div sytle="width:120px:float:left;padding:0 2px;">content</div> <div sytle="width:120px:float:left;padding:0 2px;">content</div> <div sytle="width:120px:float:left;padding:0 2px;">content</div> <div sytle="width:120px:float:left;padding:0 2px;">content</div> <br style="clear:both" /> </div>
__________________
![]() ![]() ![]() It's all disambiguation ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
I make pixels work
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
|
float FTW
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
Quote:
![]() I'm shooting more for this: [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: Oct 2007
Location: South Florida - "Fuck Bitches and Fight Crime - It's all we do!
Posts: 629
|
Quote:
![]()
__________________
*** Andrew Love *** Services: (1) Web Design, (2) Graphic Design, (3) E-commerce, (4) Database Development, (5) Web Analytics, (6) Targeted Lead Generation, (7) Marketing and Consulting Mainstream: Successful Website Landing Page Design | ICQ: 360-83-9627 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Apr 2004
Location: Metro DC Area
Posts: 298
|
Quote:
Put the br line after every 4th content line. Jimmy |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
Tried that,
Before: [] [] [] [] [] [] [] [] After: [] [] [] [] [] [] [] [] ![]()
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Show us the page? I use the same thing and it works ok for me.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Example:
http://www.expire.biz/test.html Code:
<div style="width:500px"> <div style="float:left;width:100px;">content</div> <div style="float:left;width:100px;">content</div> <div style="float:left;width:100px;">content</div> <div style="clear:both"></div> <div style="float:left;width:100px;">content</div> <div style="float:left;width:100px;">content</div> <div style="float:left;width:100px;">content</div> <div style="clear:both"></div> <div style="float:left;width:100px;">content</div> <div style="float:left;width:100px;">content</div> <div style="float:left;width:100px;">content</div> <div style="clear:both"></div> </div>
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
![]() First one:
http://www.virbed.com/gfy/cssboxes.html Second one: (with br every 4 divs) http://www.virbed.com/gfy/cssboxes2.html
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
I'm using Firefox 3 on OS X, just for some background on what I'm testing with. I also tested with Safari
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Beer Money Baron
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
|
Your code has a typo
div sytle
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
haha, didn't catch that, just copied and pasted The Doc's code to test it and didn't change anything else.
Thanks Man!!!
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: Jan 2007
Posts: 2,695
|
Hi
.... are the boxes going to hold images? You might want to have a look at doing it using a list.... Lats say you make the list holder 500px wide and the boxes using li's 100px wide but wide margin you will be able to fit 4 boxes in each row as the 5th box will fall under. So make teh ul = 500px, li=100px, float the li's to the left, get rid of list styling and you margins and voila. <style type="text/css"> ul { width:500px; min-height:400px; list-style:none; padding:0; margin: up to you*** } li { float:left; width:100px; height: up to you border:1px solid #FFFFFF your choice here this will outline the boxes; margin: ur choice to not have all the boxes clumped together; } </style> <ul> <li></li> <li></li> <li></li> <li></li> <li></li> <!-- this one will fall under forming the next row --> <li></li> </ul> Obviously you gonna have to screw around with the above to get your own look and feel. Ciao
__________________
best cbd oil uk - Hit me up on ICQ 400607632 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Location: Currently Incognito
Posts: 13,827
|
You have to have that funky spelling of hmtl to get my example to work
![]()
__________________
![]() ![]() ![]() It's all disambiguation ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
Code:
<div style="display: table;"> <div style="display: table-row;"> <div style="display: table-cell;"></div> <div style="display: table-cell;"></div> <div style="display: table-cell;"></div> <div style="display: table-cell;"></div> </div> <div style="display: table-row;"> <div style="display: table-cell;"></div> <div style="display: table-cell;"></div> <div style="display: table-cell;"></div> <div style="display: table-cell;"></div> </div> </div> Code:
<div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="clear: both;"></div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="float: left;"></div> </div> Code:
<div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="float: left;"></div> </div> <div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="float: left;"></div> <div style="float: left;"></div> </div> ![]()
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Industry Role:
Join Date: Apr 2002
Posts: 1,383
|
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> ul#container_4 { list-style-type: none; width: 415px; margin: auto; } ul#container_4 li { float: left; display: block; background: #000; width: 100px; height: 100px; margin-right: 5px; margin-bottom: 5px; } ul#container_4 li.omega { margin-right: 0px; } </style> </head> <body> <ul id="container_4"> <li></li> <li></li> <li></li> <li class="omega"></li> <li></li> <li></li> <li></li> <li class="omega"></li> <li></li> <li></li> <li></li> <li class="omega"></li> <li></li> <li></li> <li></li> <li class="omega"></li> </ul> </body> </html> |
![]() |
![]() ![]() ![]() ![]() ![]() |