Welcome to WebmasterWorld Guest from 18.232.124.77

Forum Moderators: open

Message Too Old, No Replies

i use inline css code

i use inline css code

     
7:24 pm on Feb 24, 2016 (gmt 0)

New User

joined:Feb 24, 2016
posts: 1
votes: 0


Hi everyone.I use inline css code. A lot of people say; inline is worst code algoritma and a lot of people say not bad.I want know one thing. Is this bad for seo ?

[edited by: engine at 9:23 am (utc) on Feb 25, 2016]

[edited by: bill at 12:16 am (utc) on Feb 26, 2016]
[edit reason] Please see WebmasterWorld TOS [/edit]

2:29 pm on Mar 4, 2016 (gmt 0)

Senior Member from GB 

joined:Oct 2, 2003
posts: 1019
votes: 39


Hi there mert344 +,
and a warm welcome to these forums. ;)

The use of "inline CSS" is poor coding practice,
if it is left in the published HTML document. :(

CSS should always be placed in an external file.

As a coding expedient though, it is perfectly OK
to use it whilst compiling the document. :)


birdbrain
3:22 pm on Mar 4, 2016 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member andy_langton is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 27, 2003
posts:3332
votes: 140


If you're optimising for speed, there's an argument that instead of small external CSS files, you should use inline CSS:

[developers.google.com...]

Similarly, you might do this for page-specific styles, or if you are expecting single-page visits.
3:27 pm on Mar 4, 2016 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:10141
votes: 1010


Occasional inline css code for unusual purpose or need is quite okay, but to use it for general formatting is nothing more than code bloat and very inefficient for the creation of content. Off load as much of that inline css to an external css file as possible.
9:49 pm on Mar 4, 2016 (gmt 0)

New User

joined:Nov 13, 2015
posts:8
votes: 2


What if the inline css is generated by php?
10:04 pm on Mar 4, 2016 (gmt 0)

Senior Member from GB 

joined:Oct 2, 2003
posts: 1019
votes: 39


Hi there IanM,
and a warm welcome to these forums. ;)

Why does the PHP need to generate inline CSS when it could just
as easily generate an "id attribute" or a "class attribute" instead?



birdbrain
10:10 pm on Mar 4, 2016 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member andy_langton is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 27, 2003
posts:3332
votes: 140


What if the inline css is generated by php?


It should make no difference at all whether PHP creates your CSS (be that inline or external).
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members