Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Web Design Forum > HTML / CSS
User Name
Password

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-11-2007, 11:37 AM   #1 (permalink)
savageplay
Junior Member
 
Join Date: Dec 2006
Posts: 5
Default simple css quest

hey how's everyone here make a 'div' area that has only floats retain it's bg/style? example:

<style>

.container {
background: #ddd;}

.container div{
float: left;}


</style>

<div class="container">

<div class="xx">
text
</div>

<div class="yy">right text</div>

</div>

The background of 'containier' is not that grey color like you'd just assume. Normally i would put a new div after all my content <div class="clear"></div> with a statement in my stylesheet that clear's the clear. Also if you make the container 'float: left' it will now display the bg color to the class Container...but that just get's messy as now everyhing is either floating or clearing a float.

I am just looking for a more proper way of doing this as i am tired of adding the <div class="clear">.....because it's becoming my crutch like using old spacer gif's.

ps i know that i could make them span's but if you wanted to 'float the spans' the same thing happens.

Thanks.
savageplay is offline   Reply With Quote
Sponsored Links
Old 07-15-2007, 07:23 PM   #2 (permalink)
Krishnaswamy
Junior Member
 
Join Date: May 2007
Posts: 29
Default Re: simple css quest

What exactly do you need? Could you pose the question a little differently?
There is an error in your .container class.

Quote:
Originally Posted by savageplay
hey how's everyone here make a 'div' area that has only floats retain it's bg/style? example:

<style>

.container {
background: #ddd;}

.container div{
float: left;}


</style>

<div class="container">

<div class="xx">
text
</div>

<div class="yy">right text</div>

</div>

The background of 'containier' is not that grey color like you'd just assume. Normally i would put a new div after all my content <div class="clear"></div> with a statement in my stylesheet that clear's the clear. Also if you make the container 'float: left' it will now display the bg color to the class Container...but that just get's messy as now everyhing is either floating or clearing a float.

I am just looking for a more proper way of doing this as i am tired of adding the <div class="clear">.....because it's becoming my crutch like using old spacer gif's.

ps i know that i could make them span's but if you wanted to 'float the spans' the same thing happens.

Thanks.
Krishnaswamy is offline   Reply With Quote
Old 07-16-2007, 07:59 AM   #3 (permalink)
stolicka
Junior Member
 
Join Date: Jul 2007
Posts: 1
Default Re: simple css quest

use Joomla, it is perfect!!!
stolicka is offline   Reply With Quote
Old 08-10-2007, 04:19 PM   #4 (permalink)
savageplay
Junior Member
 
Join Date: Dec 2006
Posts: 5
Default Re: simple css quest

ok, i'll reword it, and thanks

ok lets say you have two elements in a div you want to float, but you want them both to be contained in lets say a background color. if you float all elements within a div, the background will 'disappear'.

in the example below, see how currenlty the two div's float nice, and the 'container' background has the grey background, but how if you take out the div with the 'clear', that the container background doesn't show.

This is a very basic sample of what technically is the problem. Thanks for any help

<style>

.container {
background: #ddd;}

.container div.xx, .container div.yy {
float: left;}

.clear {
clear: both;

}


</style>

<div class="container">

<div class="xx">left text | </div>
<div class="yy">right text</div>

<div class="clear">clear</div>

</div>
savageplay is offline   Reply With Quote
Reply


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

Points Per Thread View: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 08:33 AM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums