Page 1 of 1

CCS HTML HELP

Posted: Wed Mar 22, 2023 9:07 am
by billwetson
I need to add smooth scroll in table items listed on my website homepage each of the item in the table should go to it’s specific location down the page upon clicking. How to perfrom this task using CSS or using Anchor tag?

Re: CCS HTML HELP

Posted: Thu Mar 23, 2023 3:21 pm
by DIGI3
You can set up anchors as normal, then either add the smooth-scroll css property, or use Javascript if you want more control and browser support. See https://developer.mozilla.org/en-US/doc ... l-behavior

Re: CCS HTML HELP

Posted: Wed May 10, 2023 9:36 am
by tuckerandy
billwetson wrote: Wed Mar 22, 2023 9:07 am I need to add smooth scroll in table items listed on my website homepage each of the item in the table should go to it’s specific location down the page upon clicking. How to perfrom this task using CSS or using Anchor tag?


Hello billwetson, you can use anchor tags to create a smooth scroll effect to navigate to specific sections on your webpage. Here's an example:

1. First, add an ID attribute to each section you want to scroll to. For example, if you have three sections on your homepage, you can add IDs like this:

```
<section id="section1">Section 1 content goes here</section>
<section id="section2">Section 2 content goes here</section>
<section id="section3">Section 3 content goes here</section>
```

2. Then, create a navigation menu with links to each section. For example:

```
<ul>
<li><a href="#section1">Section 1</a></li>
<li><a href="#section2">Section 2</a></li>
<li><a href="#section3">Section 3</a></li>
</ul>
```

3. Finally, add some CSS to create a smooth scroll effect. Here's an example:

```
html {
scroll-behavior: smooth;
}
```

This CSS property tells the browser to animate the scroll behavior when navigating to a section.

That's it! When you click on a link in the navigation menu, the browser will smoothly scroll to the corresponding section.
Hope this will help you!