CSS - Ie 6 Not Recognizing Element Bounds
I have a <div> that will eventually be draggable. The javascript I'm using to achieve this allows you to specify the ID of an element that will serve as the area from which you can drag the parent <div>. In my case, I am creating a pseudo popup window and want for it to be draggable by its title bar.
I'm assuming that the jacascript watches for the mousedown event to be fired while the mouse is within the the specified element's bounds (either by calculating dimensions or using the mouseover event). For some reason, IE is not properly detecting that the mouse is within the bounds of any elements within the parent <div>. The only exception being when the mouse is directly over actual content (not empty space) within that element. What's even weirder is that it seems to be detecting when the mouse is from just above the top edge of the element to about 20px above the top edge. Run the code below in IE and mouse over the empty space to the right of both lines of text - then between 1 and ~20px above the empty space for both. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Test</title> <style type="text/css"> body { margin: 0; } #cFiveDlrWin { width: 400px; height: 225px; background: #0f0; position: absolute; top: 25px; left: 20px; /* text-align: left; */ } #cFiveDlrWin h3 { background: #f00; cursor: move; padding: 3px 5px; margin: 5px; margin-top: 25px; /* */ } #cFiveDlrWin p#helpTxt { cursor: help; margin: 10px; border: 1px solid #00c; margin-top: 25px; } #cFiveDlrWin a { display: block; cursor: crosshair; padding: 5px; margin: 20px; margin-top: 25px; border: 1px solid #00c; text-decoration: none; } #cFiveDlrWin a:hover { text-decoration: underline; } </style> <script type="text/javascript"> <!-- function initPage(bool) { if(bool) { var oHandle = document.getElementById('titleBar'); var oHelpTxt = document.getElementById('helpTxt'); oHandle.onmouseover = function() { alert('in title bar container'); } oHelpTxt.onmouseover = function() { alert('in help text container'); } } } </script> </head> <body onload="initPage(true);"> <div id="cFiveDlrWin"> <h3 id="titleBar">Title Bar</h3> <p id="helpTxt">Help Text: Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> <a href="">text link</a> </div> </body> </html> This of course works as expected in FF. Any ideas? PS - giving the element a width via css fixes the problem... I guess I'm more curious about WHY IE is choosing to display like this. Similar TutorialsHello, I'm building a site for a friend and I have an issue on older IE browsers with the page expanding horizontally out of bounds when the content reaches more than 100% of the viewport. Could someone offer me a solution for this problem? It works properly on Moz and IE8. The anomaly can be viewed on this page: http://mercurial.pri.ee/Esaber/isabel.html My CSS files are as follows: http://mercurial.pri.ee/Esaber/styling.css http://mercurial.pri.ee/Esaber/table.css Hi all: I remember when IE was the more forgiving browser, but these days it's really killing me. I am developing a site dubdubdub. fastrackservices org slash index_test.html It looks fine on Chrome, FF and IE 9, but on IE8 ( I won't even look at 7) My background image is not being recognized body { background:url(/images/med_bgrd.gif)top center repeat-y #bfbfbf; font-family:arial, verdana; font-size:12px; } Any ideas? Thanks, http://www.mrossana.com/storage/bel.../template1.html In Firefox, the background of #topmenu2 and 3 extend the entire width of the surrounding div, which is what I want it to do. In Internet Explorer, the floated #logo_wrapper div stops the background of #topmenu2 and 3. Is there any way I can get this to work in Internet Explorer the way it does in Firefox? Hi, My page has 3 elements: one at the top(header banner), one in the middle (a middle content area) and one at the bottom (footer banner). Now I want those positions to remain intact regardless of the number of lines output in the middle element. The content is going to be determined at runtime by a server-side routine so I don't want to use a fixed positioning for the footer banner. I want it to be displayed at the bottom - after the middle content is displayed. And I want the middle content to be visible in the page i.e. I don't want a scroll area within the page. I have tried various approaches and read up on positioning but so far have not been able to do it using css. Any help is much appreciated. Jim I have an navigation menu that I am building as an unordered list. What I have is an image rollover that appears at the bottom of the navigation menu when the cursor hovers over one of the first level links by using a span within the link that has its display set to none, and then set to absolute positioned directly below the navigation menu on a:hover. Here is an example: Code: <ul> <li> <a href="link1.html" id="link1">Link<span></span></a> </li> </ul> .link a { some link height } .link a span { display: none; } .link a:hover span { position: abolute; top: (some link height * the number of links); background-image: (some image url) width: (image width) height: (image height) } Appearance: ------ Link1 Link2 Link3 Link4 ------- ------- Rollover Image to appear here ------- The problem that I have is that since the rollover image is positioned absolutely, if the size of the list of links changes (IE with sub-links in the list) it slides under or over where I have the rollover image placed. IE ------ Link1 sublink1 sublink2 Link2 Link3 Link4 ------- will break my scheme. Is there a way to get the span within the link to show up relative to the bottom of the <ul> element, or at the bottom of an element that contains the whole shebang? If I cant get this to work, I'm going to be forced to adopt the existing tables/javascript based template for our site, and I'd hate hate hate to do that. thanks. Using the following example: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Test</title> <style type="text/css"> a { display: block; } a.one.on, a:hover.one, a:hover.one.on { color: red; } a.two.on, a:hover.two, a:hover.two.on { color: orange; } a.three.on, a:hover.three, a:hover.three.on { color: green; } </style> </head> <body> <a href="#" class="one">one</a> <a href="#" class="two">two</a> <a href="#" class="three">three</a> <p> </p> <a href="#" class="one on">one</a> <a href="#" class="two on">two</a> <a href="#" class="three on">three</a> </body> </html> Notice how, in IE6 (works fine in FF), when the secondary style named 'on' is added, all 3 links in the 2nd set display the properties of the style: Code: a.three.on, a:hover.three, a:hover.three.on { color: green; } (since it is last in the list) rather than the style specified by their respective numbers (i.e. 'one', 'two' or 'three'). Is there a way to overcome this in IE. Can anyone explain the difference between the two? For example, what is the difference between: this: element element {} div p { } and this: element > element { } div > p { } I don't understand it and have not found an explanation in tireless searching. Thx! I want to change this: LIST-STYLE-TYPE: square; I want to show a picture in the place of that square. Can this be possible? I have been trying to work a lot with CSS3 to rotate, scale, etc. One effect I've been trying to figure out is how to stretch something. I could scale it along the y axis but that's not really stretching. A stretch would mean the top and bottom (or left and right) sides would curve inward. How can I distort an element in this fashion? This is hopefully a very easy question... I have a table which has 4 <td> elements to adhere to. My problem is that I want to put some text into the 3rd <td> which is wider than I want the <td> to be allowed. I know that there isn't any text it will overlap in the 2nd. Is there a command that will overextend the width to the left and fill there? Currently as is the text goes upward. Here is an image of my problem, any suggestions? *** Solved, All i needed was a Hi there, Need some CSS guru help. If you visit my link: http://www.gabbr.com/js/viewer/cmedata/index1.html and hover over the years (top middles, 2008, 2009, 2010, etc) you will notice an orange bar extending from the top to the bottom of the page. I am trying to get the same effect on the left (month and day) but am unable to do so. The problem I am having is that I cannot get the orange hover bar to extend off the left of the screen for either #dayleft or for #monthleft. It extends all the way to the right margin of the screen but not the left. The problem is the margin-left: 15px; in #monthleft and margin-left: 80px; in #dayleft. But I cannot get rid of these since I require them for the letter spacing. Any advice? Please look at this page - http://hometown.tmhdesign.com/ask.asp?faq=9 See how the <p> exceeds the containing box at the bottom? I put a border-bottom on the containing div to show you where the issue occurs. It does not happen in IE7 I just noticed it does it also on this page http://hometown.tmhdesign.com/staff.asp i cant seem to figure out how to center my div's in IE. they look fine in firefox and safari. what can i do? here is my stylesheet: <head> <style type="text/css"> body {background:grey url('lgrey048.jpg');} .layout{position: absolute; margin-left: auto; margin-right: auto; left: 0; right: 0; width: 646px; height: 800px; } .banner{position:absolute; top:0; left:0; height:251px; width:646px; border:1px solid black;} .links {position: absolute; top: 261px; left:0px; height: 47px; width: 646px; } .content {position: absolute; top: 318px; left:0px; height: 492px; width: 446px; background-color: white; border:1px solid black; } .sidebar {position: absolute; top: 318px; left:456px; height: 492px; width: 190px; background-color: white; border:1px solid black } img { border-style: none; } </style> </head> any suggestions? I have a website test2(dot)gigajobs(dot)com(dot)au And have a section where user can Jobseekers can login But I can't seem to format the Username and password , register as a jobs seeker and forgot password labels so it is aligned to margin-left:12px; I've tried everything I can think of and am tearinhg my hair out. css td.publish-label{width:200px; } td.publish-label a { color: ##2E8EE8; text-decoration: underline; } td.publish-label a:hover { color: #68AAE7; text-decoration: underline; } html <h2 class="widgettitle">{$translations.applicant_admin.login}</h2> <table border="0" cellspacing="2" cellpadding="2"> <tr> <td class="publish-label"> <a href="{$BASE_URL}applicant/register/">{$translations.applicant_admin.register_account}</a> </td> <br> </tr> <tr> <td class="publish-label">{$translations.applicant_admin.email_address}:<br /> <input {if $errors.username}class="error" {/if} tabindex="1" type="text" name="username" id="username" size="32" value="{$smarty.post.username}" /> <span class="validation-error">{if $errors.username}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span> </td> </tr> <tr> <td class="publish-label">{$translations.applicant_admin.password}:<br /> <input {if $errors.password}class="error" {/if} tabindex="2" type="password" name="password" id="password" size="32" value="" /> <span class="validation-error">{if $errors.password}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span> </td> </tr> <tr> <td class="publish-label"><a href="{$BASE_URL}applicant/forgot/">{$translations.applicant_admin.forgot_password}</a></td> </tr> <tr> i have strange problem with IE 8 where an element is incorrectly placed when i open an Iframe, but if the iFrame is closed and reopened the element in question is correctly placed. I don' know if this is a code problem or if it's an IE 8 issue?? i see i cannot post a url. any help without seeing the problem? Here is the code snippet from the iframe: Code: <div style="margin: 0px;" id="votes"> <ul style="margin: 0px;" id="xvotes-0" class="star-rating-noh"> <li id="xvote-0" style="width: 81.25px;" class="current-rating"></> <span id="mnmc-0"> <li class="one-star-noh"></li> <li class="two-stars-noh"></li> <li class="three-stars-noh"></li> <li class="four-stars-noh"></li> <li class="five-stars-noh"></li> </li> </ul> </div> I've been adding local styles to try and zero any potential problems. i can post all css styles if noone has any ideas. Any help would be much appreciated. Thanks. Hi, I am trying to get image on the bottom right hand side of the page to align with the chart in the middle. I have it floated to the right, but I can't seem to make it move up vertically. Not sure how to do this, absolute positioning is not an option because it will be stuck there regardless of browser size. this is where the img is now, see how it is not lined up? URL this is where it is supposed to go. URL my code is this Code: <div style="float:right; vertical-align:baseline;"><img src="/free-gold-charts/gold.png" alt="Free Interactive Gold Charts" width="320" height="290" align="top"/></div> and I have it next to the code for the chart. Help! Hello, I have a div element within a series of nested tables. the width of the cell that the div element is in is set to "45%". My div element has a CSS style of "overflow:auto;" meaning I want scrollbars to appear if the contents of the div are larger than the alotted space. For some reason, the scrollbars appear, however, My div element stretches and pushes other elements off of the screen. Is anyone aware of any bugs or something that could cause this? The thing that is really strange is that I only have this problem when the table within the DIV contains elements that have the nowrap attribute set to true. Thanks, Crystal Hi guys! I am tempted to use the list element (<ul>) for almost anything... is this good practice or should I proceed differently? For example: 1/ Horizontal menu of images that should be spaced by 10 px. I could do that this way: Code: <div id="topmenu"> <a href="dsf.php"><img... <a href="sdfs.php"><img... <a href="sdf.php"><img... <a href="sdf.php"><img... </div> and in the CSS file: Code: #topmenu { margin: 10px; } #topmenu a { margin-right: 10px; } OR I could do it this way with <ul>s: Code: <ul id="topmenu"> <li><a href="dsf.php"><img...</li> <li><a href="sdfs.php"><img...</li> <li><a href="sdf.php"><img...</li> <li><a href="sdf.php"><img...</li> </ul> and in the CSS file: Code: #topmenu { margin: 10px; list-style: none; } #topmenu li { margin-right: 10px; display: inline; } MOREOVER, for example when aligning 4 input boxes on the same line and spaced (exactly the same problem but the images replaced by inputs), should I proceed with the first or second method? MOREOVER, for example when aligning 4 text URLS on the same line and spaced (exactly the same problem but the images replaced by text URLs), should I proceed with the first or second method? It would be so nice to ALWAYS use the <ul> element with CSS but is this poor practice? Thank you is it possible to use two classes for one element. I want to use two classes for one element I thought perhaps it is possible not to create another class to combine both of them. perhaps there is a form of superclass and subclass in css. Hi; How i can display elements from left to right and the first element stat from the left of 20px, and the distance between each element is 20px. Could any one help me, please, thanks my code does not work for the distance between each element is 20px. PHP Code: <html> <head> <style type="text/css"> .number{ position: relative; left: 20px; float: left; } </style> </head> <body> <span class="number">1</span> <span class="number">2</span> <span class="number">3</span> <span class="number">4</span> </body> </html> |