Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 03-11-2010, 02:59 PM   #1
Platinum Member
 
anna's Avatar
 
Join Date: Jul 2009
Location: Michigan
Posts: 501
Default how do i write an IE hack?

I need to change the placement of an element on my page specifically for IE. How do I write a rule that will target just IE's placement of this element?

For instance:
Here is the code for FF

.sepsci {
font-family: Arial, Helvetica, sans-serif;
font-style: italic;
font-weight: bold;
color: #7f7f7f;
position: absolute;
left: 647px;
top: 105px;
}

I need to move the left value 10 px to 657px instead of 647px for IE. How do I write this rule? Thank you for any help!
anna is offline   Reply With Quote


Old 03-11-2010, 03:28 PM   #2
Super Moderator
 
Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,050
Default

The code for a conditional statement in IE is written like this:

HTML Code:
<!--[if condition]>  HTML <![endif]-->
Pretty much saying, "if this is IE, add this html markup, otherwise add nothing."
__________________
John Darling
Graphic / Web Designer
SmarterTools Inc.
(877) 357-6278
www.smartertools.com
PixelPusher is offline   Reply With Quote
Old 03-11-2010, 04:19 PM   #3
Platinum Member
 
anna's Avatar
 
Join Date: Jul 2009
Location: Michigan
Posts: 501
Default

Thanks Pixel! I googled it too, (gotta love google) and finally got it to work!

It is surprisingly easy!! Whoo hoo My pages look right in different browsers!
anna is offline   Reply With Quote
Old 03-11-2010, 11:02 PM   #4
Bronze Member
 
Join Date: Jul 2008
Location: Illinois
Posts: 85
Default

I also like CSS hacks, mainly for that damn IE6. Simple use an underscore before the property. For example:

#box {
padding: 10px;
_padding: 6px;
}
__________________
Darren Fox
Small Business Web Design
darrenfox is offline   Reply With Quote
Old 03-12-2010, 12:08 PM   #5
New Member
 
Join Date: Feb 2010
Posts: 3
Default

When I have some CSS that just won't work in IE, I see if adding a ZOOM property of 1 (one) will help:

Launch code in new window » Download code as text file »

* div {
* zoom: 1 ;
* }

I have to say, 90% of the time, this fixes the display issues that I am having in IE... and, it does so without adversely affecting any of the other browsers (that I have tested). I guess you could call this an IE-hack since I believe the zoom property is only supported by Internet Explorer.
__________________
Web Design Kent
gerdonhanry is offline   Reply With Quote


Old 03-15-2010, 03:09 PM   #6
Platinum Member
 
anna's Avatar
 
Join Date: Jul 2009
Location: Michigan
Posts: 501
Default

I have a feeling I will be using these quite often! Damn you internet explorer! *makes sign of evil eye*
anna is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:20 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.