409 posts
    Has been part of the Envato Community for over 4 years Sells items exclusively on Envato Market Located in India
Dhruv says

@theninja

:ohrly: :D and i taught you were just being racist + rude :D SORRY :(

And yes i get it, it’s a good thing that i asked this question otherwise my very first app would have been rejected.

@tigerlabs

Works perfectly for few, but i had planned to style nearly 100 elements differently.

320 posts
    Has been part of the Envato Community for over 5 years Has sold $1,000+ on Envato Market Had an item featured in an Envato Bundle Has collected 1+ items on Envato Market
+2 more
jwmcpeak says

Personally, it doesn’t matter to me how little a particular style is used. CSS belongs in a style sheet, not in an HTML attribute. It makes maintenance much easier.

The principle is true for JavaScript, too.

409 posts
    Has been part of the Envato Community for over 4 years Sells items exclusively on Envato Market Located in India
Dhruv says

Makes sense to me. and yup it does make maintenance much easier.

20 posts
    Has been part of the Envato Community for over 3 years Has sold $100+ on Envato Market Has collected 1+ items on Envato Market Sells items exclusively on Envato Market
+1 more
Duilen says
a.link { color:#000; }
a.red { color:#ff0000; }

<a href="#" class="link">Black link</a>
<a href="#" class="link red">Red link</a>
20 posts
    Has been part of the Envato Community for over 3 years Has sold $100+ on Envato Market Has collected 1+ items on Envato Market Sells items exclusively on Envato Market
+1 more
Duilen says

Actually, adding a .link class for no good reason is just bad. Let’s use a better example, a nav.

#nav a { color:#000; }
#nav a.active { color:#ff0000; }

<ul id="nav">
  <li><a href="#">Black link</a></li>
  <li><a href="#">Black link</a></li>
  <li><a href="#" class="active">Red link</a></li>
  <li><a href="#">Black link</a></li>
  <li><a href="#">Black link</a></li>
  <li><a href="#">Black link</a></li>
</ul>
831 posts
    Has been part of the Envato Community for over 4 years Has referred 1+ members Has sold $1,000+ on Envato Market Has collected 10+ items on Envato Market
+3 more
tigerlabs says
@tigerlabs Works perfectly for few, but i had planned to style nearly 100 elements differently.

Use anchors with different classes then. :)

409 posts
    Has been part of the Envato Community for over 4 years Sells items exclusively on Envato Market Located in India
Dhruv says

Thanks for your reply Duilen.

I just used .link class for the demo thats all…

And i will use all possible ways to get the job done easily and effectively (KISS Principle)

KISS : Keep It Simple Stupid

And out of curiosity, If the app got hundreds of pages and uses inline css only once or twice at that time will the app get rejected or what?? (Just asking. – I already moved all inline css to external stylesheet :D :) )

102 posts
    Has been part of the Envato Community for over 4 years Has referred 1+ members Has sold $10,000+ on Envato Market Has collected 100+ items on Envato Market
+4 more
RyanDavies says

In my ( humble ) opinion, inline css is not good, from a customer usability, customization and presentation perspective.

For example, if you have a script which comprises of many pages and lots of lines of code, non code savvy users will find themselves trawling through your script to find where they need to change an attribute.

Whilst you could say that they would need to look at the code to find the css class / id, they should only need to look, not alter.

CSS is designed to enable you to change the appearance of all your markup from one central place, use it to its full capacity :)

by
by
by
by
by
by