如何在不影响其他元素的情况下将表放在页面上?

时间:2018-06-14 19:15:39

标签: javascript html

我希望能够移动我创建的表而不影响或移动我已编码的SVG。我现在拥有的CSS定位是:

 .table2 {
  margin-top: 300px;
  margin-left:800px;

    }

这将我的桌子定位在我希望它去的地方,但是正在推动我已经在页面上的所有其他内容。如何在不影响任何其他元素定位的情况下执行此操作?

这是我的.js:

  <script>

   $(document).ready(function(){
   $('.counties').on("click",function(e){ 
   $('.table2').fadeIn();
   });
 });

 </script>

这是我的表:

<table class="table2" bgcolor="#F5F5F5">
<tr>
<td><pre><font color="696969"face="Century Gothic">###### CHILDREN NEED A GIFT
            IN THIS COUNTY</font></pre></td>
</tr>
<tr>
<td><button><font color="696969"face="Century Gothic">Volunteer</font> 
</button><button><font color="696969"face="Century Gothic">Donate</font> 
</button></td>
 </tr>
</table>

由于表位置,这就是被移动的内容:

  <path class="counties"
 style="font-size:12px;fill:#d0d0d0;fill-opacity:1;fill- 
  rule:nonzero;stroke:#000000;stroke-width:18.65967751;stroke- 
  linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke- 
  dasharray:none;stroke-opacity:1;marker-start:none"
  d="m 471.60261,246.44442 29.99111,-0.99619 8.36129,-11.40059 
  -0.16978,-0.49813 0.58508,-0.68252 h 1.28346 l 2.45362,1.10686 
   4.6997,5.90324 5.05827,15.71735 1.37784,5.53421 0.11332,0.44279 
   1.52883,11.1239 0.41524,4.8333 0.26423,10.23838 0.50959,34.0174 
   -24.17783,3.63415 -6.11526,0.16628 -15.1371,-10.57045 -25.87655,4.99926 
   -21.25234,27.68986 -9.45597,-12.37832 -7.04008,-9.31609 9.4371,-6.8256 
    10.94705,-12.63657 v -0.59033 l -1.00034,-1.73412 33.1997,-57.77781"
    id="Monmouth"
    inkscape:connector-curvature="0" />

0 个答案:

没有答案