TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-09-2008, 10:26 AM   #1 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default Preventing line breaks with div without display inline

YouTube - toolisgod6's Videos

I want something like this. See how the videos are in line, and then break when it hits the end of the container.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 08-09-2008, 11:24 AM   #2 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

View >> Page Source

In Firefox.
delayedinsanity is offline  
Reply With Quote
Old 08-09-2008, 11:25 AM   #3 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by delayedinsanity View Post
View >> Page Source

In Firefox.
Meh, youtube has crammed packed full of shit.

Can't you just tell me the css code? :P
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 08-09-2008, 11:53 AM   #4 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 24
Thanks: 13
sidisinsane is on a distinguished road
Default

YouTube uses tables. But why can't you use a tableless layout with float:left and display:inline instead?
sidisinsane is offline  
Reply With Quote
Old 08-09-2008, 12:39 PM   #5 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by sidisinsane View Post
YouTube uses tables. But why can't you use a tableless layout with float:left and display:inline instead?
I used tables at first time, but I'll try that.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 08-09-2008, 06:26 PM   #6 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 386
Thanks: 47
Aaron is on a distinguished road
Default

What is so bad about display:inline?
__________________
Signatures are nothing but incriminating.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 08-09-2008, 06:44 PM   #7 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Its pretty simple, take this as an example:

CSS:
HTML Code:
<style type="text/css">
<!--
.box { border: 1px solid #000000; float: left; margin: 5px; padding: 5px; width: 100px; }
.clear { clear: left; }
.container { width: 400px; }
// -->
</style>
And the HTML markup:
HTML Code:
<div class="container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
<div class="box">Box 4</div>
<div class="box">Box 5</div>
<div class="box">Box 6</div>
<div class="box">Box 7</div>
<div class="box">Box 8</div>
<div class="box">Box 9</div>
<div class="clear"></div>
</div>
=)
__________________
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 08-09-2008, 09:06 PM   #8 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Kalle View Post
Its pretty simple, take this as an example:

CSS:
HTML Code:
<style type="text/css">
<!--
.box { border: 1px solid #000000; float: left; margin: 5px; padding: 5px; width: 100px; }
.clear { clear: left; }
.container { width: 400px; }
// -->
</style>
And the HTML markup:
HTML Code:
<div class="container">
<div class="box">Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
<div class="box">Box 4</div>
<div class="box">Box 5</div>
<div class="box">Box 6</div>
<div class="box">Box 7</div>
<div class="box">Box 8</div>
<div class="box">Box 9</div>
<div class="clear"></div>
</div>
=)
I've used float: left; before on it, but the clear made it work.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 10-21-2008, 07:41 AM   #9 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Sorry to update on an old thread but, this method the containers in different heights which fuck it up.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 10-21-2008, 08:14 AM   #10 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 24
Thanks: 13
sidisinsane is on a distinguished road
Default

You could use one of the many CSS "equal heights" methods (some info at positioniseverything.net). But if you're not to familar with the potential buggyness of it all, I'd advise you to go with a javascript alternative, i.e. "Setting equal heights with jQuery".
sidisinsane is offline  
Reply With Quote
Old 10-21-2008, 09:02 AM   #11 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by sidisinsane View Post
You could use one of the many CSS "equal heights" methods (some info at positioniseverything.net). But if you're not to familar with the potential buggyness of it all, I'd advise you to go with a javascript alternative, i.e. "Setting equal heights with jQuery".
The javascript one didn't help, cause when you set the width to of oone of the boxes, it changes its height thats different than the others, and is not fixed. so
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 10-21-2008, 09:54 AM   #12 (permalink)
The Wanderer
 
Join Date: Jan 2008
Posts: 24
Thanks: 13
sidisinsane is on a distinguished road
Default

Quote:
Originally Posted by Orc View Post
The javascript one didn't help, cause when you set the width to of oone of the boxes, it changes its height thats different than the others, and is not fixed. so
Well, it's supposed to fetch the maximum height of all boxes with the set class and adjust them equally ... Maybe I don't quite understand your problem. How 'bout posting some of your code?
sidisinsane is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:14 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design