Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » Webmasters and Developers » CSS Padding with Firefox
Search Topic:
Uniqs:
1265
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Looking for This Kind of PHP Application »
« Apache2-Solaris10sparc-access to directories.. help!  
AuthorAll Replies


sfboarders
Swimming With Sharks
Premium
join:2000-12-13
AtTheBeach
clubs:

 CSS Padding with Firefox


IE Padding
Click for full size
Firefox Padding
I'm creating a tableless site and going with the new school of CSS. :) I have sliced a background image into 3 for the top, background, and bottom and I am putting content inside of the background image. In IE it looks great but in Firefox it looks like crap. I tried adjusting the padding but it appears that Firefox just gets larger. Below is my code and screenshots. Any help is greatly appreciated. :)

.maintop
{
background: url(maintop.png);
width: 514px;
height: 23px;
background-repeat: no-repeat;
}

.mainbg
{
background: url(mainbg.png);
background-repeat: repeat-y;
width: 514px;
padding: 40px;
border-color: #acbcbf;
border-width: 1px;
border-style: dashed;
}

.mainbot
{
background: url(mainbot.png);
width: 514px;
height: 26px;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<div class="maintop"></div>
<div class="mainbg">
CONTENT HERE

</div>
<div class="mainbot"></div>
</body>
</html>

--
Skate, Snow, and Surf - SFboarders - Bringing San Francisco Bay Area boarders together.
SF Aloha - Bringing Da Islands to Da San Francisco Bay Area


sfboarders
Swimming With Sharks
Premium
join:2000-12-13
AtTheBeach
clubs:

Click for full size
Figured out a workaround. Any other things I can do?

.mainbg p {
padding: 20px; /*--------changed to 20px instead of 40px----------*/
}


klobb

join:2000-10-06


2 edits
reply to sfboarders
here.. added a container and just set the width of only the container (eg remove widths from the other classes). Works in both now.
<Style>
.container
{
width:514px;
}
.maintop
{
background: url(maintop.png);
height: 23px;
background-repeat: no-repeat;
}

.mainbg
{
background: url(mainbg.png);
background-repeat: repeat-y;
padding: 40px;
border-color: #acbcbf;
border-width: 1px;
border-style: dashed;
}

.mainbot
{
background: url(mainbot.png);
height: 26px;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<!-- added a container div -->
<div class="container">

<div class="maintop"></div>
<div class="mainbg">
CONTENT HERE

</div>
<div class="mainbot"></div>
<!-- close container -->
</div>
</body>
</html>


sfboarders
Swimming With Sharks
Premium
join:2000-12-13
AtTheBeach
clubs:
  Thanks that worked! I had a container on my site already so it was easy to add the width and remove the width from the other divs.


Roundboy
Premium
join:2000-10-04
Drexel Hill, PA

reply to sfboarders
this is the IE vs FF width bug ...

according to firefox, the width of an object is what you specify (150px), and padding(5px all around) & margins (5px) are subtracted from it (150 -5 -5 -5 -5 = 130px actual content)

Ie says .. whoa... 150 PLUS padding and margins, giving you 180px content ... or something like that.

Here is a workaround : »glish.com/css/hacks.asp
--
[spoiler]Steve the pirate DIES![/spoiler]
Forums » Tech and Talk » OS and Software » Webmasters and DevelopersLooking for This Kind of PHP Application »
« Apache2-Solaris10sparc-access to directories.. help!  


Wednesday, 09-Dec 11:49:04 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [197] Sprint Sued For Distracted Driving Death
· [81] 3G Network Test Says AT&T Is Tops
· [72] Mediacom Unveils 105 Mbps Pricing
· [65] Sprint Poised For A Turnaround?
· [57] WPA Cracker: Test WPA-PSK Networks In 20 Minutes
· [51] AT&T Launching New 24 Mbps U-Verse Tier
· [50] The Future Of Wi-Fi Is Bright
· [47] Site Leaks Yahoo, Verizon Fed Data Share Pricing
· [44] Microwaving Your Innards Is Not 'Extreme'
· [39] Verizon LTE: 5-12 Mbps Downstream
Most people now reading
· Comcast refused to install 400' feet. [Comcast HSI]
· Cross Server Dungeon Experience [World of Warcraft]
· IMG 1.7 (IMG Updates and Discussion) [Verizon FIOS TV]
· [How to] Install Asterisk on an Asus WL-520GU router [VOIP Tech Chat]
· HOA Headaches [General Questions]
· Windows 7 boot manager editing questions [Microsoft Help]
· Adobe Flash Player version 10.0.42.34 [Security]
· persistent connection to qw-in-f113.1e100.net on boot [Security]
· The aftermath [World of Warcraft]
· Is sleeping similar to being dead? [General Questions]