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

XF 1.4 custom CSS styling syntax error, please help!

Discussion in 'XenForo Questions and Support' started by zoldos, Jun 29, 2015.

  1. zoldos

    zoldos Well-Known Member

    Trying to do this is a .css file. It keeps producing a syntax error. Please help!!

    Code:
    <xen:if is="{$attachment.extension} == 'mp3' ">
        .attachment
            {
                float: left;
                width: 100%;
                max-width: 100%;
            }
               
            <xen:elseif is="{$attachment.extension} == 'mp4' ">
              .attachment
            {
                float: left;
                width: 100%;
                max-width: 100%;
            }
        <xen:else />
            .attachment
            {
                float: left;
                width: 200px;
                max-width: 100%;
            }        
        </xen:if>   
    
     
  2. TJA

    TJA Well-Known Member

    Just a guess :)

    Code:
    <xen:if is="{$attachment.extension} == 'mp3' ">
        .attachment
            {
                float: left;
                width: 100%;
                max-width: 100%;
            }
           
        <xen:else />
            .attachment
            {
                float: left;
                width: 200px;
                max-width: 100%;
            }       
    </xen:if> 
              
    <xen:if is="{$attachment.extension} == 'mp4' ">
              .attachment
            {
                float: left;
                width: 100%;
                max-width: 100%;
            }
        <xen:else />
            .attachment
            {
                float: left;
                width: 200px;
                max-width: 100%;
            }       
    </xen:if>  
     
  3. zoldos

    zoldos Well-Known Member

    I'm messing with an alternate way in the template file itself, but I'll try this. Thanks!! :D
     
  4. zoldos

    zoldos Well-Known Member

    It's just not wanting to recognize the difference between the two extensions and keeps defaulting to the original code. I even tried an internal style sheet to override the linked one and it still doesn't work. Very strange! lol
     
  5. Steve F

    Steve F Well-Known Member

    You need to do your condition in the html template, that won't work in a CSS template as far as I'm aware.
     
  6. zoldos

    zoldos Well-Known Member

    hehehe Yeah it looks like it. I'm still messing with it. :)
     

Share This Page