CSS Code that Only Runs for IE 6

Discussion in 'HTML' started by cfdvlpr, Dec 14, 2007.

  1. cfdvlpr

    cfdvlpr Guest

    Is there a certain way that you can write your css code so that
    certain properties for a class are only applied when the browser is IE
    6?
    cfdvlpr, Dec 14, 2007
    #1
    1. Advertising

  2. cfdvlpr

    Els Guest

    cfdvlpr wrote:

    > Is there a certain way that you can write your css code so that
    > certain properties for a class are only applied when the browser is IE
    > 6?


    Yes.
    You'll need to do some puzzling though, and if you really only want to
    address IE6 and not 5, 4, 3 or 7, it might be easier to use
    conditional comments and a separate stylesheet.

    For the puzzling: http://centricle.com/ref/css/filters/

    --
    Els http://locusmeus.com/
    Els, Dec 14, 2007
    #2
    1. Advertising

  3. Scripsit cfdvlpr:

    > Is there a certain way that you can write your css code so that
    > certain properties for a class are only applied when the browser is IE
    > 6?


    Yes. But since you would use it for wrong reasons, it's better that you
    don't know it. (The reasons are wrong because you didn't explain them.
    Therefore you can't get a solution to the real problem - though you
    might manage to get an advice on how to create the problem you're about
    to create.)

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Dec 14, 2007
    #3
  4. cfdvlpr

    Els Guest

    Jukka K. Korpela wrote:

    > The reasons are wrong because you didn't explain them.


    I have reasons to dislike you. Since I will not explain them, I reckon
    you will believe I dislike you for the wrong reasons. Which ironically
    probably explains them to anyone else but you.

    Dorayme, can you come back and prattle please? It's so much more
    pleasant to read than whatever the above is called.

    --
    Els http://locusmeus.com/
    Els, Dec 14, 2007
    #4
  5. cfdvlpr

    DocuMaker Guest

    On Dec 14, 10:52 am, cfdvlpr <> wrote:
    > Is there a certain way that you can write your css code so that
    > certain properties for a class are only applied when the browser is IE
    > 6?


    Javascript immediately comes to mind.

    <script>
    if browser = specific.type {
    document.write("specific css file")
    } else {
    document.write("some other css file")
    }
    </script>

    That is of course pseudo code. You can easily find a redirect script
    online somewhere and then modify it to load a css file instead of
    taking your visitors to a different page.

    ---
    http://www.outsource2documaker.com
    Managing outsourced projects ranging from fine artwork and business
    graphics to website design and maintenance.
    DocuMaker, Dec 14, 2007
    #5
  6. ..oO(cfdvlpr)

    >Is there a certain way that you can write your css code so that
    >certain properties for a class are only applied when the browser is IE
    >6?


    Google "Conditional Comments".

    Micha
    Michael Fesser, Dec 14, 2007
    #6
  7. ..oO(DocuMaker)

    >On Dec 14, 10:52 am, cfdvlpr <> wrote:
    >> Is there a certain way that you can write your css code so that
    >> certain properties for a class are only applied when the browser is IE
    >> 6?

    >
    >Javascript immediately comes to mind.


    Not really.

    ><script>
    >if browser = specific.type {


    Browser sniffing _never_ works reliably.

    Micha
    Michael Fesser, Dec 14, 2007
    #7
  8. DocuMaker wrote:

    > Javascript immediately comes to mind.
    >
    > <script>
    > if browser = specific.type {
    > document.write("specific css file")
    > } else {
    > document.write("some other css file")
    > }
    > </script>


    What will your script do when it encounters my browser UA string:

    Borgzilla/31.0 (Starship Enterprise NCC-1701)

    --
    -bts
    -Motorcycles defy gravity; cars just suck
    Beauregard T. Shagnasty, Dec 14, 2007
    #8
  9. Scripsit DocuMaker:

    > On Dec 14, 10:52 am, cfdvlpr <> wrote:
    >> Is there a certain way that you can write your css code so that
    >> certain properties for a class are only applied when the browser is
    >> IE 6?

    >
    > Javascript immediately comes to mind.


    Which part of the word "certain" did you fail to understand?

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Dec 14, 2007
    #9
  10. cfdvlpr

    dorayme Guest

    In article <adB8j.265481$%>,
    "Jukka K. Korpela" <> wrote:

    > (The reasons are wrong because you didn't explain them.
    > Therefore you can't get a solution to the real problem - though you
    > might manage to get an advice on how to create the problem you're about
    > to create.)



    I have become intensely interested in what you say in brackets*

    Reasons cannot be wrong *because* they are not explicitly given.

    While there are merits in the philosophy of positivism so
    excitingly propagated by certain thinkers loosely centred on
    Vienna earlier last century, most other thinkers had come to see
    its flaws by at least the middle of that century. Perhaps in
    Iceland, there is a current 21st century attempt at
    rehabilitation? Do tell.


    ---------------------------------
    * See my earlier clueless prattling babbling post on a bracketed
    remark by you in the thread on marquees.

    --
    dorayme
    dorayme, Dec 14, 2007
    #10
  11. cfdvlpr

    cfdvlpr Guest

    The conditional comment thing is not working for me. However, using
    jQuery like this:
    if( $.browser.msie && (jQuery.browser.version < 7.0000) ) {
    $('#content').css("padding-right","2px");
    }
    does seem to work. Is that bad practice?
    cfdvlpr, Dec 15, 2007
    #11
  12. cfdvlpr

    Bergamot Guest

    cfdvlpr wrote:
    > The conditional comment thing is not working for me. However, using
    > jQuery like this:
    > if( $.browser.msie && (jQuery.browser.version < 7.0000) ) {
    > $('#content').css("padding-right","2px");
    > }
    > does seem to work. Is that bad practice?


    You're worried about a lousy 2px? You probably have a lot bigger
    problems than you realize.

    --
    Berg
    Bergamot, Dec 15, 2007
    #12
  13. ..oO(cfdvlpr)

    >The conditional comment thing is not working for me.


    Then you've made a mistake. On my sites I use

    <!--[if lte IE 6]>
    <link rel="stylesheet" href="/css/ie6.css" type="text/css"
    media="screen">
    <![endif]-->

    Adjust the path and filename as necessary.

    >However, using
    >jQuery like this:
    >if( $.browser.msie && (jQuery.browser.version < 7.0000) ) {
    > $('#content').css("padding-right","2px");
    >}
    >does seem to work.


    Nope.

    >Is that bad practice?


    Yes.

    Micha
    Michael Fesser, Dec 15, 2007
    #13
  14. Scripsit dorayme:

    > In article <adB8j.265481$%>,
    > "Jukka K. Korpela" <> wrote:
    >
    >> (The reasons are wrong because you didn't explain them.
    >> Therefore you can't get a solution to the real problem - though you
    >> might manage to get an advice on how to create the problem you're
    >> about to create.)

    >
    > I have become intensely interested in what you say in brackets*


    Parentheses, not brackets. (I might overuse parentheses but I seldom use
    brackets [except as a special device when quoting].)

    > Reasons cannot be wrong *because* they are not explicitly given.


    You might be right. Maybe I should have used a comma before "because".

    The point, however, is that a failure to explain the reasons for
    something like browser sniffing for CSS is a sure enough symptom of the
    reasons being wrong. In this case, the subsequent posts from the OP have
    confirmed that this conclusion was correct, as usual.

    > While there are merits in the philosophy of positivism so
    > excitingly propagated by certain thinkers loosely centred on
    > Vienna earlier last century, most other thinkers had come to see
    > its flaws by at least the middle of that century.


    Is your virus control up-to-date? It seems like your system has a virus
    that causes fragments of text to be inserted into your postings quite
    randomly, or with rudimentary AI.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Dec 15, 2007
    #14
  15. cfdvlpr

    dorayme Guest

    In article <IlL8j.265667$>,
    "Jukka K. Korpela" <> wrote:

    > Scripsit dorayme:
    >
    > > In article <adB8j.265481$%>,
    > > "Jukka K. Korpela" <> wrote:
    > >
    > >> (The reasons are wrong because you didn't explain them.
    > >> Therefore you can't get a solution to the real problem - though you
    > >> might manage to get an advice on how to create the problem you're
    > >> about to create.)

    > >
    > > I have become intensely interested in what you say in brackets*

    >
    > Parentheses, not brackets.
    >


    Brackets. Your parenthetical remark was in brackets, round
    brackets to be more specific. There is no getting away from this.
    No amount of babbling by either you or me can change this fact.
    It is there for all to see. Not (Parentheses, not brackets) but
    rather (Parentheses and brackets). In the last sentence what were
    in the brackets were not parentheses - they could well not have
    been in brackets. This goes to show that there are more things
    that can go into brackets than parenthetical remarks. You have
    not taken seriously my interest in all your bracketed content. I
    am interested in all of it, not just the parenthetical remarks.
    You should be flattered. You never realised how big a fan I was.
    I forgive you.

    > > Reasons cannot be wrong *because* they are not explicitly given.

    >
    > You might be right. Maybe I should have used a comma before "because".
    >


    There really is no question of *might* here. It is not even
    slightly controversial that someone might not reveal his good
    reasons for doing something. A comma, alas, would not have
    helped. Had you said:

    "The reasons are wrong, because you didn't explain them".

    it would have made no difference really. There is something too
    deeply wrong. But I do not judge you harshly on this, I believe
    you could reformulate. I have gone on here only because, to use
    an Australian expression that is not as bad as it sounds, you
    have been pissing me off lately. But I do settle if you are
    polite.

    > The point, however, is that a failure to explain the reasons for
    > something like browser sniffing for CSS is a sure enough symptom of the
    > reasons being wrong. In this case, the subsequent posts from the OP have
    > confirmed that this conclusion was correct, as usual.
    >
    > > While there are merits in the philosophy of positivism so
    > > excitingly propagated by certain thinkers loosely centred on
    > > Vienna earlier last century, most other thinkers had come to see
    > > its flaws by at least the middle of that century.

    >
    > Is your virus control up-to-date? It seems like your system has a virus
    > that causes fragments of text to be inserted into your postings quite
    > randomly, or with rudimentary AI.


    I cannot tell you how pleased I am that you should have brought
    this to my attention. I have rejected the idea that you are
    clueless about certain matters and preferred the virus theory.
    Accordingly, I have unearthed other things that this virus has
    spread in my writings. Like:

    "In the movement loosely known as positivism, the meaning of a
    statement was linked to the conditions of its verification. This
    idea has a great deal of attraction and would almost certainly
    appeal to hard headed technical folk. One particularly attractive
    feature for an atheist is that all the statements made by theists
    are worse than merely false. They appear to be bullshit. And they
    are this because there is no way to verify them. Without knowing
    how one would actually verify such statements, one is really
    quite clueless about their real meaning.

    Unfortunately, things are not quite as crude as this and the
    atheist hoping for a quick method of refutation needs to pause
    and reflect further. There are many statements that have turned
    out to be true that, while not obviously incomprehensible, were
    quite unaccompanied by any known means of testing."

    I suppose this virus inserted this text from my writings at the
    trigger of your statement about reasons being wrong when not
    accompanied by explicit expression. Funny how these viruses work.
    It is almost as if they see analogies where we don't.

    --
    dorayme
    dorayme, Dec 15, 2007
    #15
  16. On Sat, 15 Dec 2007 19:50:48 +1100, dorayme
    <> wrote:

    > Brackets. Your parenthetical remark was in brackets, round
    > brackets to be more specific. There is no getting away from this.


    Ouch. Sorry to butt in (like a goat) here but I think parentheses is
    correct. I don't think "round brackets" is right.

    () - parentheses
    [] - brackets
    {} - braces
    <> - angle brackets

    --
    Steven
    Steven Saunderson, Dec 15, 2007
    #16
  17. cfdvlpr

    Ben C Guest

    [OT babble was] Re: CSS Code that Only Runs for IE 6

    On 2007-12-15, dorayme <> wrote:
    [...]
    > "In the movement loosely known as positivism, the meaning of a
    > statement was linked to the conditions of its verification. This
    > idea has a great deal of attraction and would almost certainly
    > appeal to hard headed technical folk. One particularly attractive
    > feature for an atheist is that all the statements made by theists
    > are worse than merely false. They appear to be bullshit. And they
    > are this because there is no way to verify them. Without knowing
    > how one would actually verify such statements, one is really
    > quite clueless about their real meaning.
    >
    > Unfortunately, things are not quite as crude as this and the
    > atheist hoping for a quick method of refutation needs to pause
    > and reflect further. There are many statements that have turned
    > out to be true that, while not obviously incomprehensible, were
    > quite unaccompanied by any known means of testing."


    Can you give an example of such a statement?

    I would have put it differently: there are many meaningful statements
    that don't have any verification conditions.

    > I suppose this virus inserted this text from my writings at the
    > trigger of your statement about reasons being wrong when not
    > accompanied by explicit expression. Funny how these viruses work.
    > It is almost as if they see analogies where we don't.


    I'm not seeing this one. The statement was "your reasons are wrong
    because you didn't state them". It's a total presumption by Mr K., but
    isn't he just presuming that the OP is clueless, not that the meaning of
    any statement is its truth conditions?
    Ben C, Dec 15, 2007
    #17
  18. cfdvlpr

    Bone Ur Guest

    Well bust mah britches and call me cheeky, on Fri, 14 Dec 2007 20:26:43 GMT
    Michael Fesser scribed:

    >>> Is there a certain way that you can write your css code so that
    >>> certain properties for a class are only applied when the browser is IE
    >>> 6?

    >>
    >>Javascript immediately comes to mind.

    >
    > Not really.
    >
    >><script>
    >>if browser = specific.type {

    >
    > Browser sniffing _never_ works reliably.


    Works for me. Always. However, I agree with your conclusion about j/s
    being inappropriate for this case.

    --
    Bone Ur
    Cavemen have formidable pheromones.
    Bone Ur, Dec 15, 2007
    #18
  19. cfdvlpr

    Bone Ur Guest

    Well bust mah britches and call me cheeky, on Fri, 14 Dec 2007 20:44:27 GMT
    Beauregard T. Shagnasty scribed:

    >> Javascript immediately comes to mind.
    >>
    >> <script>
    >> if browser = specific.type {
    >> document.write("specific css file")
    >> } else {
    >> document.write("some other css file")
    >> }
    >> </script>

    >
    > What will your script do when it encounters my browser UA string:
    >
    > Borgzilla/31.0 (Starship Enterprise NCC-1701)


    Well, if it's well-written, it will just "Kling-on"...

    --
    Bone Ur
    Cavemen have formidable pheromones.
    Bone Ur, Dec 15, 2007
    #19
  20. cfdvlpr

    Stephan Bird Guest

    OT Bracket naming; Was (re: CSS Code that Only Runs for IE 6)

    On Sat, 15 Dec 2007 21:17:11 +1100 in
    , Steven Saunderson
    <> wrote:

    > On Sat, 15 Dec 2007 19:50:48 +1100, dorayme
    > <> wrote:
    >
    >> Brackets. Your parenthetical remark was in brackets, round brackets to
    >> be more specific. There is no getting away from this.

    >
    > Ouch. Sorry to butt in (like a goat) here but I think parentheses is
    > correct. I don't think "round brackets" is right.
    >
    > () - parentheses
    > [] - brackets
    > {} - braces
    > <> - angle brackets


    This may be a language thing. I refer to the 4 glyphs above as brackets,
    square brackets, braces, and angle brackets respectively....

    just my 2p

    Stephan

    --
    Stephan Bird MChem(Hons) AMRSC
    Currently in Caernarfon, Wales
    Stephan Bird, Dec 15, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mindy Myers
    Replies:
    4
    Views:
    282
    Richard Loupatty
    Jan 29, 2004
  2. Replies:
    3
    Views:
    386
    Patrick.O.Ige
    Jan 23, 2006
  3. =?Utf-8?B?TGl0dGxlIEdhemVy?=

    App only runs in debug mode

    =?Utf-8?B?TGl0dGxlIEdhemVy?=, Aug 29, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    354
    Laurent Bugnion
    Aug 30, 2006
  4. Hari Sekhon
    Replies:
    11
    Views:
    568
    Eric S. Johansson
    Oct 3, 2006
  5. Tim Williams
    Replies:
    9
    Views:
    279
    Lawrence D'Oliveiro
    Oct 7, 2006
Loading...

Share This Page