409 posts
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
Dhruv says

Hello, While looking at common rejection factors for CodeCanyon Items, i came across

Inline CSS : Do not use inline CSS . Export all styling to an external stylesheet.

I agree with this, but what if there are some places where i use the style only once and not again in that case i would use inline css

Saving the style in external stylesheet will load it everytime (even though i don’t need it) In that case what should i do…I have used lot of inline styles (all were necessary as the application i am developing is sort of big) but i don’t have any problem in exporting them to external stylesheet.., but that would be useless – as these inline styles are page specific.

But i will go with the rules, it will be easier even for me to have all the styles in single place/file I request forum moderators / product reviewers and top-notch authors to answer this post.

186 posts
  • Bought between 100 and 499 items
  • Contributed a Tutorial to a Tuts+ Site
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 50 000 and 100 000 dollars
Artillegence says

Inline style should be avoided and there is no reason to use them except for email templates , most of the elements can be styled using css selectors, ids and classes in the external stylesheet

409 posts
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
Dhruv says

Yes, i know that but…... what if…

let’s say theres 1 link which i want to style differently than others

ex:

Codecanyon

For this which is better

/* External stylesheet */ .link { color: red; text-decoration: underline; } <a href="#" class="link">Codecanyon</a>

or

<a href="#" style="color:red; text-decoration:underline;">Codecanyon</a>

Keeping in mind that this style will be only used once, but will be loaded everytime.

Note : There might be tens or up to hundreds of elements like this.

409 posts
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
Dhruv says

The code at place of Codecanyon was

<a href="#">Codecanyon</a>
296 posts
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 000 and 5 000 dollars
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • United Kingdom
theninja says
Although I do see where you’re coming from, there are a few reasons why it’s best to use external stylesheets :
  1. They’re a lot less messy and much easier to edit/customise/update.
  2. Inline CSS is loaded each time, whereas typically (depending how your server is set up of course), external stylesheets will be cached once and won’t have to load each time you view a page.
  3. It’s become a standard practice over the years (like placing links to external stylesheets between the head tags etc).
  4. And lastly, your item won’t be accepted unless you use external stylesheets and it’s best not to argue with the reviewers, they know their stuff lol :P
2529 posts
  • Attended a Community Meetup
  • Author had a Free File of the Month
  • Blog Editor
  • Bought between 50 and 99 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 5-6 years
+6 more
JeffreyWay says

Keep it to an external file. :)

409 posts
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
Dhruv says
Although I do see where you’re coming from, there are a few reasons why it’s best to use external stylesheets :

Have no idea what it means??? By the way i am from India. ( do you expect us to ask this type of questions :D )

I know external stylesheets are best and i use them all the time + have already used in the application.

I get everything + everypoint..

The only reason i asked this question was if i made use of inline styles will my app get rejected.., and the answer would be most probably yes.

Inline CSS is loaded each time, whereas typically (depending how your server is set up of course), external stylesheets will be cached once and won’t have to load each time you view a page.

Exactly, but the page where i use inline css wont be loaded every time, totally depending on the user.

Anyways, all the inline css i have used i will put them in a new external file. (not much though :D) Thanks.

409 posts
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
Dhruv says
Keep it to an external file. :)

Already started moving all the inline css to external css file. :stress:

Thank you.

296 posts
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 000 and 5 000 dollars
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • United Kingdom
theninja says
Although I do see where you’re coming from = Although I understand your point of view
Sorry, I’ll remember to cut back on the lingo in the future, I forget that not everyone speaks the same way abroad. :bigsmile:
Inline CSS is loaded each time, whereas typically (depending how your server is set up of course), external stylesheets will be cached once and won’t have to load each time you view a page.
What I meant by that is imagine a user visits one of your pages that’s using “style.css”, that file is cached and no longer has to be fetched from your server each time a new page is visited, whereas each time a person visits a page with inline CSS , that has to be loaded each time… it won’t make a huge difference but you understand what I mean, right?
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

If you would like to style only one link differently use a span tag like so..

a { color:black; } span { color:red; }

<a href="">Normal link</a>
<a href=""><span>Unique link</span></a>
by
by
by
by
by
by