Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easier Cross-Browser CSS3 Features [closed]

Tags:

html

css

To add box-shadow to a HTML element, I currently have to do this:

box-shadow: 2px 2px 3px #969696;
-moz-box-shadow: 2px 2px 3px #969696;
-webkit-box-shadow: 2px 2px 3px #969696; filter: progid:DXImageTransform.Microsoft.Shadow(color='#969696', Direction=145, Strength=3);

At this point, it seems to me that this amount of code for a simple gradient is ridiculous at this stage of the web. Not to mention the maintenance time- if I want to change the color, I have to change it four times for each vendor prefix. (This also applies for things like CSS3 Gradients).

What's a better, more optimized way for handling this simply? I'm aware there are large non-standard fixes like CSS3 Pie, but in my experience, they take forever to load and I still have to write code for Firefox & Webkit. Do I need to resort to server-side code to do this? I'm just really frustrated working with redundant awkward-looking code.

like image 304
element119 Avatar asked Mar 18 '11 01:03

element119


People also ask

Is CSS3 fully supported by all browsers?

Up until now, most of the CSS you've learned is fully supported in all browsers. For newer properties, from CSS3 and later, that's not always going to be the case. It's important to check the compatibility of a property to know if you should use it.


3 Answers

You could use any of the following to ease your sorrows:

Dynamic Stylesheet Languages/CSS Extensions

  • LESS
  • Sass
  • Compass (Sass Framework)

CSS 3 Generators

  • Prefixr
  • CSS 3 Please
  • CSS 3 Generator
  • Mother Effing HSL
  • Mother Effing Text Shadow
  • CSS 3 Maker
  • CSS Gradient Generator
  • CSS Filter Effects
like image 115
Bryan Downing Avatar answered Sep 23 '22 11:09

Bryan Downing


cssSandpaper is what you are looking for.

like image 22
Knu Avatar answered Sep 21 '22 11:09

Knu


Use Less CSS framework with bootstrap's preboot here http://markdotto.com/bootstrap/

like image 35
Ali Salehi Avatar answered Sep 20 '22 11:09

Ali Salehi