1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Three image in a row centered

Discussion in 'Styling and Customization Questions' started by BassMan, Aug 9, 2014.

  1. BassMan

    BassMan Well-Known Member

    Hi!

    I've created a page where I put in 3 images. I'm trying with css to put them in one line (I've done that), but don't know how to center them on forum width.

    I hope someone can help me.

    Thank you.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Is this a thread or a page node?

    If it's a page node, there are various ways to do it, depending on what you have at the moment.
    Do you have a link?
     
  3. BassMan

    BassMan Well-Known Member

    It's a page node. Link sent to convo.
     
  4. BassMan

    BassMan Well-Known Member

    Still stuck on same place. Here's what I have now:

    Code:
    <html>
    <body>
    <style type="text/css">
    .contain {
    max-width:1000px;
    text-align:center;
    }
    
    .element {
    position:relative;
    display: inline-block;
    float:left;
    padding:10px;
    }
    </style>
    <div align="center" class="element">
    <li class="navTab PopupClosed"><a href="{xen:link misc/contact}" class="navLink OverlayTrigger" data-cacheOverlay="true"><img src="/styles/default/xenforo/icons/****.png" alt="****"></a></li>
    </div>
    <div align="center" class="element">
    <a href="****"><img src="/styles/default/xenforo/icons/****.png" alt="****"></a>
    </div>
    <div align="center" class="element">
    <a href="****"><img src="/styles/default/xenforo/icons/****.png" alt="****"></a>
    </div>
    </body>
    </html>
    Those 3 images are in one line, but aren't centered. Trying various things, but I don't know how to go further. If anyone is willing to provide some help I would be very grateful.
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Add a width to the element class.
    Something like 323px works.
     
    BassMan likes this.
  6. BassMan

    BassMan Well-Known Member

    Thanks, Borgan. Works like a charm. Could not recall the width...
     

Share This Page