Welcome our webmaster and SEO forum
Please enjoy the forum, contribute what you can, and wind up the Moderators!
Results 1 to 4 of 4

Thread: centering image with CSS problem

  1. #1
    Roo's Avatar
    Roo
    Roo is offline Senior Member
    Join Date
    Mar 2008
    Location
    Bristol
    Posts
    101

    Default centering image with CSS problem

    Hi, First post here so please be gentle on the noob!

    I'm using templates from 1234.info, but as it doesn't do exactly what I want I'm trying to hack code out of other style sheets.

    This is working to try get a 'slideshow' to display centrally. I have the background image using the div class 'slideshow' and an animated gif over this on the page code thus -

    css - /* slideshow */
    .slideshow{width:500px;height:423px;overflow:hidde n;background:transparent url('../img/bg-slideshow.jpg') no-repeat 0 0}.slideshow img{height:423px;}

    pagecode -
    <div class="slideshow">
    <img class="center" src="./img/test.gif" alt="text?" width="500" height="439" /></a>
    </div>

    Though I can get the gif to align center, I can't shift the background or even keep the gif aligned center when activating the slideshow div.

    Any help to center this as it's been sending me around in circles for the last 24hours!

    TIA

  2. #2
    Roo's Avatar
    Roo
    Roo is offline Senior Member
    Join Date
    Mar 2008
    Location
    Bristol
    Posts
    101

    Default

    wow! Not a single answer in over 6 weeks! And here's me with another CSS question....

  3. #3
    silverf0x's Avatar
    silverf0x is offline Member
    Join Date
    Jul 2010
    Posts
    53

    Default

    your image with class center.

    You may try to create css for .center

    .center {float:center;margin:auto;}

    Hope that it can help you. Please tell me the result

  4. #4
    misamisa is offline Junior Member
    Join Date
    May 2011
    Posts
    5

    Default

    float:center is not supported for many modern browsers. instead use {position:relative;margin:0 auto;}

    Hope this works.

Thread Information

Users Browsing this Thread

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

Bookmarks

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124