Forum Moderators: open

Message Too Old, No Replies

is it possible to add a few lines in html and/or css for one browser

because IE has some errors

         

essiw

12:54 pm on Oct 19, 2008 (gmt 0)

10+ Year Member



i have an error in IE (see this topic: [webmasterworld.com...] )
and i thought maybe it is possible without changing the code, but just to add some lines only for Internet explorer, how do i do this and is this even possible? (lines in html and css)

poppyrich

1:49 pm on Oct 19, 2008 (gmt 0)

10+ Year Member



Use an Internet Explorer conditional comment. Put your IE-specific stuff inside the comment and only IE will "see" it.
Looks like this:
<!--[if IE]>
stuff you only want to show up in IE, here.
<![endif]-->

You can also define conditional comments to work with specific versions of IE.
A search will bring up plenty of information. They are very commonly used.

g1smd

2:37 pm on Oct 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I would make sure that the additional "IE-only" stuff is in an include file, so that that it is easy to take it out again... you just need to edit the single include file, not hundreds of pages of site.

essiw

3:01 pm on Oct 19, 2008 (gmt 0)

10+ Year Member



g1smd, how do I do that exactly? i hope it is possible whit html or css

g1smd

3:13 pm on Oct 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Does your hosting have PHP available?

In the .htaccess:

AddType application/x-httpd-php .html .htm

In the .html file:

<?php include('/includes/somefile.php'); ?>

All your filenames and URLs stay as .html and nothing else changes within your site.

essiw

7:02 pm on Oct 19, 2008 (gmt 0)

10+ Year Member



don't know what .htacces file is, haven't learnt php and it is not my server where i am making the site for, and it is just a smile line only whit </div><div class="internet explorer"> in it btw it worked (i putted a [IF lt IE8] in it because IE8 worked well) and ended the <div> and did begin a new <div> whit another background image which was 5px larger and that did the trick. thanks ;)