Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: css opacity

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts

    css opacity

    hi

    ok bit of a problem with css..

    using the following..
    <span style=\"float:left;filter:alpha(opacity=25);-moz-opacity:.25;opacity:.25;\">
    this is to make an image transparent, it works... only problem is it move sthe image to the left.. i have changed float to 'center' and then it goes to centre but is not transparent.. tried putting in extra div align and just align and it made no difference.

    anyone have any idea how to make a image transparent but also have it centered?

    thanks =]
    P

  • #2
    Regular Coder Masterslave's Avatar
    Join Date
    Dec 2005
    Posts
    287
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Perhaps making the span a div and then give it:
    Code:
    margin: 0 auto;
    And the set a width for the container for that div withthe opacity.

    I think...

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    thanks for the reply...

    however just tried it... does the same, no such luck

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    If it's to make an img semi-opaque, why aren't you applying the styling to the img element itself?
    (incidentally, it's far tidier to apply styles via a class than to load element tags up with inline styles.)

  • #5
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,677
    Thanks
    6
    Thanked 1,008 Times in 981 Posts
    Maybe if you provided the entire code we could give you some better advice?
    The only advice I can give you right now is: There is no float: center;, only left, right, or none.

  • #6
    Regular Coder oldcrazylegs's Avatar
    Join Date
    Feb 2004
    Location
    East Moline Illinois USA
    Posts
    414
    Thanks
    4
    Thanked 5 Times in 4 Posts
    you cannot set float to center. only left or right will work.

    center objects in ie
    text-align:center;

    center objects in all other browsers
    margin:0 auto;

    use both

  • #7
    Regular Coder Masterslave's Avatar
    Join Date
    Dec 2005
    Posts
    287
    Thanks
    2
    Thanked 0 Times in 0 Posts
    IE can understand margin: 0 auto;!
    Only IE >6 doesn't understand that and the we have to use text-align: center; indeed.

    EDIT: Hehe your right Bill Poster. Wrong sign...
    Last edited by Masterslave; 04-27-2006 at 09:10 AM.

  • #8
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by Masterslave
    IE can understand margin: 0 auto;!
    Only IE >6 doesn't understand that and the we have to use text-align: center; indeed.
    Surely you mean IE<6 (versions of IE earlier/less than version 6)

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    ah thank you all, i have now put it within the actual img tag with float set to none and it is working great.

    Shame it dont work in opera but ohwell.

    Thanks for all your help, great thread.

    Sir P


  •  

    Posting Permissions

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