Results 1 to 7 of 7

Thread: CSS IE hack needed

  1. #1
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    CSS IE hack needed

    Trying to apply a transparency to a div id #, when i set the height (em, px, whatever) the transparency works, if I set the height to auto however, there is no transparency, does anyone know a/the hack for this?

    Much apreciated.
    Thanks

    If i set the div's heght in px, IE will expanded the bg to fit the overflowing text so this is a sufficient solution, now of course other browsers set the bg at the set height and the text overflows with no sufficient bg.

    Any help appreciated
    Cheers
    Last edited by yamangman; 12-04-2005 at 05:39 PM.
    To err is human. To really foul things up ... you need a computer.

  2. #2
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    Just had a brainwave if I apply !Important to the auto, firefox will accept that and seeing as IE don't understand !Important itll be ok for me to use px for it's height value. Gonna go try

    It works

    Any ideas whether or not this is a sufficiently well thought out fix?
    To err is human. To really foul things up ... you need a computer.

  3. #3
    HEXUS.net Webmaster
    Join Date
    Jul 2003
    Location
    UK
    Posts
    3,108
    Thanks
    1
    Thanked
    0 times in 0 posts
    I don't understand what you are trying to do. If you are trying to make a div with a transparent background by using a transparent gif as the background and need a way to make an IE specific rule then do the following
    Code:
    #divName {
         background: url(transparent.gif);}
    
    /* IE specific rule */
    *html #divName {
         height: 100px;}

  4. #4
    Bigger than Jesus Norky's Avatar
    Join Date
    Feb 2005
    Posts
    1,579
    Thanks
    1
    Thanked
    8 times in 8 posts
    Could you give us a link to the page that's being worked on?

  5. #5
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    When the transparency didnt work in IE my CSS was:

    Code:
    #content
    {
    	margin-left: 215px;
    	height: auto;
    	background: #ECE5BD url(../images/style/heading_content.jpg) no-repeat top left;
    	filter: alpha(opacity=70);
    	opacity: .7;
    }
    Working perfectly now, it is:

    Code:
    #content
    {
    	margin-left: 215px;
    	height: auto !Important;
    	height: 100px;
    	background: #ECE5BD url(../images/style/heading_content.jpg) no-repeat top left;
    	filter: alpha(opacity=70);
    	opacity: .7;
    }
    To err is human. To really foul things up ... you need a computer.

  6. #6
    Bigger than Jesus Norky's Avatar
    Join Date
    Feb 2005
    Posts
    1,579
    Thanks
    1
    Thanked
    8 times in 8 posts
    The reason it wasn't working is that using "filter: alpha(opacity=70);" requires a height or a width defined for it to work.

  7. #7
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    Quote Originally Posted by Norky
    The reason it wasn't working is that using "filter: alpha(opacity=70);" requires a height or a width defined for it to work.
    You don't say!
    To err is human. To really foul things up ... you need a computer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. divs and CSS
    By Kezzer in forum Software
    Replies: 11
    Last Post: 18-11-2003, 12:51 PM
  2. CSS + Other Language Questions
    By Jonny M in forum Software
    Replies: 7
    Last Post: 11-10-2003, 11:17 PM
  3. Radeon 8500 linux driver install problems
    By Dorza in forum Software
    Replies: 0
    Last Post: 22-09-2003, 12:00 PM
  4. CSS Help
    By Basher in forum Software
    Replies: 19
    Last Post: 10-09-2003, 08:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •