LoginSignup
sharp231
@sharp231

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

リンク先へ飛ばす方法が知りたいです

Q&AClosed

解決したいこと

h1にあるプロフィールからh2にあるプロフィールへ飛ばす方法を知りたい

該当するソースコード

SimBa Official Site
         <!DOCTYPE html>
Profile

Profile

<main>
  <div id="mainvisual">
    <img src="12345.jpg" alt="テキストテキストテキスト">
  </div>

  <section id="about" class="wrapper">
    <h2 class="section-title">About</h2>
    <div class="content">
      <img src="nekoneko.jpg" >
      <div class="text">
        <h3 class="content-title">SimBa</h3>
        <p>
          <a href="ai">プロフィールはこちら</a><br>
          
          
        </p>
      </div>
    </div>
  </section>

  <section id="hobby" class="wrapper">
    <h2 class="section-title">Profile</h2>
    <ul>
      <li>
        <img src="onair.png">
        <h3 class="content-title">趣味</h3>
        <p><a id ="#1">読書やブログやSNSで情報発信をしています。</a></p>
        <a href="https://note.com/simba0522/">noteはこちら</a>
      </li>
      <li>
        <!-- <img src="img/bicycle2.jpg" alt="テキストテキストテキスト"> -->
        <!-- <h3 class="content-title">タイトルタイトル</h3>
        <p>テキストテキストテキスト</p>
      </li> -->
      <li>
        <img src="ryori.png" alt="テキストテキストテキスト">
        <h3 class="content-title">タイトルタイトル</h3>
        <p>テキストテキストテキスト</p>
      </li>
    </ul>
  </section>
</main>


   

           <div class="footer">
               
               
                 
                  <form action="./contactform.php" method="post">
                    名前<input type="text" name="fullname" value="">
                    Eメール <input type="email" name="email" value="">
                    本文<textarea name="message" id="" cols="" rows=""></textarea>
                    <input type="submit" name="confirm" value="確認" class="button">
                  </form>
                  
                  <div class="footer-left">
                      <ul>
                        <li>お問い合わせ</li>
                      </ul>
                  </div>
                    
                  
                 
                </p>
           </div> 
           <footer id="footer">
            <p>&copy; 2022 Profile</p>
          </footer>
    </div>

</body>

自分で試したこと

hrefを使ってやってみましたが飛ばなかった

0

2Answer

リンク先のid = hoge
#は不要なのではないでしょうか。

<a href="#profile">Profile</a>

<h2 id="profile">プロフィールです</h2>

1

Comments

  1. @sharp231

    Questioner
    できました!
    ありがとうございます!

Comments

  1. @sharp231

    Questioner
    <a href="#1">Profile</a></li>と

    <a id ="#1">読
    でコードを書いてますがクリックしても飛ばないです

Your answer might help someone💌