SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Guru Amirsan's Avatar
    Join Date
    Jun 2004
    Location
    SCC
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Cannot select text in IE

    For some reason, when using Internet Explorer, I cannot select any text on the page. I can't select a sentence or a word. I asked those who are knowledgeable about my CMS and they said that it was most likely the HTML or CSS that is causing this.

    Here is a link to an example page:
    http://civ.stratcommandcenter.com/general/overview/
    Strategic Command Center

    "What's a small napoleon and where would i find one"

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try validating the 69 HTML validation errors you have (from the very top) first.

    Fix an error, then revalidate. You'd be surprised how many of those errors will go away by making one minor fix.

    And for the record, I can select the text, but only if I move the mouse from right to left while holding the left mouse button down. Right clicking works normally.

  3. #3
    SitePoint Guru gavwvin's Avatar
    Join Date
    Nov 2004
    Location
    Cornwall, UK
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've seen this happen before and the problem was the text is "underneath" a transparent div, so it can't be selected. Look through your css to see whether there might be such a div placed over the top of the text in IE somehow.

  4. #4
    SitePoint Guru Amirsan's Avatar
    Join Date
    Jun 2004
    Location
    SCC
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies guys.

    As for the 69 errors, most of them are <br> tags which are produced by the WYSIWYG editor in my CMS, and attribute errors, and an error which states that I must small caps the UL tag. Do these really effect this problem?

    The last error however was about a div id tag I used twice, and its on the very very top right after the body tag. Is this a transparent DIV? What is a transparent DIV?
    Strategic Command Center

    "What's a small napoleon and where would i find one"

  5. #5
    SitePoint Guru Amirsan's Avatar
    Join Date
    Jun 2004
    Location
    SCC
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just got a reply on my question thread in the support for my CMS, and someone said the following:

    1 advice: try not to use transparent PNG for IE, even with the
    alpha-tweak in your css. And definatly don't use this as a background
    for any box you want to add text and/or links in it.
    IE is very buggy with trans. png.

    this is 99% causing your 'strange' IE error:
    * html #banner #section_nav li
    a{filterrogidXImageTransform.Microsoft.AlphaImageLoader(src='http://www.stratcommandcenter.com/redesign/fileadmin/templates/redesign2/images/section_nav.png',sizingMethod='scale');}

    my advice: use only gif or jpg for IE. if you cant' get the same result
    with a jpg well, bad luck for the IE users.
    Paul helped me to create this transparent attribute. Paul would you happen to know the solution to this bug?
    Strategic Command Center

    "What's a small napoleon and where would i find one"

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Paul would you happen to know the solution to this bug?
    Yes

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    I suppose you want me to tell you how to solve it then .

    1 advice: try not to use transparent PNG for IE, even with the
    alpha-tweak in your css. And definatly don't use this as a background
    for any box you want to add text and/or links in it.
    IE is very buggy with trans. png.

    this is 99% causing your 'strange' IE error:
    That's always a good starting point by asking someone who knows nothing about css lol

    Well I shouldn't be too harsh because the alpha image loader is very buggy and can cause strange things to happen. The usual problem is that you can't select links when you use the alpga image loader but I believe I already fixed that for you years ago.

    However your problem is actually cause by using this line in the html:

    Code:
    <base href="http://civ.stratcommandcenter.com" />
    For some reason that tag stops text being selected in ie when the element has position:relative defined. (IE strikes again!)

    There are a number of solutions.

    1) Remove the base tag and apply relative or absolute paths to your images and whatever.

    2) Depending on why you are using position:relative you could remove it from #wrapper and #content_wrap and then you can select the text ok. However you will lose the stacking context if you needed one for z-index or further positioned elements.

    3) Or perhaps the best solution add this code to the css instead.
    Code:
    * html body{position:relative}
    Sometimes position:relative on the body can cause other things to happen but they are probably "layout" issues anyway so just double check.

    The safest option is to remove the base tag and the next safest is to use position:relative on the body (but just for ie).

    You should know that in absolutely placed elements it is impossible to select text at all in IE6 and there is no solution. This is a well known ie bug that only occurs in standards mode but is non-existent in quirksmode or in ie5 and 5.5.

    Hope that helps

  8. #8
    SitePoint Guru Amirsan's Avatar
    Join Date
    Jun 2004
    Location
    SCC
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Paul, I dont think I have EVER encountered a more helpful member then you. I did the position relative solution, since removing or altaring the base attribute is not an option (since its part of the CMS, and its function). Though adding the position:relative attribute to the body didn't effect my layout as far as I can see, so it's working for now.

    Thank you very much.
    Strategic Command Center

    "What's a small napoleon and where would i find one"

  9. #9
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    However your problem is actually cause by using this line in the html:
    Code:
    <base href="http://civ.stratcommandcenter.com" />
    For some reason that tag stops text being selected in ie when the element has position:relative defined. (IE strikes again!)
    This is because IE thinks BASE isn't an EMPTY element, so it build a DOM where the BODY element is a child of the BASE element and the HTML element. (Shouldn't be possible, but you know, IE never really builds a DOM that is a tree...)

    Another option would be to use <base></base> (which makes IE build a somewhat more correct DOM), but </base> is of course invalid HTML4.
    Simon Pieters

  10. #10
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi Simon,

    Thanks for the info

    Yes i thought I'd found a new bug and new solution until I saw the article at berea street. (I noticed you had already been there also )

    The trigger is an element with layout and position:relative added. Adding position:relative to the body seems to cure it quite well though. It's yet another IE hoop to jump through

  11. #11
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Absolutely bizarre. I am glad there are some geniuses on this forum to solve these things.

  12. #12
    SitePoint Guru Amirsan's Avatar
    Join Date
    Jun 2004
    Location
    SCC
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mejobloggs
    Absolutely bizarre. I am glad there are some geniuses on this forum to solve these things.
    I second that.
    Strategic Command Center

    "What's a small napoleon and where would i find one"


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
  •