Results 1 to 4 of 4

Thread: Transparency in DIV

  1. #1
    Join Date
    Jun 2011
    Posts
    63
    Thanks
    49
    Thanked 0 Times in 0 Posts

    Red face Transparency in DIV

    Hello!
    I have an image as the background of the text. I use this code:
    HTML Code:
    <style type="text/css">
    .bgimg {
        background: #ffffff url("...") no-repeat right top;
        margin-right: 100px;
    }
    </style>
    
    <div class="bgimg">
    bla-bla
    </div>
    Unfortunately the rest of the background becomes white. You can see it on this page: http://nicolacoins.blogspot.bg/p/blog-page_13.html

    How to preserve transparency?
    Last edited by balki; 08-13-2016 at 07:49 PM. Reason: format

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Don't define the background as white. In other words, take out the #ffffff hexadecimal colour value.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. The Following User Says Thank You to Beverleyh For This Useful Post:

    balki (08-13-2016)

  4. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Yes, or you can even specify transparent:

    Code:
    <style type="text/css">
    .bgimg {
        background: transparent url("...") no-repeat right top;
        margin-right: 100px;
    }
    </style>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    balki (08-13-2016)

  6. #4
    Join Date
    Jun 2011
    Posts
    63
    Thanks
    49
    Thanked 0 Times in 0 Posts

    Default

    Oh, I'm so stupid. Many many thanks to both of you! Worked beautifully!

Similar Threads

  1. Transparency Fix?
    By porkchop_001 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 09-03-2010, 07:16 AM
  2. Opacity / Transparency
    By emanuelle in forum CSS
    Replies: 4
    Last Post: 05-31-2010, 09:35 AM
  3. Pb .png transparency in IE6
    By zintelix3d in forum CSS
    Replies: 8
    Last Post: 12-28-2007, 06:12 PM
  4. gif with transparency in div
    By Skinnybobb in forum CSS
    Replies: 5
    Last Post: 08-01-2006, 01:25 PM
  5. Transparency
    By Shattered Plastic in forum Graphics
    Replies: 20
    Last Post: 09-25-2004, 04:29 PM

Tags for this Thread

Bookmarks

Posting Permissions

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