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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-03-2009, 03:57 PM   #1
jwerd
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

Last edited by jwerd; 01-03-2009 at 03:58 PM..
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:01 PM   #2
TheDoc
Too lazy to set a custom title
 
TheDoc's Avatar
 
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>
__________________
~TheDoc - ICQ7765825
It's all disambiguation
TheDoc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:02 PM   #3
Deej
I make pixels work
 
Deej's Avatar
 
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
float FTW
__________________

Deej's Designs n' What Not
Hit me up for Design, CSS & Photo Retouching


Icq#30096880
Deej is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:05 PM   #4
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
Quote:
Originally Posted by TheDoc View Post
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>
Hey thanks for some help, but it's not quite what I'm looking for actually.

I'm shooting more for this:
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:06 PM   #5
skrinkladoo
Confirmed User
 
skrinkladoo's Avatar
 
Join Date: Oct 2007
Location: South Florida - "Fuck Bitches and Fight Crime - It's all we do!
Posts: 629
Quote:
Originally Posted by TheDoc View Post
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>
__________________
*** 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
skrinkladoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:15 PM   #6
nicedreams
Confirmed User
 
Industry Role:
Join Date: Apr 2004
Location: Metro DC Area
Posts: 298
Quote:
Originally Posted by lamerhooD View Post
Hey thanks for some help, but it's not quite what I'm looking for actually.

I'm shooting more for this:
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]

Put the br line after every 4th content line.

Jimmy
__________________

Nice Dreams Cash
http://www.nicedreamscash.com
nicedreams is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:19 PM   #7
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
Quote:
Originally Posted by nicedreams View Post
Put the br line after every 4th content line.

Jimmy
Tried that,

Before:
[]
[]
[]
[]
[]
[]
[]
[]

After:
[]
[]
[]
[]

[]
[]
[]
[]

__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:22 PM   #8
Brujah
Beer Money Baron
 
Brujah's Avatar
 
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.
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:25 PM   #9
Brujah
Beer Money Baron
 
Brujah's Avatar
 
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>
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:28 PM   #10
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
:tongue

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
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:29 PM   #11
jwerd
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
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:29 PM   #12
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
Your code has a typo

div sytle
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:33 PM   #13
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
Quote:
Originally Posted by Brujah View Post
Your code has a typo

div sytle
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
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:45 PM   #14
Badmaash
Confirmed User
 
Badmaash's Avatar
 
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
Badmaash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 04:54 PM   #15
TheDoc
Too lazy to set a custom title
 
TheDoc's Avatar
 
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
__________________
~TheDoc - ICQ7765825
It's all disambiguation
TheDoc is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 05:13 PM   #16
potter
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>
You could also do it using ul/li. As someone stated above me. I dunno, there's easily another twenty different ways to do this. Choose one.
__________________

potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-03-2009, 05:19 PM   #17
Zayne E.
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>
Zayne E. is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.