简体   繁体   中英

How i get an HTML button to go to a different page inside my own page?

Well, i want to get an effect that, when i clikc a section of my HTML top buttons, the page jump to a new page (inside of my own page), but only change the body, foot... and remain the top.

Like this example:

https://albertoanayamusic.com/

When you click a section, just change the middle part of the webpage.

Thanks!

I think you misunderstand what is happening on the example site you have provided. When you click on a link it is going to a different page. What you are seeing is a fixed background so it just looks like only the body content is changing.

You can achieve this with some CSS:

body {
    background-image: url("background.jpg");
    background-repeat: no-repeat;
    background-attachment: fixed;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM