Author | Message | Time |
---|---|---|
peofeoknight | I dug this up the other day, its called owen's hack. I had some problems with some image positioning on ie5 and 6 on a new css layout I was making, while it worked fine in opera and mozilla. But this thing has been my savior. This is not like the ie5 box model hack though, this sends a different value to ie6 too. [code] img.test { /* ie can see this */ position:relative; top:-30px; left:-7px; } head:first-child+body img.test { /* ie cant see this, ns can */ position:relative; top:-30px; left:-10px; }[/code] | December 20, 2003, 11:12 PM |
AssassinRC | I'm curious how it works, and if possible can I see an example anywhere of it's usage? | December 21, 2003, 1:37 AM |
peofeoknight | On this new layout I am working on http://quasi-ke.servebeer.com/layout/index.html here is the css http://quasi-ke.servebeer.com/layout/layout.css it works like a charm | December 21, 2003, 3:40 AM |
Skywing | What's the practical application of this? Nearly all browsers identify themselves to the server before it sends a page, anyway, so assuming you aren't using horribly crippled server software you should be able to make a decision about the page's content based on the user's browser from there. | December 21, 2003, 7:14 PM |
Grok | He thinks by him working for many extra hours to design a page which IE users cannot properly view, that he singlehandedly will cause all IE users to switch to Mozilla or Netscape. Microsoft is afeared. | December 21, 2003, 7:19 PM |
peofeoknight | [quote author=Grok link=board=22;threadid=4371;start=0#msg36630 date=1072034397] He thinks by him working for many extra hours to design a page which IE users cannot properly view, that he singlehandedly will cause all IE users to switch to Mozilla or Netscape. Microsoft is afeared. [/quote]wtf are you talking about, that is not it at all. That makes a site accessable to ie, which would not be accessable before this hack because of ies crappy box model. I design a page with a css layout and this sends another value to ie, which screws up on the one I send to other browsers. IE reads css so badly that to try and make a site work on ie would mean it would not work on any other browser, mainly ns based browsers and opera. By using this I can design a page that works on ns based browsers and opera, then send another value to ie which will make the page display properly on all of them. Go the link next time would you and compare on multible browsers and see that it works before you make some comment that is very far from accurate. http://quasi-ke.servebeer.com/layout/index.html view it on ns or mozila, then ie, then ie5.5. You obvisously did not read my posts. I go for accessability. Also doing a browser detect before hand and it would mean me making 5 different pages instead of just dropping in one hack which makes this accessable to all. Just because I use css and hate ie does not make me anti ms either. I would not use mssql server, asp.net, and many other wonderful ms products if I were anti ms. I just cant stand ie and frontpage. But because I dislike how ie supports css (and objects, and xhtml) does not mean that I would make a site inaccessable to 90% of the internet. | December 22, 2003, 7:11 AM |
Skywing | [quote author=peofeoknight link=board=22;threadid=4371;start=0#msg36693 date=1072077072] [quote author=Grok link=board=22;threadid=4371;start=0#msg36630 date=1072034397] He thinks by him working for many extra hours to design a page which IE users cannot properly view, that he singlehandedly will cause all IE users to switch to Mozilla or Netscape. Microsoft is afeared. [/quote]wtf are you talking about, that is not it at all. That makes a site accessable to ie, which would not be accessable before this hack because of ies crappy box model. I design a page with a css layout and this sends another value to ie, which screws up on the one I send to other browsers. IE reads css so badly that to try and make a site work on ie would mean it would not work on any other browser, mainly ns based browsers and opera. By using this I can design a page that works on ns based browsers and opera, then send another value to ie which will make the page display properly on all of them. Go the link next time would you and compare on multible browsers and see that it works because you make some comment that is very far from accurate. http://quasi-ke.servebeer.com/layout/index.html view it on ns or mozila, then ie, then ie5.5. You obvisously did not read my posts. I go for accessability. Also doing a browser detect before hand and it would mean me making 5 different pages instead of just dropping in one hack which makes this accessable to all. [/quote] I think that a better design would be to create a "global" CSS file and a set of browser-specific CSS files. Include both the global file in your page, and include a reference to some script or other serverside mechanism that you can use to make a redirection based on the browser's indicated User-Agent. e.g. global.css and cssredir.cgi, which would send you to ie5.css, ie6.css, ns7.css, and so on based on your browser version. Your current method relies on guessing the user's browser version based on undocumented behavior - doing a proper selection based on User-Agent eliminates that uncertainty and provides a guaranteed consistant mechanism to customize your site based on the browser a user connects with. | December 22, 2003, 7:23 AM |
peofeoknight | It is not undocumented behavior, by any means. It is very well doccumented. I have been using css for a long time now and I know what I am doing. It is faster and better to use a hack then to realy on a browser detect and using 5 or 6 different files. Also what if the user agent is not ie or mozilla? You have a misc category? I would rather the page just break down like it is supposed to into a text based form when a browser like lynx or ie2 comes along that cannot support css or inline data at that. Doing css properly so that all of the major browsers can read it, even if it requires hacking for ie is a more desireable solution because in the end it is less work. | December 22, 2003, 7:26 AM |
Skywing | [quote author=peofeoknight link=board=22;threadid=4371;start=0#msg36695 date=1072077976] It is not undocumented behavior, by any means. It is very well doccumented. I have been using css for a long time now and I know what I am doing. It is faster and better to use a hack then to realy on a browser detect and using 5 or 6 different files. Also what if the user agent is not ie or mozilla? You have a misc category? I would rather the page just break down like it is supposed to into a text based form when a browser like lynx or ie2 comes along that cannot support css or inline data at that. [/quote] It's not documented by the vendor, i.e. the entity that could change that behavior and break your site. Besides, you're relying on every other browser in existance also (mis?)behaving certain ways based on your attempt to exploit a quirk in a particular version of a particular browser program. I certainly wouldn't use such an unstable method for a mission-critical site. I don't see how my method is any different than yours re: support of browsers that ignore css. | December 22, 2003, 7:28 AM |
peofeoknight | But your method would only work for 3 or 4 browsers unless you write miles of code for every browser and every platform then for every setting. Doing it flat like this allows for it to break down. It is very well doccumented by many places. If you think that ie and ns are the only powers on the internet you would be sadly mistaken, what about the w3. Certainly they have some clout and certainly they document things like this. MS has realized that they support css, and the object tags poorly. IE 7 claims to read css much more like ns and scripts about the same, opera ish, if that is the case then I will have no problems because all browsers get one value... then ie and some other noncomplient browser will get another. But the content is accessable for all browser this way. | December 22, 2003, 7:30 AM |
Skywing | [quote author=peofeoknight link=board=22;threadid=4371;start=0#msg36697 date=1072078247] But your method would only work for 3 or 4 browsers unless you write miles of code for every browser and every platform then for every setting. Doing it flat like this allows for it to break down. It is very well doccumented by many places. If you think that ie and ns are the only powers on the internet you would be sadly mistaken, what about the w3. Certainly they have some clout and certainly they document things like this. [/quote] No, it wouldn't require much code. You would do something like this... [code] if(Browser == IE5) sendfile("ie5.css"); else if(Browser == IE6) sendfile("ie6.css"); else if(Browser == NS7) sendfile("ns7.css"); else if(Browser == Opera) sendfile("opera.css"); else sendfile("standard.css"); /* assume that it's a standards-compliant browser that can correctly parse standards-compliant CSS */ [/code] However, I don't think you should be needing all that much browser-specific CSS if you follow standards. In any case, simply changing a few dimensions to work around a minor browser issue isn't exactly "miles and miles of code". | December 22, 2003, 7:34 AM |
peofeoknight | Hey you stick with server side if you want. But its not my thing. I chose this method for a reason and posted this hopeing it would help someone else out. But what grok said earlier could not be further from the truth and I was just trying to make that clear. Browser hacks, aka filters, are designed with accessability in mind, not inaccessability. This is not the only hack out there for ie, I can get you a nice chart, it is a lot less work in the long run to do simple hacks for ie and send the other code to the other browsers then useing the user agent. IF I FOLLOW THE STANDARDS, VIEW MY FREAKEN VALIDATION. http://jigsaw.w3.org/css-validator/validator?profile=css2&warning=2&uri=http%3A//www.quasi-ke.servebeer.com/layout/index.html http://validator.w3.org/check?verbose=1&uri=http%3A//www.quasi-ke.servebeer.com/layout/index.html http://www.contentquality.com/mynewtester/cynthia.exe?rptmode=-1&runcr=1&url1=http%3A//www.quasi-ke.servebeer.com/layout/index.html | December 22, 2003, 7:36 AM |
Skywing | Here's what I get when I try to validate your page: [quote]Character Encoding mismatch! The character encoding specified in the HTTP header (utf-8) is different from the value in the <meta> element (iso-8859-1). I will use the value from the HTTP header (utf-8) for this validation. This page is not Valid HTML 4.01 Transitional! Below are the results of attempting to parse this document with an SGML parser. Line 6, column 6: end tag for element "HEAD" which is not open (explain...). </head> ^ Line 7, column 88: document type does not allow element "BODY" here (explain...). ...2px ms sans serif, arial, helvetica;"> ^ Line 17, column 59: value of attribute "ID" invalid <form name="_ctl0" method="post" action="Default.aspx" id="_ctl0"> ^ Line 30, column 139: there is no attribute "LANGUAGE" (explain...). ...') Page_ClientValidate(); " language="javascript" id="butOK" Type="Submit" st ^ Line 30, column 168: duplicate specification of attribute "TYPE" (explain...). ...anguage="javascript" id="butOK" Type="Submit" style="border:1px solid #008ACA ^ Line 35, column 107: end tag for element "A" which is not open (explain...). ...ums.aspx">My clan's forums</a> :: </a><a href="http://www.clanknights.vze.com ^ Line 37, column 5: end tag for "FORM" omitted, but its declaration does not permit this (explain...). </div> ^ Line 17, column 0: start tag was here (explain...). <form name="_ctl0" method="post" action="Default.aspx" id="_ctl0"> ^ Line 63, column 6: end tag for element "FORM" which is not open (explain...). </form> [/quote] The CSS validated with two warnings. Since it looks like you're already using server-side scripting, you might as well implement a concrete solution instead of trying to take advantage of browser (mis)behaviors to detect browser versions. If you're using <link rel...> to import a css clientside, then it should be much simpler and much more maintainable to reference some .aspx which uses the User-Agent information to send the user to the right stylesheet. No potentially incompatible hacks involved, and not exactly a huge time investment either. | December 22, 2003, 7:41 AM |
peofeoknight | because thats the wrong url. Thats the little page http://quasi-ke.servebeer.com that I made in 5 minuits as a default file for my root dir. Look at the links I posted, they are to http://quasi-le.servebeer.com/layout/index.html Do not count on me running a server side detection. I have mentioned already I chose this method, and I think doing it server side is the improper way to do it in this case because you have to take into account many more browsers and platforms then just the big 2 or 3, ie mac will run different from ie windows, 5,5.5,6,opera,ns, and so on, and why have 2 css files, when you only have 2 values to change and run an extra script. The hacks are not incompadable, they are taylored this will go to incompliant browsers, which is ie in this case, this will go to compliant. It is a simple madder of being able to read css. | December 22, 2003, 7:43 AM |
Skywing | [quote author=peofeoknight link=board=22;threadid=4371;start=0#msg36701 date=1072078993] because thats the wrong url. Thats the little page http://quasi-ke.servebeer.com that I made in 5 minuits as a default file for my root dir. Look at the links I posted, they are to http://quasi-le.servebeer.com/layout/index.html Do not count on me running a server side detection. I have mentioned already I chose this method, and I think doing it server side is the improper way to do it in this case because you have to take into account many more browsers then just the big 2 or 3, and why have 2 css files, when you only have 2 values to change and run an extra script. [/quote] If you have only one or two things to change between different browser versions, it would probably be more maintainable to split it into two files - a general one that is compatible with all of your target browsers, and then browser-specific stylesheets that provide whatever fixups are necessary to address specific problems with certain target browsers. | December 22, 2003, 7:47 AM |
peofeoknight | Look how many hacks I have... 3. They are only for ie 5 and 6. Split it into multible files and run another script? That would waste more bandiwidth and be more stuff to keep track of. Keeping 9 extra lines of code in a css file is more efficient I think. I posted a working solution the the ie6 - 5 css deficiency, but you keep saying it is inefficient. These hacks are very widely used, I am not alone, I am not the one who came up with this. They are well documented. I will post you several links if you would like. You detect script would also have to be fired on every page, even if you set a session variable because you have to get that data on every page and what if the user does not go to that page. The css only needs to be downloaded one time, and the server does not do a thing with it after that. | December 22, 2003, 7:50 AM |
Skywing | [quote author=peofeoknight link=board=22;threadid=4371;start=15#msg36703 date=1072079446] Look how many hacks I have... 3. They are only for ie 5 and 6. Split it into multible files and run another script? That would waste more bandiwidth and be more stuff to keep track of. Keeping 9 extra lines of code in a css file is more efficient I think. I posted a working solution the the ie6 - 5 css deficiency, but you keep saying it is inefficient. These hacks are very widely used, I am not alone, I am not the one who came up with this. They are well documented. I will post you several links if you would like. [/quote] I did not say it was inefficient. I said it was undocumented, unreliable, and subject to change without notice. A website should have future compatibility as well as backwards compatibility. The CSS wouldn't necessarily have to be downloaded more than once with a browser-detection mechanism; consider a server-side detection mechanism that sent a Not-Modified reply when the client's cache was current. | December 22, 2003, 7:53 AM |
peofeoknight | the only change would help me because the next version or ie is said to have a complient box model. It is very well documented, I have told you time and again that these are widely used and very well tested. I have tested it on ie 5.5 5 and 6 myself. I run all three from this comp. (you have to delete a dll to do that, I know you cant do that normally). I did not say css would need to be download mroe then one time. The detect script would have to be executed on page load of every page, strain on the server. When its on every page, well it would not be that big of a deal genorally right? It gets to be noticable on high traffic sites. | December 22, 2003, 7:56 AM |
kamakazie | [quote author=peofeoknight link=board=22;threadid=4371;start=15#msg36703 date=1072079446] Look how many hacks I have... 3. They are only for ie 5 and 6. Split it into multible files and run another script? That would waste more bandiwidth and be more stuff to keep track of. Keeping 9 extra lines of code in a css file is more efficient I think. I posted a working solution the the ie6 - 5 css deficiency, but you keep saying it is inefficient. These hacks are very widely used, I am not alone, I am not the one who came up with this. They are well documented. I will post you several links if you would like. [/quote] Actually it would probably save bandwidth if you implement it correctly server-side. As a side note, modularization is a good thing, even the W3C recommends it; and in general it is good practice. | December 22, 2003, 7:57 AM |
Skywing | [quote author=peofeoknight link=board=22;threadid=4371;start=15#msg36708 date=1072079764] the only change would help me because the next version or ie is said to have a complient box model. It is very well documented, I have told you time and again that these are widely used and very well tested. I have tested it on ie 5.5 5 and 6 myself. I run all three from this comp. (you have to delete a dll to do that, I know you cant do that normally) [/quote] So, you can provided me a reference to vendor-supplied documentation that describes this behavior and explains exactly which versions support it? Third-party documentation hardly provides a guarantee as to whether a behavior will be supported by future versions. | December 22, 2003, 7:58 AM |
peofeoknight | lol. Yea ms is going to say that their browser sucks. Download ie6 v2 if you want proof that they are trying to change their box model. | December 22, 2003, 8:00 AM |
peofeoknight | [quote author=kamakazie link=board=22;threadid=4371;start=15#msg36709 date=1072079858] Actually it would probably save bandwidth if you implement it correctly server-side. As a side note, modularization is a good thing, even the W3C recommends it; and in general it is good practice. [/quote]But it still strains the server to run this on every page, if I had more values to change, like say all of them, yes I would not use a hack. But for a few different values due to a crappy box model then a hack is a better solution in my eyes. | December 22, 2003, 8:01 AM |
peofeoknight | http://support.microsoft.com/default.aspx?scid=kb;en-us;825057 did not think they would have anything like this online lol. They go on to talk about http and encryption but that seems to have nothing to do with the style sheet, it would not read the thing anyway the chances are. | December 22, 2003, 8:04 AM |
Skywing | [quote author=peofeoknight link=board=22;threadid=4371;start=15#msg36715 date=1072080263] http://support.microsoft.com/default.aspx?scid=kb;en-us;825057 did not think they would have anything like this online lol. [/quote] That only applies if you're compressing the .css and using HTTPS - which does not seem to be the case for your site. | December 22, 2003, 8:06 AM |
peofeoknight | ie6 doesnt read it properly anyway though. The work arounds are so that the site will load. | December 22, 2003, 8:08 AM |
peofeoknight | Ok, IE handles css like crap. Do you understand that or do you need proof of that? These hacks work, Infact I can take them out and provide an alternate page for you if you do not believe me. MS is not going to put a bunch of stuff saying, "our browser sucks, here is how to work around it", on their website. Honestly. So what do you need proof about? There is loads of data on these hacks and their reliability. I posted it thinking others here might get some use out of it but you guys must all be stuck in a table based mind set ::) | December 22, 2003, 8:10 AM |
Skywing | [quote author=peofeoknight link=board=22;threadid=4371;start=15#msg36720 date=1072080651] Ok, IE handles css like crap. Do you understand that or do you need proof of that? These hacks work, Infact I can take them out and provide an alternate page for you if you do not believe me. MS is not going to put a bunch of stuff saying, "our browser sucks, here is how to work around it", on their website. Honestly. So what do you need proof about? There is loads of data on these hacks and their reliability. I posted it thinking others here might get some use out of it but you guys must all be stuck in a table based mind set ::) [/quote] You're missing the point - I'm trying to say that it's probably not wise to rely on specific browsers incorrectly parsing things if you want to remain compatible with future versions - especially if the vendor doesn't even document the problem. | December 22, 2003, 8:14 AM |
peofeoknight | Let me explain the flow of this hack and the other hacks. They filter incomplaint browsers, it is not specific to one but rather all that do not comply. The first value is sent. Then the hack is sent with a second behind it. The incompliant browser will see nothing after the hack while the compliant will and the first is overwritten by the new one on the complaint browsers. if ie becomes compliant then it is reading my code right then it seeing the second part and over writing the first is of no loss. This is not something I or anyone else just came up with, and though it is not on the ms website, besides ie6 v2 and the docs with it, ms is going to change the way they handle objects css and xhtml, because they are making steps to it in this vers of ie, v2. It is not going to get any worse then it is not so it no big deal http://msdn.microsoft.com/workshop/author/dhtml/overview/compat.asp ie 5.5 is still widely used. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndude/html/dude03262001.asp that has info about future standards | December 22, 2003, 8:20 AM |
peofeoknight | I think this thread is about done. I aggree with you if your layout needs to be radically different for another brower then do it server side but I have been uing hacks for a while, I have a list of sites I go to to read up on them and the browser specs, I have support charts. This is the most efficient way to do thing for minor adjustments In my opinion. Even if something did not work properly, some hideous monster escaped from the zoo and made the next version of ie into lynx, my site would still work, and the content is still acessable (I have tested my site on an actualy copy of lynx I have on this comp) I posted all the stuff I care to at this time. Have a nice night. | December 22, 2003, 8:31 AM |
j0k3r | [quote author=Skywing link=board=22;threadid=4371;start=0#msg36702 date=1072079265] [quote author=peofeoknight link=board=22;threadid=4371;start=0#msg36701 date=1072078993] because thats the wrong url. Thats the little page http://quasi-ke.servebeer.com that I made in 5 minuits as a default file for my root dir. Look at the links I posted, they are to http://quasi-le.servebeer.com/layout/index.html Do not count on me running a server side detection. I have mentioned already I chose this method, and I think doing it server side is the improper way to do it in this case because you have to take into account many more browsers then just the big 2 or 3, and why have 2 css files, when you only have 2 values to change and run an extra script. [/quote] If you have only one or two things to change between different browser versions, it would probably be more maintainable to split it into two files - a general one that is compatible with all of your target browsers, and then browser-specific stylesheets that provide whatever fixups are necessary to address specific problems with certain target browsers. [/quote] Skywing is right on this, if you're only working with 2 situations then it would probably be better to have 2 different pages, especially when approximately 90% of internet users are using IE (about 90% of those using 6.0+). http://www.dreamink.com/design5.shtml Shows that last year, 91% of the world used IE 5.xx or above, I'd wager most of those people are running 6.0 by now. Instead of using a hack for one situation which accounts for 90% of the net, loading one specific page might be better. Details from: http://www.google.ca/search?q=internet+explorer+vs+netscape+browser+statistic&ie=UTF-8&oe=UTF-8&hl=en&btnG=Google+Search&meta= | December 22, 2003, 12:47 PM |
Grok | [quote author=peofeoknight link=board=22;threadid=4371;start=15#msg36723 date=1072081900] I think this thread is about done.[/quote] Well, considering 16 of the 30 first messages are your own, including a string of 5 out of 6 replies in a row, you've hopefully said your opinion. Now what's wrong with letting other people talk about it if they want? | December 22, 2003, 1:41 PM |
peofeoknight | pffft. I am just trying to explain why someone would use a hack over a detect. There only 3 values the need to be sent to ie that are different from other browsers. Why add code to every page to do a detect when you can add a few lines to the css. | December 22, 2003, 3:18 PM |
kamakazie | [quote author=peofeoknight link=board=22;threadid=4371;start=30#msg36741 date=1072106318] pffft. I am just trying to explain why someone would use a hack over a detect. There only 3 values the need to be sent to ie that are different from other browsers. Why add code to every page to do a detect when you can add a few lines to the css. [/quote] Yes and if you setup your website correctly, then it wouldn't be so much of a problem to "add code to every page." If you're so concerned with bandwidth (which you seem to be, as it was one of your arguments) then sending those extra how-many-ever bytes of hacked css code is wasted on non-IE clients. Checking the type of browser the user is using is hardly a strain on the server, especially since your hack is tailored towards one specific browser. | December 22, 2003, 4:58 PM |
St0rm.iD | Not to mention that you can have the browser select the right one for you. | December 22, 2003, 8:25 PM |
peofeoknight | [quote author=St0rm.iD link=board=22;threadid=4371;start=30#msg36801 date=1072124704] Not to mention that you can have the browser select the right one for you. [/quote]What? That was what I am doing with this hack. Plus it is more of a strain to run code on top of every page then to send some extra lines out one time tha twill work on all secondary pages. Then there is the fact that that is just more code on every page. I will be includeing the whole layout and then importing the java script and css, so I only have a tiny bit of code on each page to deal with to keep organized. If you guys want to just keep argueing jus tot argue thats fine, but I am done, this is getting repetative. These hacks work, I have been using css hacks for a while and am very satisfied witht their results. Also If you would bother to validate my pages and look at my reports and the links I would post you guys would see that my pages are valid and very accessable, I resent comments that they are not. If I did not care about other browsers and validation why would I post things to accomplish this in the first place. I posted this thinking that someone else could benefit from this but it seems like you guys are too stuck inside of a table based mind set to see a css solution. Oh well, I have said things over and over and I just do not want to say it again. | December 22, 2003, 9:07 PM |
kamakazie | [quote author=peofeoknight link=board=22;threadid=4371;start=30#msg36804 date=1072127226] [quote author=St0rm.iD link=board=22;threadid=4371;start=30#msg36801 date=1072124704] Not to mention that you can have the browser select the right one for you. [/quote]What? That was what I am doing with this hack. Plus it is more of a strain to run code on top of every page then to send some extra lines out one time tha twill work on all secondary pages. Then there is the fact that that is just more code on every page. I will be includeing the whole layout and then importing the java script and css, so I only have a tiny bit of code on each page to deal with to keep organized. If you guys want to just keep argueing jus tot argue thats fine, but I am done, this is getting repetative. These hacks work, I have been using css hacks for a while and am very satisfied witht their results. Also If you would bother to validate my pages and look at my reports and the links I would post you guys would see that my pages are valid and very accessable, I resent comments that they are not. If I did not care about other browsers and validation why would I post things to accomplish this in the first place. I posted this thinking that someone else could benefit from this but it seems like you guys are too stuck inside of a table based mind set to see a css solution. Oh well, I have said things over and over and I just do not want to say it again. [/quote] I am hardly "stuck inside of a table based mind set." I just have a problem with "hacks" to make things work when there are standard ways. | December 23, 2003, 2:27 AM |
peofeoknight | well watever method floats your boat then. | December 23, 2003, 5:35 AM |
Grok | I fixed the title for you. | December 23, 2003, 12:30 PM |
peofeoknight | lol... well this thread got rly repetative and everything has been said so i think its about dead. | December 23, 2003, 6:54 PM |