I can't think of any circumstances where I would use inline CSS... it has to be external all the time.
Takes a lot longer time :/
I can't think of any circumstances where I would use inline CSS... it has to be external all the time.
Well i would say its fine for testing purposes, as well as single situations. Sometimes its simply more practical to use the style attribute.
I often use inline styles when testing new styles, and it can take quite some time for me to add them to the stylesheet.
One thing to remember however, using inline styles wont have any effect on your placement in the search engines like some beginners suggest, they often also claim xhtml to improve your ranking which simply isn't true.
So when practical use inline styles, and avoid a cluttered css file with styles that only effect a few situations on your page.
Clearing floats would be fine to do inline, but you could alternatively have a clearing class, if you ain't the only one working on the layout, and/or if your site where to support more then one layout through stylesheets.
Also keep in mind that external stylesheets are cached by the browser, embedded and inline styles ain't.
Last edited by BlueBoden; 11-10-2008 at 02:38 PM.
In some cases I have not been able to achieve the functionality I want without using an inline style... I try and stay away as much as possible though.
It makes no difference to SEO.
haha that's funny, I am guilty of the same thing. Only after I have got the exact styles that I want, do i go back and cut out the inline stuff and make classes in an external. Old habits die hard, right?
I'm the same - I often develop my code with CSS inline (this is particularly helpful when you're working on AJAX). Then move them out to a separate CSS file afterwards. The only time I leave inline styles in place is when they're required for the scripting I'm doing - when working with a javascript effects library like scriptaculous; I'll often find that I have to leave the styles inline in order to have Javascript modify them on the fly.
It's worth noting why we have external stylesheets in the first place - it speeds load times for your pages. Once your stylesheet is loaded for one page, it doesn't then have to be re-downloaded for subsequent pages, which means that your HTML files are smaller, so less to download.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks