11

I have been searching the web for a chrome only solution. I need to modify something in a stylesheet in Chrome only, but I cannot seem to find what I'm looking for online nor on stackoverflow. Chrome has the following for padding left and right

-webkit-padding-start

-webkit-padding-end

But, is there anything for top AND bottom? OR, am I out of luck?

Community
  • 1
  • 1
  • 1
    What's the reasoning for Chrome only? Usually it's IE.. – Josh Crozier Nov 13 '13 at 20:19
  • As stupid as it sounds, I cannot modify the padding in Chrome more than what I am "allowed" by Chrome. Strange. It looks bigger in Chrome than IE or FF. – Kung Fu Front Ender Nov 13 '13 at 20:20
  • browser sniffing in CSS is a challenge http://css-tricks.com/snippets/css/browser-specific-hacks/ jquery has $.browser – Wayne Nov 13 '13 at 20:37
  • @Wayne I took a look at the website, and is it me or is it confusing? I am still unsure how you could use those. I am referring to comments vs actual coding interpreted as coding by the browsers. Will look at jquery for fun. – Kung Fu Front Ender Nov 13 '13 at 21:06
  • 1
    @Wayne uhm, read this. It might interest you [jquery stuff](http://stackoverflow.com/questions/9638247/is-jquery-browser-deprecated/#answer-9638284) – Kung Fu Front Ender Nov 13 '13 at 21:09
  • @KungFuFrontEnder browser sniffing is depreciated with html5; although it still exists. It makes for pages that break on future releases as browsers become more standardized. None the less there are still times we need to address one browsers non-standards issue. Feature support is the best way to go forward, IF it works. – Wayne Nov 13 '13 at 21:16
  • @Wayne fair enough, although I try to use HTML5 standards at all times lol. – Kung Fu Front Ender Nov 13 '13 at 21:32
  • @KungFuFrontEnder me too. But I keep bookmarking all the hacks just in case the browsers let me down. – Wayne Nov 13 '13 at 21:35

2 Answers2

34

Use -webkit-padding-before for top padding, -webkit-padding-after for bottom padding.

jsFiddle example

(Top) - -webkit-padding-before

(Right - -webkit-padding-end

(Bottom) - -webkit-padding-after

(Left) - -webkit-padding-start

enter image description here

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
1

This hack looks like it may do the trick.

@media screen and (-webkit-min-device-pixel-ratio:0) {
/* rules only apply in saf3+, chrome1+ */
}
Wayne
  • 4,760
  • 1
  • 24
  • 24