409 posts
  • Exclusive Author
  • Has been a member for 3-4 years
  • 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
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 000 and 5 000 dollars
  • United States
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
  • Exclusive Author
  • Has been a member for 3-4 years
  • India
Dhruv says

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

20 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 100 and 1 000 dollars
  • United States
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 100 and 1 000 dollars
  • United States
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 1 000 and 5 000 dollars
  • United States
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
  • Exclusive Author
  • Has been a member for 3-4 years
  • 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
  • Author had a Free File of the Month
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • United Kingdom
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