Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: Are there any hack that will recognized only by IE and OPERA?  (Read 6451 times)

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 597
    • http://fedrick.deviantart.com

I need to fix something in FireFox... to be exact margin-left...
so heres the problem

I need margin-left: -30px; in FireFox
and margin-left: -9px; in Opera adn IE

is there any way to do that?
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

Luka

  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 36
  • Posts: 1717
    • http://www.snewscms.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #1 on: July 15, 2007, 10:41:12 pm »

According to my experience, it's most likely that your template will look fine in FF and Opera but the margin would be wrong in IE.

The quick way to fix this would be to load the stylesheet in and after that to put:
 

Code: [Select]
There are also other methods like !important.
Logged

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 597
    • http://fedrick.deviantart.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #2 on: July 15, 2007, 11:38:20 pm »

Yeahb I know about all those hacks from google,

but the problem is that  Opera and FF don't look same..

the good news is that I found some great Browser selector script that does the trick,

http://rafael.adm.br/css_browser_selector/
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

stjepan

  • Full Member
  • ***
  • Karma: 3
  • Posts: 136
Are there any hack that will recognized only by IE and OPERA?
« Reply #3 on: July 16, 2007, 07:51:03 pm »

Excuse me for asking, but why you need a browser selector?  Browsers do not follow the standard, we know that, however...  The -30 and -9 are very different numbers, where the difference comes from?  Second, there are saying like "if if works in Firefox, then it is closest to standard", so from pure curiosity I'd like to know the reason for conditional commands.

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 597
    • http://fedrick.deviantart.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #4 on: July 16, 2007, 11:35:40 pm »

hey Stjepan

Yeah I know it sounds strange :)  -9 <--> -30... it's not my fault :) the reason is very specific..

Here's the story :)

I was customizing  the type="file"> element. witch was really hard to do btw... so problem was that FireFox doesn't render that input correctly .  Width="1px" -  minimum size,  some how was ignored by FireFox  and was converted to 30 pxs... so the result was: IE shows 1px width input, Opera shows same like IE, but  FireFox shows input with width= 30 px...  so I needed some hack, that only FF would recognize(or only IE and Opera)...

p.s.
FireFox can't be the "coolest browser" inda world, cuz it doesn't even follow the standarts... even more it SUCKS IMHO.... Safari and I-Exp. are much more comfortable in that case.
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Are there any hack that will recognized only by IE and OPERA?
« Reply #5 on: July 17, 2007, 05:13:15 am »

If the CSS rule input[type='file'] { width: 1px; } doesn't work properly with Firefox (I think it should) -- do you have a global style for input, or perhaps a style for input set for the div that the input type="file" is in, that sets input width to 30px? That could be your answer. A simple way around it would be to give the file input an id, like
Quote
... ...
And then in your CSS, add
Quote
#filething {width: 1px !important;}
Haven't tested it so no guarantees, but in general terms it might be worth a try.

As for FF being cool or not -- who cares? It passes the Acid2 test, which means that it is standards compliant, like Safari and Opera 9. However, there are differences between the browsers, in rendering especially. The differences are marginal though and it most cases you will find that if your XHTML and/or CSS is correct, then your site will work more or less the same in all three browsers. Not exactly the same, but more or less the same. There will probably always be slight differences between competing products, how else are they going to compete? But the statement that FF "doesn't even follow standards" is de facto wrong. There is evidence of that.

Personally, I'll go for Safari first and Opera second any day, but that's me.
Logged

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 597
    • http://fedrick.deviantart.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #6 on: July 17, 2007, 06:04:52 am »

Smith :)

1. yes I have a global style for input with an ID.

I'm not new to css :D

Instead of posting that, just right down 2 lines  of code and test them in FF :D

here test mine in IE and FF or in Opera and FF.... I know you don't have IE:

Code: [Select]
<html>
<head>

</head>
<body>

<input type="file" style="width: 10px;" id="filefield" />

</body>
</html>
also
Code: [Select]
#filething {width: 1px !important;}<-- this is not working in FireFox :P 

so I think I have made a good choise...


p.s. I don't know what do you call "standarts", but when Browser is ignoring a "width" property.. it's already  a bug.. I don't know is it a visual bug, or a logic of FF's engine algorithm  or something else, but it's still a bug.
« Last Edit: March 25, 2008, 11:43:12 am by Patric Ahlqvist »
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Are there any hack that will recognized only by IE and OPERA?
« Reply #7 on: July 17, 2007, 09:25:58 am »

Quote from: 4sandrix
1. yes I have a global style for input with an ID.
"Global" style = input { blabla: yada yada yada; }
Style with ID = #somename (or more specific: input#somename) { blabla: yada yada yada; }
So which is it? In terms of specificity they're different.
Quote from: 4sandrix
I'm not new to css
I never said you are, never implied you are and didn't even think in those terms. However when the information that's given isn't detailed enough questions must be asked, plus I have no idea how far your css knowledge stretches -- that's kinda impossible for me to know as I am not you. Just a a fyi.

There's actually a simple reason why input="file" takes on different looks in various browsers: it seems that this particular input type (and possibly others, I'll gladly admit to not having tested them all) has a hardwired appearance in Firefox and Opera. Firefox is the most rigid of the two, in the sense that the browser-specific style overrides any user styles. You'll need to use a different input type to get styling to work in Firefox. The reason I didn't know this is because I've never had a reason to use this input type before - it's not on my list of most used elements. But I do know that some form controls are unavailable for user manipulation -- different controls in different browsers, naturally. This is one that seemingly can't be user manipulated in FF. Tough luck.

