Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS ‘:before’ pseudo problem, help please

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38193
    passingTime
    Member

    It looks fine on all modern browsers excluding IE. Was trying to use the :before pseudo to make an image border.

    The markup is simply:

    The CSS:


    #box{width: 300px; height: 200px; background: #000; position: relative;}

    #box:before {content: ''; background: red url(imgs/border.png); position: absolute; z-index: -1;
    width: 100%; height: 100%; padding: 6px; top: -6px; left: -6px;}

    Am i doing something wrong?

    #103396

    You haven’t told us what the problem is?

    #103397
    passingTime
    Member

    The styled div in any modern browser excluding IE shows the ‘#main:before’ styled box behind the ‘#main’ box, which is what it is supposed to do. Whereas in IE it shows up in front.

    #103414
    passingTime
    Member

    That doesn’t work. Is there a better way to use border images that is efficient and compliant with IE? I can always just create an outer div but that isn’t very efficient i think.

    #103526
    passingTime
    Member

    No one knows if this is viable? I think it would be a good way to go for image borders if it worked on IE.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.