Javascript 如何让两个元素接近css?

Javascript 如何让两个元素接近css?,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我需要取两个元素并关闭它们,一个靠近另一个。我需要用CSS来实现这一点,这是我的html代码: <section class="vc_row section-wrapper vc_custom_1453226174905 vc_row-has-fill"> <div class="container"> <div class="row"> <div class="wpb_column vc_column_container vc_

我需要取两个元素并关闭它们,一个靠近另一个。我需要用CSS来实现这一点,这是我的html代码:

<section class="vc_row section-wrapper vc_custom_1453226174905 vc_row-has-fill">
  <div class="container">
    <div class="row">
      <div class="wpb_column vc_column_container vc_col-sm-6 vc_col-md-4">
        <div class="vc_column-inner ">
          <div class="wpb_wrapper"> 

            <div class="spotlight-wrap spotlight-default ">

              <figure class="tt-effect">

                <img src="http://andrejceccoli.com/wp-content/uploads/2016/09/programmaPolitico.jpg" alt="Programma Elettorale">

                <figcaption>
                  <h2>Programma Elettorale</h2>        
                    <div class="content">
                      <p>Tutti i punti del mostro programma elettorale.</p>
                      <a class="btn btn-outline " href="http://andrejceccoli.com/?page_id=15" title="">Leggi di più</a>
                    </div>
                </figcaption>
              </figure>
            </div> <!-- spotlight-wrap -->
          //NEW FIGURE
              <figure class="tt-effect">
                <img src="http://trendytheme.net/demo2/wp/nominee/onepage/wp-content/uploads/2015/11/Issues-one-page-360x250.jpg" alt="Issues">
                <figcaption>
                  <h2>Issues</h2>                  
                  <div class="content">
                    <p>Rapidiously integrate plug-and-play channels rather than cost effective ideas.</p>

                    <a class="btn btn-outline " href="http://trendytheme.net/demo2/wp/nominee/onepage/issue-right-sidebar/" title="">Learn more</a>
                  </div>
                </figcaption>    
              </figure>
            </div> <!-- spotlight-wrap -->
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

电子程序
电子程序

          //NEW FIGURE
              <figure class="tt-effect">
                <img src="http://trendytheme.net/demo2/wp/nominee/onepage/wp-content/uploads/2015/11/Issues-one-page-360x250.jpg" alt="Issues">
                <figcaption>
                  <h2>Issues</h2>                  
                  <div class="content">
                    <p>Rapidiously integrate plug-and-play channels rather than cost effective ideas.</p>

                    <a class="btn btn-outline " href="http://trendytheme.net/demo2/wp/nominee/onepage/issue-right-sidebar/" title="">Learn more</a>
                  </div>
                </figcaption>    
              </figure>
            </div> <!-- spotlight-wrap -->
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
//有人能帮我吗?

          //NEW FIGURE
              <figure class="tt-effect">
                <img src="http://trendytheme.net/demo2/wp/nominee/onepage/wp-content/uploads/2015/11/Issues-one-page-360x250.jpg" alt="Issues">
                <figcaption>
                  <h2>Issues</h2>                  
                  <div class="content">
                    <p>Rapidiously integrate plug-and-play channels rather than cost effective ideas.</p>

                    <a class="btn btn-outline " href="http://trendytheme.net/demo2/wp/nominee/onepage/issue-right-sidebar/" title="">Learn more</a>
                  </div>
                </figcaption>    
              </figure>
            </div> <!-- spotlight-wrap -->
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
//新图形
问题
快速整合即插即用渠道,而不是经济高效的想法

          //NEW FIGURE
              <figure class="tt-effect">
                <img src="http://trendytheme.net/demo2/wp/nominee/onepage/wp-content/uploads/2015/11/Issues-one-page-360x250.jpg" alt="Issues">
                <figcaption>
                  <h2>Issues</h2>                  
                  <div class="content">
                    <p>Rapidiously integrate plug-and-play channels rather than cost effective ideas.</p>

                    <a class="btn btn-outline " href="http://trendytheme.net/demo2/wp/nominee/onepage/issue-right-sidebar/" title="">Learn more</a>
                  </div>
                </figcaption>    
              </figure>
            </div> <!-- spotlight-wrap -->
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

我该怎么做?使用css?

尝试
浮动:左。否则,最好提供更多信息。例如,哪些元素需要彼此靠近

          //NEW FIGURE
              <figure class="tt-effect">
                <img src="http://trendytheme.net/demo2/wp/nominee/onepage/wp-content/uploads/2015/11/Issues-one-page-360x250.jpg" alt="Issues">
                <figcaption>
                  <h2>Issues</h2>                  
                  <div class="content">
                    <p>Rapidiously integrate plug-and-play channels rather than cost effective ideas.</p>

                    <a class="btn btn-outline " href="http://trendytheme.net/demo2/wp/nominee/onepage/issue-right-sidebar/" title="">Learn more</a>
                  </div>
                </figcaption>    
              </figure>
            </div> <!-- spotlight-wrap -->
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

啊,如果您使用float,请清除下一个元素
:两者。否则您的设计可能会被破坏。

只需将CSS样式添加到
图中即可。
标记:

          //NEW FIGURE
              <figure class="tt-effect">
                <img src="http://trendytheme.net/demo2/wp/nominee/onepage/wp-content/uploads/2015/11/Issues-one-page-360x250.jpg" alt="Issues">
                <figcaption>
                  <h2>Issues</h2>                  
                  <div class="content">
                    <p>Rapidiously integrate plug-and-play channels rather than cost effective ideas.</p>

                    <a class="btn btn-outline " href="http://trendytheme.net/demo2/wp/nominee/onepage/issue-right-sidebar/" title="">Learn more</a>
                  </div>
                </figcaption>    
              </figure>
            </div> <!-- spotlight-wrap -->
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
figure {
    display: inline-block;
    float: left;
}
图{
显示:内联块;
}

电子程序
电子程序

          //NEW FIGURE
              <figure class="tt-effect">
                <img src="http://trendytheme.net/demo2/wp/nominee/onepage/wp-content/uploads/2015/11/Issues-one-page-360x250.jpg" alt="Issues">
                <figcaption>
                  <h2>Issues</h2>                  
                  <div class="content">
                    <p>Rapidiously integrate plug-and-play channels rather than cost effective ideas.</p>

                    <a class="btn btn-outline " href="http://trendytheme.net/demo2/wp/nominee/onepage/issue-right-sidebar/" title="">Learn more</a>
                  </div>
                </figcaption>    
              </figure>
            </div> <!-- spotlight-wrap -->
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
问题 快速整合即插即用渠道,而不是经济高效的想法

          //NEW FIGURE
              <figure class="tt-effect">
                <img src="http://trendytheme.net/demo2/wp/nominee/onepage/wp-content/uploads/2015/11/Issues-one-page-360x250.jpg" alt="Issues">
                <figcaption>
                  <h2>Issues</h2>                  
                  <div class="content">
                    <p>Rapidiously integrate plug-and-play channels rather than cost effective ideas.</p>

                    <a class="btn btn-outline " href="http://trendytheme.net/demo2/wp/nominee/onepage/issue-right-sidebar/" title="">Learn more</a>
                  </div>
                </figcaption>    
              </figure>
            </div> <!-- spotlight-wrap -->
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

您试过什么吗?哪两个元素需要彼此靠近我尝试了“display:inline block”;但它不起作用请澄清您的具体问题或添加其他详细信息以突出显示您所需的内容。正如目前所写的,很难准确地说出你在问什么。寻求代码帮助的问题必须包括在问题本身中重现代码所需的最短代码,最好是在一个简单的文本中。看见