Pavlos1316 Posted September 8, 2011 Share Posted September 8, 2011 Hello, I just assembly a form and for styling it I am using CSS in an external file. Problem is that IE8 and I don't know about 7 (in IE9 is ok) it doesn't show the styling inside the form... My structure is something like this: (in any other situation my css styling is displayed normally) <form> <span class="myclass"> </span> </form> Is there any fix for it? Thank you Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/ Share on other sites More sharing options...
joel24 Posted September 8, 2011 Share Posted September 8, 2011 what have you written in your css? .myclass input { #style the input elements } Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/#findComment-1266715 Share on other sites More sharing options...
Pavlos1316 Posted September 8, 2011 Author Share Posted September 8, 2011 e.g. css: .txt { color: #f0f; } and form: <form> <span class="txt"> Name <input /> </span> </form> My "Name" is not getting the css style=txt Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/#findComment-1266718 Share on other sites More sharing options...
joel24 Posted September 8, 2011 Share Posted September 8, 2011 working fine in IE8 for me, test.css .txt { color: #f0f; } test.htm <html> <head> <link rel="stylesheet" type="text/css" href="test.css" /> </head> <body> test <form> <span class="txt"> Name <input /> </span> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/#findComment-1266747 Share on other sites More sharing options...
Pavlos1316 Posted September 8, 2011 Author Share Posted September 8, 2011 I cannot understand... All my other pages are working... Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/#findComment-1266748 Share on other sites More sharing options...
joel24 Posted September 8, 2011 Share Posted September 8, 2011 post your entire code, this should be in the CSS help section... Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/#findComment-1266755 Share on other sites More sharing options...
Pavlos1316 Posted September 8, 2011 Author Share Posted September 8, 2011 I will do it later... Where I am now the firewall doesn't give me access to my server... Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/#findComment-1266764 Share on other sites More sharing options...
voip03 Posted September 8, 2011 Share Posted September 8, 2011 Target IE versions with CSS "Hacks" More to your point, here are the hacks that let you target IE versions. Use “\9" to target IE8 and below Use “*" to target IE7 and below Use “_" to target IE6. body { border:1px solid red; /* standard */ border:1px solid blue\9; /* IE8 and below */ *border:1px solid orange; /* IE7 and below */ _border:1px solid blue; /* IE6 */ } Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/#findComment-1266765 Share on other sites More sharing options...
voip03 Posted September 8, 2011 Share Posted September 8, 2011 Target IE versions without hacks using HTML and CSS If you don't want hacks in your CSS. Add a browser-unique class to the <html> element so you can select based on browser later. <!doctype html> <!--[if IE]><![endif]--> <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]--> <head></head> <body></body> </html> In CSS .ie6 body { border:1px solid red; } .ie7 body { border:1px solid blue; } Quote Link to comment https://forums.phpfreaks.com/topic/246684-forms-css-ie8/#findComment-1266767 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.