CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 8th, 2008, 06:34 PM
gsquare567 gsquare567 is offline
Contributing User
Click here for more information.
 
Join Date: Dec 2007
Posts: 297 gsquare567 User rank is Sergeant (500 - 2000 Reputation Level)gsquare567 User rank is Sergeant (500 - 2000 Reputation Level)gsquare567 User rank is Sergeant (500 - 2000 Reputation Level)gsquare567 User rank is Sergeant (500 - 2000 Reputation Level)gsquare567 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 7 h 33 m 37 sec
Reputation Power: 8
Question Two floaters with margins... how do i set their widths???

for those of you who have helped me before and told me to change from tables to divs, well, i'm on the last part before i convert the big table.

my problem is that on my home page i have category boxes that i want to each occupy half of the main column. HOWEVER, they also need margins to separate from each other.

here is their css code:
Code:
.leftcatpanel {
	margin-left:8px;
	margin-top:0px;
	margin-bottom:8px;
	margin-right:4px;
	float:left;
	width:50%;
}

.rightcatpanel {
	margin-left:4px;
	margin-top:0px;
	margin-bottom:8px;
	margin-right:8px;
	float:left;
	width:50%;
}


however, the 50% width makes them overflow to the next line, even though they are floated. how can i set them to stay on the same line, make their widths perfectly halved, and keep their margins???

(click here for the way it looks now and scroll down to the middle of the page)
__________________

Reply With Quote
  #2  
Old May 8th, 2008, 06:49 PM
Arem Arem is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 22 Arem User rank is Corporal (100 - 500 Reputation Level)Arem User rank is Corporal (100 - 500 Reputation Level)Arem User rank is Corporal (100 - 500 Reputation Level)Arem User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 15 sec
Reputation Power: 0
Here's a quick suggestion from a newbie:

You have set widths at 50%, but beware that this does not (I believe) account for the 1px border you are using, and perhaps also the margins as well. Your widths are actually 50% + 2px of border and 12px of total left/right margin. It might be better to assign a pixel width to each box and remove 14px on each width to account for the border and margins. The box model adds border, padding and margin widths to the div width.

An alternative is to have each div at 50% and assign each div an inner div which has border and margin but no width. This allows a lot more flexibility. The content will adjust itself to fit.

I am fresh out of the self-teaching textbooks, so this is not expert advice, but hope it helps anyway!
Comments on this post
gsquare567 agrees: genius
Kravvitz agrees!

Reply With Quote
  #3  
Old May 8th, 2008, 06:56 PM
gsquare567 gsquare567 is offline
Contributing User
Click here for more information.
 
Join Date: Dec 2007
Posts: 297 gsquare567 User rank is Sergeant (500 - 2000 Reputation Level)gsquare567 User rank is Sergeant (500 - 2000 Reputation Level)gsquare567 User rank is Sergeant (500 - 2000 Reputation Level)gsquare567 User rank is Sergeant (500 - 2000 Reputation Level)gsquare567 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 7 h 33 m 37 sec
Reputation Power: 8
thanks so much man. quickest and simplest answer i've ever gotten.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Two floaters with margins... how do i set their widths???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway