Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
setting padding without px after number?
Old 12-17-2007, 12:04 PM setting padding without px after number?
Skilled Talker

Posts: 78
Trades: 0
This is really weird, I have several style sheets from high end websites that have padding set like this for example:

padding: 0 40 10 20;

However when I write mine like this in dreamweaver it does not work, it sets no padding at all, until I add the "px" after like this:

padding: 0px 40px 10px 20px;

I am curious why this works without the "px" for other people but not me?
Boar is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-17-2007, 12:07 PM Re: setting padding without px after number?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
It shouldn't. You need to indicate the unit of measure.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 12-17-2007, 02:33 PM Re: setting padding without px after number?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I believe it works when the browsers are in quirks mode.
Once they switch in standard compliant mode, those values are ignored.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 12-17-2007, 02:47 PM Re: setting padding without px after number?
beta's Avatar
Extreme Talker

Posts: 169
Trades: 0
As far as i know you have always been able to safely use 0 without a unit, because there is nothing, thats what the zero means, so... well... nothing hasn't got a unit of measurement.
beta is offline
Reply With Quote
View Public Profile
 
Old 12-17-2007, 02:49 PM Re: setting padding without px after number?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Correct, zero doesn't need a unit, but anything else does.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 12-17-2007, 03:09 PM Re: setting padding without px after number?
beta's Avatar
Extreme Talker

Posts: 169
Trades: 0
I just read my post again and wanna make clear im not being sarcastic or nasty, just typing as i think i gotta stop that...
beta is offline
Reply With Quote
View Public Profile
 
Old 12-17-2007, 05:57 PM Re: setting padding without px after number?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Some browsers might work like that, but if you're working in dreamweaver and you click preview, it won't show the padding unless you make it W3C compliant.
__________________
<?php if($Adsense_Revenue > 0): define('HAPPINES','100%'); else: define('HAPPINESS', '0%') endif; ?>

Last edited by coolkbk585; 12-17-2007 at 06:37 PM..
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Old 12-17-2007, 06:10 PM Re: setting padding without px after number?
beta's Avatar
Extreme Talker

Posts: 169
Trades: 0
Not using units isnt not w3c compliant. If i can make that clear enough.

In other words -width: 0; is still being w3c compliant
beta is offline
Reply With Quote
View Public Profile
 
Old 12-17-2007, 06:38 PM Re: setting padding without px after number?
coolkbk585's Avatar
Be good this Christmas!

Latest Blog Post:
KBlog has been deativated
Posts: 642
Name: Kyle
Location: Ada, MI
Trades: 0
Quote:
Originally Posted by beta View Post
Not using units isnt not w3c compliant. If i can make that clear enough.

In other words -width: 0; is still being w3c compliant
Oh, sorry if I wasn't clear in my post...that's what I was saying...

__________________
<?php if($Adsense_Revenue > 0): define('HAPPINES','100%'); else: define('HAPPINESS', '0%') endif; ?>
coolkbk585 is offline
Reply With Quote
View Public Profile Visit coolkbk585's homepage!
 
Reply     « Reply to setting padding without px after number?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51710 seconds with 12 queries