You're perhaps right in saying I should've tested the offered solutions in FF before offering them, even if you could've said it differently -- but I have actually tested them, and verified that they work, just not in the context of input type=file. 'cause I didn't have time to test your specific scenario. Now that I had a few moments to test it, I've learned something. Always nice to learn new stuff, right?

What I call standards? (yeah, like my voice ever counted for anything...) The web standards rules and guidelines defined by the Webbanet's governing body W3C. That's what.
If you think a browser (or other app) has a bug -- report it to the app's makers. I don't have any interest in it -- I use Safari. Personally I don't think it's a bug per se, more a detail that the Mozilla crowd thought was better to not allow indivdual styling on. Bad choice? Perhaps. But their choice.
Logged

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #8 on: July 17, 2007, 10:30:18 am »

You could code it for FF in the stylesheet, and then adjust it for IE (6), IE7 and Opera...

If you code it for FF, there are browser specific hacks to use for the other major one's... Say you have a H1 tag coded like this for FF:
Quote
h1{margin:1em 0;color:terrific;font-weight:wonderful;}
But this shows up differently in IE browsers and Opera, marginwise, then you can adjust this by adding:
Quote
hackthingy - followed by the styledeclaration you need to change
For IE 6:
Quote
* html h1{margin:14em 0;}
For IE 7:
Quote
*:first-child+html h1{margin:99em 0;}
For Opera:
Quote
html:first-child h1{margin:207em 0;}
Now, I haven't read through all of your posts above as I'm in a hurry, but you asked for "hacks" recognized only by IE and Opera, and there they are...

My own meny on p-ahlqvist.com was misplaced in all browsers except FF, so I did this, and I sorted it out, now I'm not all sure about IE7 since I had to style that through a third person, heheh... He looked at the site in IE7 and I styled it, so there could possibly be some off in margin-top, but it do work.
Logged
"It's only dead fish that goes with the flow... "
Updated

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 597
    • http://fedrick.deviantart.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #9 on: July 17, 2007, 10:37:02 am »

Quote
"Global" style = input { blabla: yada yada yada; }
Style with ID = #somename (or more specific: input#somename) { blabla: yada yada yada; }
So which is it? In terms of specificity they're different.
tried both, but infact there's no differense in this case for my "scenario". first one works for all input tags and other one with one element with unique ID... nothing special they both wont work,

Ok Smith but now I don't understand the point of your post :D I fixed problem right? :D I was right about FF right? :D I said that it has different rendereing feature for that input right? :D It can't be done with a pure CSS or any or hucks beside that JS that I used, and witch by the way returns a sctrict css as a result :P so? :D

Patric thanks I was searching the hack for Opera, but that one doesn't work in Opera 9 :(
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

stjepan

  • Full Member
  • ***
  • Karma: 3
  • Posts: 136
Are there any hack that will recognized only by IE and OPERA?
« Reply #10 on: July 17, 2007, 01:15:54 pm »

@4Sandrix: OK, I understand.

BTW, that bug is unfortunately known: https://bugzilla.mozilla.org/show_bug.cgi?id=52500

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #11 on: July 17, 2007, 01:46:48 pm »

Mhm, it should work with Opera 9. It is said to work with Opera 9 and below, but you've tried it, so...

 "the selector first-child relies on a bug, so it may be fixed in a future version of Opera " is what I read when searching for this issue, but as you still encounters problems I guess that's not the case...
Logged
"It's only dead fish that goes with the flow... "
Updated

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • I'm a self-made man and worships my creator.
    • p-ahlqvist.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #12 on: July 17, 2007, 02:03:43 pm »

More hacks to try that is said to work with Opera:

*|html selector { color:pink; } /* FF, Opera, Konqueror, Safari */
html>/**/ selector {color:pink;} /* Modern browsers only (not IE 7) */
Logged
"It's only dead fish that goes with the flow... "
Updated

4Sandrix

  • Hero Member
  • *****
  • Karma: -13
  • Posts: 597
    • http://fedrick.deviantart.com
Are there any hack that will recognized only by IE and OPERA?
« Reply #13 on: July 17, 2007, 04:03:43 pm »

Quote from: stjepan
@4Sandrix: OK, I understand.

BTW, that bug is unfortunately known: https://bugzilla.mozilla.org/show_bug.cgi?id=52500
Yeah CRAP! :(

Quote from: Patric
More hacks to try that is said to work with Opera:

*|html selector { color:pink; } /* FF, Opera, Konqueror, Safari */
html>/**/ selector {color:pink;} /* Modern browsers only (not IE 7) */
this works but it will be recognized by FF also... so FF will get the same value as Opera.. I need some hack that only works for Opera, or Only for FF.
Logged
I'm kind of like Han Solo always strokin' my own Wookiee
I'm the root of all that's evil yeah but you can call me Cookie

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Are there any hack that will recognized only by IE and OPERA?
« Reply #14 on: July 17, 2007, 05:04:25 pm »

My CSS knowledge is not really great but... from my experience... the best way to deal with cross-browser compatability is by getting your layout displaying fairly well in Firefox and Opera... then apply the hacks to get IE up to par with them... not the other way around. This is because browser hacks are generally developed to bring IE up to par with the other browsers.  ;)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: [1] 2