1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

CSS & DIV on wordpress

Discussion in 'CSS' started by emaz85, Dec 27, 2012.

  1. #1
    I don't understand why I'm wrong. My css appears not linked with sidebar.

    This is the code of sidebar

    <script type="text/javascript">
    <!--
    //-->
    </script>
    <script type="text/javascript">
    <!--
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    //-->
    </script>
    
    
     
      
            <script type="text/javascript">
    <!--
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
            
            <body onLoad="MM_preloadImages('/wp-includes/images/wrapper/1contattaci.png','/wp-includes/images/wrapper/1trattamentiemalattie.png','/wp-includes/images/wrapper/arredamentogiardini1.png','/wp-includes/images/wrapper/1contattaci.png','/wp-includes/images/wrapper/sistemazioneterreno1.png','/wp-includes/images/wrapper/struttureinlegnomenu1.png','/wp-includes/images/wrapper/recinzionimenux1.png','/wp-includes/images/wrapper/minipiscineedareerelax1.png','/wp-includes/images/wrapper/impiantidiilluminazione1.png')">
     
    <div id="sidebar"> 
         
            <div class="menlate">
       <a href="http://www.agrifuturafirenze.it/richiesta-info.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Contattaci','','/wp-includes/images/wrapper/1contattaci.png',1)"><img src="/wp-includes/images/wrapper/contattaci.png" alt="Contattaci per un preventivo" name="Contattaci" width="290" height="180" border="0"></a>
        </div>
    
    <div class="menlate">
    <table width="290" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="140"><a href="http://www.agrifuturafirenze.it/trattamenti-e-malattie.html"><a href="http://www.agrifuturafirenze.it/trattamenti-e-malattie.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('trattamenti-e-malattie','','/wp-includes/images/wrapper/1trattamentiemalattie.png',1)"><img src="/wp-includes/images/wrapper/trattamentiemalattie.png" alt="Trattamenti e malattie" name="trattamenti-e-malattie" width="140" height="140" border="0"></a></td>
                    <td width="10">&nbsp;</td>
                    <td width="140"><a href="http://www.agrifuturafirenze.it/arredamento-giardini.html"><a href="http://www.agrifuturafirenze.it/arredamento-giardini.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('arredamento-giardini','','/wp-includes/images/wrapper/arredamentogiardini1.png',1)"><img src="/wp-includes/images/wrapper/arredamentogiardini.png" alt="Arredamento giardini" name="arredamento-giardini" width="140" height="140" border="0"></a></td>
                  </tr>
                </table>
                
    </div>
                
                <div class="menlate">
                  <a href="http://www.agrifuturafirenze.it/sistemazione-terreno.html " onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('sistemazione-terra','','/wp-includes/images/wrapper/sistemazioneterreno1.png',1)"><img src="/wp-includes/images/wrapper/sistemazioneterreno.png" alt="sistemazione terra" name="sistemazione-terra" width="290" height="50" border="0"></a>
                  
                </div>
                
            <div class="menlate">
              <a href="http://www.agrifuturafirenze.it/strutture-in-legno.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('strutture-in-legno','','/wp-includes/images/wrapper/struttureinlegnomenu1.png',1)"><img src="/wp-includes/images/wrapper/struttureinlegnomenu.png" alt="strutture in legno" name="strutture-in-legno" width="290" height="50" border="0"></a>
             
            </div>
            <div class="menlate">
              <a href="http://www.agrifuturafirenze.it/recinzioni.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Recinzioni','','/wp-includes/images/wrapper/recinzionimenux1.png',1)"><img src="/wp-includes/images/wrapper/recinzionimenux.png" alt="Recinzioni" name="Recinzioni" width="290" height="50" border="0"></a>
             
            </div>
            <div class="menlate">
              <a href="http://www.agrifuturafirenze.it/minipiscine-e-aree-relax.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('minipiscine-ed-aree-relax','','/wp-includes/images/wrapper/minipiscineedareerelax1.png',1)"><img src="/wp-includes/images/wrapper/minipiscineedareerelax.png" alt="Minipiscine ed aree relax" name="minipiscine-ed-aree-relax" width="290" height="50" border="0"></a>
            </div>
            
              <div class="menlate">
                <a href="http://www.agrifuturafirenze.it/terrazze.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('terrazze','','/wp-includes/images/wrapper/terrazzemenu1.png',0)"><img src="/wp-includes/images/wrapper/terrazzemenu.png" alt="terrazze" name="terrazze" width="290" height="50" border="0"></a>
                
              </div>
            
            <div class="menlate">
              <a href="http://www.agrifuturafirenze.it/impianti-di-illuminazione.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('impianti-di-illuminazione','','/wp-includes/images/wrapper/impiantidiilluminazione1.png',1)"><img src="/wp-includes/images/wrapper/impiantidiilluminazione.png" alt="impianti di illuminazione" name="impianti-di-illuminazione" width="290" height="50" border="0"></a>
            </div>
            
            <div class="social2">
              <table width="290" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="109">&nbsp;</td>
                  <td width="181" rowspan="6"><div class="g-plus" data-width="174" data-href="https://plus.google.com/100075720141126803533" data-rel="publisher"></div></td>
                </tr>
                <tr>
                  <td><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fagrifutura&amp;send=false&amp;layout=standard&amp;width=100&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=25" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:25px;" allowtransparency="true"></iframe></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td height="22"><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.agrifuturafirenze.it">Tweet</a>
    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td><script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
    <script type="IN/Share" data-url="http://www.agrifuturafirenze.it" data-counter="right"></script></td>
                </tr>
              </table>
      </div>
           </div>
    PHP:

    This is my Css

     
    /*******************
    *    SIDEBAR           *
    ********************/
    #sidebar {
        float: right;
            background: #d7f4ff;
        width: 290px;
        margin: 10px;
        padding: 10px 5px 5px 4px;
        overflow: hidden;
    }
    #sidebar li ul {
        border: none;
    }
    #sidebar a {
         color: #333;
    }
    #sidebar a:hover {
             color: #333;
             border-bottom: none;
    }  
    #sidebar a:visited {
         color: #333;
    }
    #sidebar .box {
        margin: 0px 0px 0px 0px;
        padding: 5px 0px 0px 0px;
        color: #333;
    }
    .adblock {
        margin: 0px 0px 10px 0px;
    }
    .ad125x125 {
        background: #fff;
        width: 125px;
        height: 125px;
        margin: 0px 0px 10px 0px;
    }
    .ad125x125 img {
        border: none;
    }
    .social2 {
        align: center;
            margin: 7px;
    }
    .menlate {
        align: center;
            margin top: 500px;
            margin bottom: 5px;
    }
    
    Code (markup):
     
    emaz85, Dec 27, 2012 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Wow... that's bad. I have a saying I use a good deal: "CSS is only as good as the markup it's applied to" -- and your markup... just wow.

    Tables for layout, presentation inlined, nothing remotely resembling semantics, THAT STUPID MALFING MM_SWAP SCRIPTING GARBAGE doing CSS' job, endless pointless classes for nothing, multiple tables doing a lists job, tables for nothing, non-breaking spaces doing padding's job...

    ... and that's before we talk the invalid/nonexistent properties in your CSS... it's "margin-top" and "margin-bottom", not "margin top" -- hyphens, not spaces! You're targeting elements that don't even seem to exist. You're setting properties on the anchors that would never show since you are using IMG instead of text, and again THAT STUPID MALFING MM_SWAP SCRIPTING GARBAGE doing CSS' job. (Not a fan in case you couldn't tell)

    Not sure what that mess is supposed to accomplish without seeing the images involved... and even so since this appears to be in turdpress good luck fixing it since you basically have to neuter the upgrade path by bending it over the table to make it your ***** to fix anything.
     
    deathshadow, Dec 28, 2012 IP