SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    38911 Basic Bytes Free johnuk's Avatar
    Join Date
    Jul 2008
    Location
    Somerset, England
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Special Project - Inline styles?

    Hi all,

    This morning my client asked me to code him up some (very) basic html to paste into his e-commerce store's CMS. The code is for some 'inner tabs' where he will be adding product descriptions on the fly cut and paste style.

    As someone who is used to working with external style sheets 99.9% of the time the descision on where to add styles has thrown me a little (I will not have access to the document head).

    Im guessing it would be a really bad idea on this one occasion to link to an external style sheet from deep within the body of a document. So for the few styles I need to add, would It be best to opt for inline styles on this one occasion?


    Many thanks!

  2. #2
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,830
    Mentioned
    110 Post(s)
    Tagged
    1 Thread(s)
    Yes, there are some times when you just need a "quick and dirty" solution, and embedded or even inline styles are the most pragmatic way to go about it.

    One of the big arguments against inline CSS is that it is not re-usable, and you have to declare it each and every time. But if you're just styling one element on one page, that's irrelevant, and arguably it's better in terms of bandwidth and/or handshakes to have the inline style than to put it in an external stylesheet where the rule will be downloaded by thousands of people who never need it.

  3. #3
    38911 Basic Bytes Free johnuk's Avatar
    Join Date
    Jul 2008
    Location
    Somerset, England
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    Yes, there are some times when you just need a "quick and dirty" solution, and embedded or even inline styles are the most pragmatic way to go about it.

    One of the big arguments against inline CSS is that it is not re-usable, and you have to declare it each and every time. But if you're just styling one element on one page, that's irrelevant, and arguably it's better in terms of bandwidth and/or handshakes to have the inline style than to put it in an external stylesheet where the rule will be downloaded by thousands of people who never need it.
    Many thanks for your reply Stevie D - yeah I felt quick and dirty using inline styles (LOL), but I think you are right this is the best soloution in this instance - thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •