Forum Moderators: not2easy

Message Too Old, No Replies

Declarations of padding & caching

you can do short form can't you?

         

Matthew1980

6:30 pm on Jun 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,
.a_class{
padding-top: 2px;
padding-left:2px;
padding-right:2px;
padding-bottom:2px;
}
this can be done as:-

padding: 2px 2px 2px 2px;

My question is what's the order of declaration? top bottom left right?

because it looks like my browser likes to hog settings from 20 mins ago, because no matter what I do its not changing straight away, three ctrl+F5's took it to realise I had altered the settings.

Cheers,
MRb

Fotiman

6:47 pm on Jun 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



[w3.org...]

The 'padding' property is a shorthand property for setting 'padding-top', 'padding-right', 'padding-bottom', and 'padding-left' at the same place in the style sheet.

If there is only one value, it applies to all sides. If there are two values, the top and bottom paddings are set to the first value and the right and left paddings are set to the second. If there are three values, the top is set to the first value, the left and right are set to the second, and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and left, respectively.

Matthew1980

7:43 pm on Jun 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there Fotiman,

Thanks for the pointer, now I have read it, that makes perfect sense. Now I just need to find out why it was caching the values.. Even if I forces the server refresh :)

Cheers,
MRb

rocknbil

11:27 pm on Jun 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Think of it as starting at noon on a clock. 12, 3, 6, 9. :-)

In the case you posted,

padding: { 2px; }

is equivalent. It's probably a combo of server caching and the browser, on some servers it's a nightmare, others, every page reloads related files. Really bad with Flash. Use the old query string trick when developing:

type="text/css" href="style.css?version1234"

Change it with each upload, that will insure it's downloading.

rainborick

12:26 pm on Jun 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



One large hosting company I deal with on a regular basis started caching CSS files across their load-balanced servers within the past year or so. It can take several minutes for changes to CSS files to propagate across the entire network, which makes it frustrating to work on layouts.

If this is the practice with your host, another work-around is to embed the CSS instructions you need to adjust within the <head> of your working or test document until you've got it working right and then transfer those instructions into your usual .css file to deploy the changes site-wide.

Matthew1980

9:17 pm on Jun 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Rocknbil: thanks for the tip. I shall use that. Stunningly simple. :)

Rainboric: this is a localhost issue but i had no idea that some hosts do it too. Thanks for tip.

Cheers.
MRb