2017-01-13 2 views
1

私はページテンプレートに入っていますが、タグ内にdivを全体として折り返しています。私は2つのヘッダータグ要素だけでなく、div要素全体をクリック可能にしたい。タグが壊れていて、すぐに切れています。ネスティングの問題?私は確信していません - いろいろなことを試しました。ここでは、コードがある...ライン<a href="<?php echo esc_url($education['lightbox']);?>">を参照してください、私はWordpressでアンカータグでdivを折り返させることはできません

<section id="<?php echo esc_attr($menu_id);?>" class="section section-education"> 
       <div class="animate-up"> 
        <?php if($title):?> 
         <h2 class="section-title"><?php echo esc_html($title);?></h2> 
        <?php endif;?> 
        <?php if($education_fields):?> 
        <div class="timeline"> 
         <div class="timeline-bar"></div> 
         <div class="timeline-inner clearfix myBox"> 
          <?php        
          $i=0;foreach ($education_fields as $education): 
            if ($i % 2 == 0): 
             $class = 'timeline-box-left'; 
             $class_inner = 'animate-right'; 
            else: 
             $class = 'timeline-box-right'; 
             $class_inner = 'animate-left';          
            endif; 
          ?> 

           <a href="<?php echo esc_url($education['lightbox']);?>"> 
           <div class="timeline-box timeline-box-compact <?php echo esc_attr($class); ?>"> 
            <span class="dot"></span> 

            <div class="timeline-box-inner <?php echo esc_attr($class_inner); ?>"> 
             <?php if($education['years']):?> 
              <span class="arrow"></span> 
              <div class="date"><?php echo esc_html($education['years']);?></div> 
             <?php 
             endif; 
             if($education['education_name']): 
              ?> 
              <h3><?php echo esc_html($education['education_name']);?></h3> 
             <?php 
             endif; 
             if($education['education_place']): 
              ?> 
              <h4> 
              <?php if($education['education_place_link']):?> 
               <a href="<?php echo esc_url($education['education_place_link']);?>"> 
              <?php endif;?> 
              <?php echo esc_html($education['education_place']);?> 
              <?php if($education['education_place_link']):?> 
               </a> 


              <?php endif;?> 
              </h4> 
             <?php endif;?> 

            </div> 
           </div> 
           </a> 
          <?php $i++; endforeach; ?> 
         </div> 
        </div> 
        <?php endif;?> 
        <?php if($custom_editor):?> 
         <div class="section-txt-btn"><?php echo $custom_editor;?></div> 
        <?php endif;?> 
       </div> 
      </section> 

を含めるようにしようとしているアンカータグであり、これは返さされているものです。

<div class="timeline-box timeline-box-compact timeline-box-left" style=""><a href="http://johnhoich.com/wp-content/uploads/2015/11/logo-compass-1.png" data-featherlight="image"> 
            <span class="dot"></span> 

            </a><div class="timeline-box-inner animate-right animated"><a href="http://johnhoich.com/wp-content/uploads/2015/11/logo-compass-1.png" data-featherlight="image"> 
                         <span class="arrow"></span> 
         <div class="date">1974 - 1976</div>                     <h3>High School</h3> 
                         </a><h4><a href="http://johnhoich.com/wp-content/uploads/2015/11/logo-compass-1.png" data-featherlight="image"></a> 

Westside

+0

@kritikaTalwar:あなたの編集でコードの書式設定が一部削除されているため、拒否しました。さらに、コードの紹介に太字の書式を追加する必要はありません。読みやすくするものではありません。 – halfer

+0

@halferあなたはこの問題を解決する方法を知っていますか? – Mike

答えて

0

はこれを考え出した:

対処:カバーに応じて、幅と高さを調整し、右、0 =左、頂部と、それは絶対的な底をした: Iは、DIV /セクションの終わりに<a>タグを入れて、いくつかのCSSを追加しましたZインデックスを上げるとともにコンテンツエリア全体を表示します。これにより、divをラップするのではなく、リンクをカバーすることができました。

0

あなたはこのリンクを持っています...

あなたが引用され <a>タグでラップされているDIV内部

...が、リンク内のリンクはできません、それは確かにHTMLを破るだろう...

関連する問題