CSS 中的平滑滚动 [英] Smooth Scrolling in CSS

查看:28
本文介绍了CSS 中的平滑滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我已经尝试了所有我检查过的一大堆网站,但它就是不行.我试图让滚动行为在这个网站上工作.我已将滚动容器放入 ids 固定 css 但它只是不起作用.关于为什么平滑滚动不起作用的任何想法?基本上我需要的是导航栏区域平滑滚动到页面上的适当区域.所以菜单到菜单,交易到交易,关于到关于等等......我不明白为什么平滑滚动不起作用.有任何想法吗?谢谢!

/* 主体样式 */身体 {边距:0;宽度:100%;高度:自动;box-sizing: 边框框;文本对齐:居中;背景色:#f9f9f9;background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%238b8b8b' fill-opacity='0.07' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");字体系列:var(--main-font);}一种 {光标:指针;大纲:无;文字装饰:无;}小时{边框:0;高度:1px;边距:0 0 1.5em 0;背景图像:-webkit-线性梯度(左,#f0f0f0,#8c8b8b,#f0f0f0);背景图像:-moz-线性渐变(左,#f0f0f0,#8c8b8b,#f0f0f0);背景图像:-ms-线性梯度(左,#f0f0f0,#8c8b8b,#f0f0f0);背景图像:-o-线性梯度(左,#f0f0f0,#8c8b8b,#f0f0f0);}.hr2 {边距:0 自动;宽度:50%;}.滚动框{滚动行为:平滑;溢出-y:滚动;}:根 {--main-box-shadow:-5px 6px 59px -4px rgba(77,77,77,1);--主色:#d30404;--main-text-shadow: 0px 3px 6px rgba(150, 150, 150, 1);--fancy-font: 'Rock Salt',草书;--main-font: 'Raleway', sans-serif;}/* 标题 */.header-image {背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/header.jpg');背景尺寸:封面;背景位置:中心;背景附件:固定;宽度:100%;高度:40em;}.header-wrapper {填充顶部:1.5em;}.header-logo {边距:0;填充底部:1.25em;颜色:#d30404;font-family: 'Rock Salt',草书;字体大小:5em;文本阴影:-2px 2px 7px rgba(0, 0, 0, .25);字母间距:0.115em;}.menu-btn {边界:无;边界半径:2em;填充:1em 3.25em;背景:#d30404;颜色:#efefef;box-shadow: 0px 30px 95px -15px rgba(0,0,0,.5);字体大小:1.15em;}/* 营业时间 */.小时包装{背景颜色:红色;}.hours-header {边距:0;}.小时列表{列表样式:无;填充:0;}/* 导航栏 */.nav {边距:0;}.菜单框{背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/menu.jpg');}.deals-box {背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/dough.jpg');}.about-box {背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/storefront.jpg');}.contact-box {背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/oven.jpg');}.box-logo {边距:0;填充:1.5em;白颜色;字体大小:2em;font-family: 'Rock Salt',草书;文本阴影:-2px 2px 7px rgba(0, 0, 0, .25);}.盒子 {框阴影:插入-1px 1px 43px -9px rgba(0,0,0,1);背景位置:中心;背景尺寸:封面;背景附件:滚动;宽度:100%;高度:10em;}/* 菜单 */.menu-title {颜色:#d30404;font-family: 'Rock Salt',草书;字体大小:4em;边距:0;填充:1em 0 .25em 0;文本阴影:var(--main-text-shadow);}.menu-gallery {显示:弹性;flex-wrap: 包裹;justify-content: 空间环绕;}.菜单项{边距:2em 0;}.menu-pic {宽度:自动;高度:15em;边距:0.5em;框阴影:-12px 11px 39px -12px rgba(0,0,0,0.81);}.pic2,.pic6 {宽度:95%;}.菜单标题{font-family: 'Raleway', sans-serif;字体粗细:更粗;字体大小:1.5em;}/* 交易 */.交易包装{填充:1.5em 0;}.交易 {边距:0;颜色:#d30404;font-family: 'Rock Salt',草书;字体大小:3em;文本阴影:var(--main-text-shadow);}.deal-img {宽度:自动;高度:15em;边距:1em;框阴影:-12px 11px 39px -12px rgba(0,0,0,0.81);}/* 关于 */.关于 {颜色:#d30404;font-family: 'Rock Salt',草书;字体大小:3.5em;边距:0;文本阴影:var(--main-text-shadow);}.store-pic {边距:2em 0;宽度:100%;高度:自动;box-shadow: -1px 3px 17px -4px rgba(150,150,150,0.8);}.about-par {font-family: 'Raleway', sans-serif;字体大小:1.115em;行高:180%;填充:1.35em 0;边距:0 自动;最大宽度:33ch;}/* 评论 */.review 包装器 {填充顶部:2em;}.审查 {显示:弹性;flex-wrap: 包裹;justify-content: 空间环绕;字体系列:'Nunito',无衬线;字体样式:斜体;最大宽度:32ch;边距:0 自动;}.fa-yelp {颜色:#d32323;}.fa-facebook-f {颜色:#3b5998;}/*页脚*/.footer-wrapper {背景颜色:#d30404;box-shadow: 插入 0px 1px 52px -10px rgba(0, 0, 0, .115);宽度:100%;高度:5em;显示:弹性;对齐内容:居中;}.footer-social {显示:弹性;justify-content: 空间环绕;填充:.75em 0;}.社会的 {白颜色;文本阴影:-3px 2px 5px rgba(0, 0, 0, 0.25);}.footer-cred {字体大小:.75em;白颜色;文本阴影:-3px 2px 5px rgba(0, 0, 0, 0.25);}

<html lang="zh-cn" dir="ltr"><头><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>恐龙披萨</title><link rel="stylesheet" href="/Users/rogerjorns/Desktop/DinosMain/assets/index.css"><link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway|Rock+Salt|Nunito" rel="stylesheet"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3Bc12p";<身体><!-- 标题--><header class="header-image"><div class="header-wrapper"><h1 class="header-logo">Dino's Pizza</h1>

<a href="menu" class="menu-btn">查看我们的菜单</a></标题><!-- 营业时间--><div class="hours-wrapper"><h2 class="hours-header">营业时间</h2><ul class="小时列表"><li class="hours">** 周一闭馆 **</li><li class="hours">周二至周四:上午 11 点至晚上 8 点</li><li class="hours">周五至周六:上午 11 点至晚上 9 点</li><li class="hours">周日:下午 2 点 - 8 点</li>

<!-- 导航栏--><div class="nav"><div href="#menu" class="menu-box box"><a href="#menu"><h2 class="box-logo">Menu</h2></a>

<div href="#deals" class="deals-box box"><a href="#deals"><h2 class="box-logo">Deals</h2></a>

<div href="#about" class="about-box box"><a href="#about"><h2 class="box-logo">关于我们</h2></a>

<div href="#contact" class="contact-box box"><a href="#contact"><h2 class="box-logo">联系方式</h2></a>

<滚动容器><!-- 菜单--><div class="menu-wrapper"><h1 id="menu" class="menu-title title scrolling-box">Menu</h1><小时><div class="menu-gallery"><div class="menu-item"><img class="menu-pic pic1" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/allmeat.jpg" alt=""><h3 class="menu-heading">全肉</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic2" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/hawaiian.jpg" alt=""><h3 class="menu-heading">夏威夷语</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic3" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/veggie.jpg" alt=""><h3 class="menu-heading">Veggie</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic4" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/onetopping.jpg" alt=""><h3 class="menu-heading">一个浇头</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic5" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/twotopping.jpg" alt=""><h3 class="menu-heading">两个Topping</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic6" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/cheesybread.jpg" alt=""><h3 class="menu-heading">奶酪面包</h3><p class="menu-price">$11.95</p>

<小时><!-- 优惠--><div class="deal-wrapper"><scroll-page><h2 id="deals" class="deals scrolling-box">Deals</h2></scroll-page><hr class="hr2"><img class="deal-img" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/deal.jpg" alt=""><img class="deal-img" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/deal2.jpg" alt="">

<!-- 关于我们--><小时><div class="about-wrapper"><h2 id="about" class="about scrolling-box">关于我们</h2><hr class="hr2"><img class="store-pic" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/storefront.jpg" alt=""><hr class="hr2"><p class="about-par">怀着多年从事餐饮业的志向,我们的梦想在 2014 年 5 月成为现实,当时我们在德克萨斯州蓝丘市打开了 Dino's Pizza 的大门.满怀热情提供镇上最美味的比萨饼和翅膀,由优质原料制成,我们期待您作为我们餐厅的客人或直接送货上门.</p><br><p class="about-par">在 Dino's Pizza,我们为以最专业、友善、正直和清洁为客户服务而感到自豪.我们每天从头开始制作新鲜的披萨面团.Dino's 致力于日复一日地提供美味、热的自制比萨饼和美味的翅膀.</p><br><p class="about-par">Dino's Pizza 是家族所有和经营的.我们新鲜制作的面团、自制酱汁和真正的奶酪丝会让您尝到与众不同!我们开胃可口的鸡翅和甜点是首屈一指的!</p><p class="about-par">不要只相信我们的话...看看我们的忠实客户怎么说在 Yelp 上,然后订购并准备品尝并亲自体验精彩!恐龙之路!</p>

<hr class="hr2"><!-- 评论--><div class="review-wrapper"><h3 class="review">我从来没有吃过比 Dino's 一顿美餐差的东西."</h3><p>- Brittani <a href="#"><i class="fab fa-yelp"></i></a></p>

<div class="review-wrapper"><h3 class="review">披萨是我吃过的最好的!我们肯定会再次订购."</h3><p>- 米歇尔<a href="#"><i class="fab fa-yelp"></i></a></p>

<div class="review-wrapper"><h3 class="review">这是迄今为止我附近最好的披萨.从那以后我就再也没有从其他地方买过披萨……"</h3><p>- 凯文 <a href="#"><i class="fab fa-facebook-f"></i></a></p>

<div class="review-wrapper"><h3 class="review">我无法停止吃披萨.他们使用的披萨皮中有一些东西除了天堂之外是无法形容的."</h3><p>- 马修<a href="#"><i class="fab fa-yelp"></i></a></p>

<div class="review-wrapper"><h3 class="review">直到现在我还没有找到完美的披萨店,你们每次都很满意!"</h3><p>- J.C.<a href="#"><i class="fab fa-yelp"></i></a></p><div class="review-wrapper"><h3 class="review">工作人员超级友好,披萨也很棒!!这是迄今为止我在德克萨斯吃过的最好的披萨!!!"</h3><p>- 本杰明<a href="#"><i class="fab fa-facebook-f"></i></a></p>

<!-- 联系方式--><div class="footer-wrapper"><页脚><div class="footer-social"><a href="#"><i class="fab fa-yelp social"></i></a><a href="#"><i class="fab fa-facebook-f social"></i></a><a href="#"><i class="fab fa-twitter social"></i></a>

<div class="footer-cred"><p>创建者</p>

</页脚>

</scroll-container></html>

解决方案

您只需要将 scroll-behavior: smooth; 添加到您的 html 样式中即可.

见下面的片段:

/* 主体样式 */身体 {边距:0;宽度:100%;高度:自动;box-sizing: 边框框;文本对齐:居中;背景色:#f9f9f9;background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%238b8b8b' fill-opacity='0.07' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");字体系列:var(--main-font);}html{滚动行为:平滑;}一种 {光标:指针;大纲:无;文字装饰:无;}小时{边框:0;高度:1px;边距:0 0 1.5em 0;背景图像:-webkit-线性梯度(左,#f0f0f0,#8c8b8b,#f0f0f0);背景图像:-moz-线性渐变(左,#f0f0f0,#8c8b8b,#f0f0f0);背景图像:-ms-线性梯度(左,#f0f0f0,#8c8b8b,#f0f0f0);背景图像:-o-线性梯度(左,#f0f0f0,#8c8b8b,#f0f0f0);}.hr2 {边距:0 自动;宽度:50%;}.滚动框{滚动行为:平滑;溢出-y:滚动;}:根 {--main-box-shadow:-5px 6px 59px -4px rgba(77,77,77,1);--主色:#d30404;--main-text-shadow: 0px 3px 6px rgba(150, 150, 150, 1);--fancy-font: 'Rock Salt',草书;--main-font: 'Raleway', sans-serif;}/* 标题 */.header-image {背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/header.jpg');背景尺寸:封面;背景位置:中心;背景附件:固定;宽度:100%;高度:40em;}.header-wrapper {填充顶部:1.5em;}.header-logo {边距:0;填充底部:1.25em;颜色:#d30404;font-family: 'Rock Salt',草书;字体大小:5em;文本阴影:-2px 2px 7px rgba(0, 0, 0, .25);字母间距:0.115em;}.menu-btn {边界:无;边界半径:2em;填充:1em 3.25em;背景:#d30404;颜色:#efefef;box-shadow: 0px 30px 95px -15px rgba(0,0,0,.5);字体大小:1.15em;}/* 营业时间 */.小时包装{背景颜色:红色;}.hours-header {边距:0;}.小时列表{列表样式:无;填充:0;}/* 导航栏 */.nav {边距:0;}.菜单框{背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/menu.jpg');}.deals-box {背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/dough.jpg');}.about-box {背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/storefront.jpg');}.contact-box {背景图片:url('/Users/rogerjorns/Desktop/DinosMain/assets/img/oven.jpg');}.box-logo {边距:0;填充:1.5em;白颜色;字体大小:2em;font-family: 'Rock Salt',草书;文本阴影:-2px 2px 7px rgba(0, 0, 0, .25);}.盒子 {框阴影:插入-1px 1px 43px -9px rgba(0,0,0,1);背景位置:中心;背景尺寸:封面;背景附件:滚动;宽度:100%;高度:10em;}/* 菜单 */.menu-title {颜色:#d30404;font-family: 'Rock Salt',草书;字体大小:4em;边距:0;填充:1em 0 .25em 0;文本阴影:var(--main-text-shadow);}.menu-gallery {显示:弹性;flex-wrap: 包裹;justify-content: 空间环绕;}.菜单项{边距:2em 0;}.menu-pic {宽度:自动;高度:15em;边距:0.5em;框阴影:-12px 11px 39px -12px rgba(0,0,0,0.81);}.pic2,.pic6 {宽度:95%;}.菜单标题{font-family: 'Raleway', sans-serif;字体粗细:更粗;字体大小:1.5em;}/* 交易 */.交易包装{填充:1.5em 0;}.交易 {边距:0;颜色:#d30404;font-family: 'Rock Salt',草书;字体大小:3em;文本阴影:var(--main-text-shadow);}.deal-img {宽度:自动;高度:15em;边距:1em;框阴影:-12px 11px 39px -12px rgba(0,0,0,0.81);}/* 关于 */.关于 {颜色:#d30404;font-family: 'Rock Salt',草书;字体大小:3.5em;边距:0;文本阴影:var(--main-text-shadow);}.store-pic {边距:2em 0;宽度:100%;高度:自动;box-shadow: -1px 3px 17px -4px rgba(150,150,150,0.8);}.about-par {font-family: 'Raleway', sans-serif;字体大小:1.115em;行高:180%;填充:1.35em 0;边距:0 自动;最大宽度:33ch;}/* 评论 */.review 包装器 {填充顶部:2em;}.审查 {显示:弹性;flex-wrap: 包裹;justify-content: 空间环绕;字体系列:'Nunito',无衬线;字体样式:斜体;最大宽度:32ch;边距:0 自动;}.fa-yelp {颜色:#d32323;}.fa-facebook-f {颜色:#3b5998;}/*页脚*/.footer-wrapper {背景颜色:#d30404;box-shadow: 插入 0px 1px 52px -10px rgba(0, 0, 0, .115);宽度:100%;高度:5em;显示:弹性;对齐内容:居中;}.footer-social {显示:弹性;justify-content: 空间环绕;填充:.75em 0;}.社会的 {白颜色;文本阴影:-3px 2px 5px rgba(0, 0, 0, 0.25);}.footer-cred {字体大小:.75em;白颜色;文本阴影:-3px 2px 5px rgba(0, 0, 0, 0.25);}

<html lang="zh-cn" dir="ltr"><头><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>恐龙披萨</title><link rel="stylesheet" href="/Users/rogerjorns/Desktop/DinosMain/assets/index.css"><link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway|Rock+Salt|Nunito" rel="stylesheet"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css"integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3Bc12p";<身体><!-- 标题--><header class="header-image"><div class="header-wrapper"><h1 class="header-logo">Dino's Pizza</h1>

<a href="menu" class="menu-btn">查看我们的菜单</a></标题><!-- 营业时间--><div class="hours-wrapper"><h2 class="hours-header">营业时间</h2><ul class="小时列表"><li class="hours">** 周一闭馆 **</li><li class="hours">周二至周四:上午 11 点至晚上 8 点</li><li class="hours">周五至周六:上午 11 点至晚上 9 点</li><li class="hours">周日:下午 2 点 - 8 点</li>

<!-- 导航栏--><div class="nav"><div href="#menu" class="menu-box box"><a href="#menu"><h2 class="box-logo">Menu</h2></a>

<div href="#deals" class="deals-box box"><a href="#deals"><h2 class="box-logo">Deals</h2></a>

<div href="#about" class="about-box box"><a href="#about"><h2 class="box-logo">关于我们</h2></a>

<div href="#contact" class="contact-box box"><a href="#contact"><h2 class="box-logo">联系方式</h2></a>

<滚动容器><!-- 菜单--><div class="menu-wrapper"><h1 id="menu" class="menu-title title scrolling-box">Menu</h1><小时><div class="menu-gallery"><div class="menu-item"><img class="menu-pic pic1" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/allmeat.jpg" alt=""><h3 class="menu-heading">全肉</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic2" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/hawaiian.jpg" alt=""><h3 class="menu-heading">夏威夷语</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic3" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/veggie.jpg" alt=""><h3 class="menu-heading">Veggie</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic4" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/onetopping.jpg" alt=""><h3 class="menu-heading">一个浇头</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic5" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/twotopping.jpg" alt=""><h3 class="menu-heading">两个Topping</h3><p class="menu-price">$11.95</p>

<div class="menu-item"><img class="menu-pic pic6" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/cheesybread.jpg" alt=""><h3 class="menu-heading">奶酪面包</h3><p class="menu-price">$11.95</p>

<小时><!-- 优惠--><div class="deal-wrapper"><scroll-page><h2 id="deals" class="deals scrolling-box">Deals</h2></scroll-page><hr class="hr2"><img class="deal-img" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/deal.jpg" alt=""><img class="deal-img" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/deal2.jpg" alt="">

<!-- 关于我们--><小时><div class="about-wrapper"><h2 id="about" class="about scrolling-box">关于我们</h2><hr class="hr2"><img class="store-pic" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/storefront.jpg" alt=""><hr class="hr2"><p class="about-par">怀着多年从事餐饮业的志向,我们的梦想在 2014 年 5 月成为现实,当时我们在德克萨斯州蓝丘市打开了 Dino's Pizza 的大门.满怀热情提供镇上最美味的比萨饼和翅膀,由优质原料制成,我们期待您作为我们餐厅的客人或直接送货上门.</p><br><p class="about-par">在 Dino's Pizza,我们为以最专业、友善、正直和清洁为客户服务而感到自豪.我们每天从头开始制作新鲜的披萨面团.Dino's 致力于日复一日地提供美味、热的自制比萨饼和美味的翅膀.</p><br><p class="about-par">Dino's Pizza 是家族所有和经营的.我们新鲜制作的面团、自制酱汁和真正的奶酪丝会让您尝到与众不同!我们开胃可口的鸡翅和甜点是首屈一指的!</p><p class="about-par">不要只相信我们的话...看看我们的忠实客户怎么说在 Yelp 上,然后订购并准备品尝并亲自体验精彩!恐龙之路!</p>

<hr class="hr2"><!-- 评论--><div class="review-wrapper"><h3 class="review">我从来没有吃过比 Dino's 一顿美餐差的东西."</h3><p>- Brittani <a href="#"><i class="fab fa-yelp"></i></a></p>

<div class="review-wrapper"><h3 class="review">披萨是我吃过的最好的!我们肯定会再次订购."</h3><p>- 米歇尔<a href="#"><i class="fab fa-yelp"></i></a></p>

<div class="review-wrapper"><h3 class="review">这是迄今为止我附近最好的披萨.从那以后我就再也没有从其他地方买过披萨……"</h3><p>- 凯文 <a href="#"><i class="fab fa-facebook-f"></i></a></p>

<div class="review-wrapper"><h3 class="review">我无法停止吃披萨.他们使用的披萨皮中有一些东西除了天堂之外是无法形容的."</h3><p>- 马修<a href="#"><i class="fab fa-yelp"></i></a></p>

<div class="review-wrapper"><h3 class="review">直到现在我还没有找到完美的披萨店,你们每次都很满意!"</h3><p>- J.C.<a href="#"><i class="fab fa-yelp"></i></a></p><div class="review-wrapper"><h3 class="review">工作人员超级友好,披萨也很棒!!这是迄今为止我在德克萨斯吃过的最好的披萨!!!"</h3><p>- 本杰明<a href="#"><i class="fab fa-facebook-f"></i></a></p>

<!-- 联系方式--><div class="footer-wrapper"><页脚><div class="footer-social"><a href="#"><i class="fab fa-yelp social"></i></a><a href="#"><i class="fab fa-facebook-f social"></i></a><a href="#"><i class="fab fa-twitter social"></i></a>

<div class="footer-cred"><p>创建者</p>

</页脚>

</滚动容器></html>

您也可以在此处进行测试

So I have tried everything I checked a whole bunch of sites and it just won't do it. I am trying to get scroll-behavior to work on this site. I have put the scroll-container put ids fixed css but it is just not working. Any ideas as to why smooth-scrolling is NOT working on this? Basically What I need is the navbar area smooth scroll to the appropriate areas on the page. So Menu to Menu, Deals to Deals, About to About etc...I can't figure out why the smooth scrolling isn't working. Any ideas? Thanks!

/* Main Body Styles */

body {
  margin: 0;
  width: 100%;
  height: auto;
  box-sizing: border-box;
  text-align: center;
  background-color: #f9f9f9;
  background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%238b8b8b' fill-opacity='0.07' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
  font-family: var(--main-font);
}

a {
  cursor: pointer;
  outline: none;
  text-decoration: none;
}

hr {
  border: 0;
  height: 1px;
  margin: 0 0 1.5em 0;
  background-image: -webkit-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -moz-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -ms-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -o-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
}

.hr2 {
  margin: 0 auto;
  width: 50%;
}

.scroll-box {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

:root {
  --main-box-shadow:-5px 6px 59px -4px rgba(77,77,77,1);
  --main-color: #d30404;
  --main-text-shadow: 0px 3px 6px rgba(150, 150, 150, 1);
  --fancy-font: 'Rock Salt', cursive;
  --main-font: 'Raleway', sans-serif;
}


/* Header */

.header-image {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/header.jpg');
  background-size:cover;
  background-position: center;
  background-attachment: fixed;
  width: 100%;
  height: 40em;
}

.header-wrapper {
  padding-top: 1.5em;
}

.header-logo {
  margin: 0;
  padding-bottom: 1.25em;
  color: #d30404;
  font-family: 'Rock Salt', cursive;
  font-size: 5em;
  text-shadow: -2px 2px 7px rgba(0, 0, 0, .25);
  letter-spacing: .115em;
}

.menu-btn {
  border: none;
  border-radius: 2em;
  padding: 1em 3.25em;
  background: #d30404;
  color: #efefef;
  box-shadow: 0px 30px 95px -15px rgba(0,0,0,.5);
  font-size: 1.15em;
}


/* Hours of Operation */

.hours-wrapper {
  background-color: red;
}

.hours-header {
  margin: 0;
}

.hours-list {
  list-style: none;
  padding: 0;
}


/* Navbar */

.nav {
  margin: 0;
}

.menu-box {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/menu.jpg');
}

.deals-box {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/dough.jpg');
}

.about-box {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/storefront.jpg');
}

.contact-box {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/oven.jpg');
}

.box-logo {
  margin: 0;
  padding: 1.5em;
  color: white;
  font-size: 2em;
  font-family: 'Rock Salt', cursive;
  text-shadow: -2px 2px 7px rgba(0, 0, 0, .25);
}

.box {
  box-shadow: inset -1px 1px 43px -9px rgba(0,0,0,1);
  background-position: center;
  background-size: cover;
  background-attachment: scroll;
  width: 100%;
  height: 10em;
}


/* Menu */

.menu-title {
  color: #d30404;
  font-family: 'Rock Salt', cursive;
  font-size: 4em;
  margin: 0;
  padding: 1em 0 .25em 0;
  text-shadow: var(--main-text-shadow);
}

.menu-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
}

.menu-item {
  margin: 2em 0;
}

.menu-pic {
  width: auto;
  height: 15em;
  margin: .5em;
  box-shadow: -12px 11px 39px -12px rgba(0,0,0,0.81);
}

.pic2,
.pic6 {
  width: 95%;
}

.menu-heading {
  font-family: 'Raleway', sans-serif;
  font-weight: bolder;
  font-size: 1.5em;
}

/* Deals */

.deal-wrapper {
  padding: 1.5em 0;
}

.deals {
  margin: 0;
  color: #d30404;
  font-family: 'Rock Salt', cursive;
  font-size: 3em;
  text-shadow: var(--main-text-shadow);
}

.deal-img {
  width: auto;
  height: 15em;
  margin: 1em;
  box-shadow: -12px 11px 39px -12px rgba(0,0,0,0.81);
}


/* About */

.about {
  color: #d30404;
  font-family: 'Rock Salt', cursive;
  font-size: 3.5em;
  margin: 0;
  text-shadow: var(--main-text-shadow);
}

.store-pic {
  margin: 2em 0;
  width: 100%;
  height: auto;
  box-shadow: -1px 3px 17px -4px rgba(150,150,150,0.8);
}

.about-par {
  font-family: 'Raleway', sans-serif;
  font-size: 1.115em;
  line-height: 180%;
  padding: 1.35em 0;
  margin: 0 auto;
  max-width: 33ch;
}

/* Reviews */

.review-wrapper {
  padding-top: 2em;
}


.review {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  font-family: 'Nunito', sans-serif;
  font-style: italic;
  max-width: 32ch;
  margin: 0 auto;
}

.fa-yelp {
  color: #d32323;
}

.fa-facebook-f {
  color: #3b5998;
}

/* Footer */

.footer-wrapper {
  background-color: #d30404;
  box-shadow: inset 0px 1px 52px -10px rgba(0, 0, 0, .115);
  width: 100%;
  height: 5em;
  display: flex;
  justify-content: center;
}

.footer-social {
  display: flex;
  justify-content: space-around;
  padding: .75em 0;
}

.social {
  color: white;
  text-shadow: -3px 2px 5px rgba(0, 0, 0, 0.25);
}

.footer-cred {
  font-size: .75em;
  color: white;
  text-shadow: -3px 2px 5px rgba(0, 0, 0, 0.25);
}

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Dinos Pizza</title>

    <link rel="stylesheet" href="/Users/rogerjorns/Desktop/DinosMain/assets/index.css">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway|Rock+Salt|Nunito" rel="stylesheet">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">

  </head>
  <body>


<!-- Header -->

    <header class="header-image">
      <div class="header-wrapper">
        <h1 class="header-logo">Dino's Pizza</h1>
      </div>
      <a href="menu" class="menu-btn">Check our Menu</a>
    </header>


<!-- Hours of Operation -->


  <div class="hours-wrapper">
    <h2 class="hours-header">Hours of Operation</h2>
    <ul class="hours-list">
      <li class="hours">** Closed Mondays **</li>
      <li class="hours">Tues - Thurs: 11am - 8pm</li>
      <li class="hours">Fri - Sat: 11am - 9pm</li>
      <li class="hours">Sun: 2pm - 8pm</li>
    </ul>
  </div>


<!-- Navbar -->

  <div class="nav">
    <div href="#menu" class="menu-box box">
      <a href="#menu"><h2 class="box-logo">Menu</h2></a>
    </div>
    <div href="#deals" class="deals-box box">
      <a href="#deals"><h2 class="box-logo">Deals</h2></a>
    </div>
    <div href="#about" class="about-box box">
      <a href="#about"><h2 class="box-logo">About Us</h2></a>
    </div>
    <div href="#contact" class="contact-box box">
      <a href="#contact"><h2 class="box-logo">Contact</h2></a>
    </div>
  </div>

  <scroll-container>


<!-- Menu -->

<div class="menu-wrapper">
    <h1 id="menu" class="menu-title title scrolling-box">Menu</h1>
    <hr>
  <div class="menu-gallery">

    <div class="menu-item">
      <img class="menu-pic pic1" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/allmeat.jpg" alt="">
      <h3 class="menu-heading">All-Meat</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic2" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/hawaiian.jpg" alt="">
      <h3 class="menu-heading">Hawaiian</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic3" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/veggie.jpg" alt="">
      <h3 class="menu-heading">Veggie</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic4" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/onetopping.jpg" alt="">
      <h3 class="menu-heading">One Topping</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic5" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/twotopping.jpg" alt="">
      <h3 class="menu-heading">Two Topping</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic6" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/cheesybread.jpg" alt="">
      <h3 class="menu-heading">Cheesy Bread</h3>
      <p class="menu-price">$11.95</p>
    </div>

  </div>
</div>

<hr>


<!-- Deals -->

<div class="deal-wrapper">
  <scroll-page><h2 id="deals" class="deals scrolling-box">Deals</h2></scroll-page>
  <hr class="hr2">
  <img class="deal-img" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/deal.jpg" alt="">
  <img class="deal-img" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/deal2.jpg" alt="">
</div>



<!-- About Us -->
<hr>

  <div class="about-wrapper">
    <h2 id="about" class="about scrolling-box">About Us</h2>
    <hr class="hr2">
    <img class="store-pic" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/storefront.jpg" alt="">
    <hr class="hr2">
    <p class="about-par">With aspirations to go into the restaurant business for many years,
      our dream became a reality in May 2014 when we opened the doors to Dino's Pizza in the great city of Blue Mound, TX.
      With a passion to serve up the best-tasting pizza and wings in town, made from quality ingredients,
      we look forward to having you as a guest at our restaurant or delivering straight to your door.</p>
      <br>
    <p class="about-par">At Dino's Pizza we pride ourselves in serving our customers with the utmost professionalism, friendliness, integrity and cleanliness.
      We make our pizza dough fresh from scratch daily.
      Dino's is committed to serving delicious, hot home-made tasting pizzas and savory wings day in and day out.</p>
      <br>
    <p class="about-par">Dino's Pizza is family-owned and operated.
      Our freshly made dough, homemade sauce, and real shredded cheese make a difference you will definitely taste!
      And our appetizing, flavorful chicken wingsand dessert options are second to none!</p>
    <p class="about-par">Don't just take our word for it...check out what our loyal customers have to say
      on Yelp, then order and be prepared to taste
      and experience awesomeness for yourself!  The Dino's Way!</p>
  </div>

  <hr class="hr2">


<!-- Reviews -->

  <div class="review-wrapper">
    <h3 class="review">"I've never had anything less than an outstanding meal from Dino's."</h3>
    <p> - Brittani <a href="#"><i class="fab fa-yelp"></i></a></p>
  </div>
  <div class="review-wrapper">
    <h3 class="review">"Pizza was some of the best I've ever eaten!  We will definitely be ordering again."</h3>
    <p> - Michelle <a href="#"><i class="fab fa-yelp"></i></a></p>
  </div>
  <div class="review-wrapper">
    <h3 class="review">"This is by far the Best pizza near me. I haven't bought pizza from anywhere else since..."</h3>
    <p> - Kevin <a href="#"><i class="fab fa-facebook-f"></i></a></p>
  </div>
  <div class="review-wrapper">
    <h3 class="review">"I couldn't stop eating the pizza. There's something in the crust they use that is impossible to describe other than heavenly."</h3>
    <p> - Matthew <a href="#"><i class="fab fa-yelp"></i></a></p>
  </div>
  <div class="review-wrapper">
    <h3 class="review">"I've yet to find the perfect pizza place until now and you guys nail it every time!"</h3>
    <p> - J.C. <a href="#"><i class="fab fa-yelp"></i></a></p>
  <div class="review-wrapper">
    <h3 class="review">"The staff is super friendly and the pizza is awesome!! This is by far the best pizza I've had in Texas!!!"</h3>
    <p> - Benjamin <a href="#"><i class="fab fa-facebook-f"></i></a></p>
  </div>


<!-- Contact -->

  <div class="footer-wrapper">
    <footer>
      <div class="footer-social">
        <a href="#"><i class="fab fa-yelp social"></i></a>
        <a href="#"><i class="fab fa-facebook-f social"></i></a>
        <a href="#"><i class="fab fa-twitter social"></i></a>
      </div>
      <div class="footer-cred">
        <p>Created by</p>
      </div>
    </footer>
  </div>


  </scroll-container>

  </body>
</html>

解决方案

You just need to add scroll-behavior: smooth; to your html style.

See the below Snippet:

/* Main Body Styles */

body {
  margin: 0;
  width: 100%;
  height: auto;
  box-sizing: border-box;
  text-align: center;
  background-color: #f9f9f9;
  background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%238b8b8b' fill-opacity='0.07' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
  font-family: var(--main-font);
}
html{
  scroll-behavior: smooth;
}

a {
  cursor: pointer;
  outline: none;
  text-decoration: none;
}

hr {
  border: 0;
  height: 1px;
  margin: 0 0 1.5em 0;
  background-image: -webkit-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -moz-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -ms-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
  background-image: -o-linear-gradient(left, #f0f0f0, #8c8b8b, #f0f0f0);
}

.hr2 {
  margin: 0 auto;
  width: 50%;
}

.scroll-box {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

:root {
  --main-box-shadow:-5px 6px 59px -4px rgba(77,77,77,1);
  --main-color: #d30404;
  --main-text-shadow: 0px 3px 6px rgba(150, 150, 150, 1);
  --fancy-font: 'Rock Salt', cursive;
  --main-font: 'Raleway', sans-serif;
}


/* Header */

.header-image {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/header.jpg');
  background-size:cover;
  background-position: center;
  background-attachment: fixed;
  width: 100%;
  height: 40em;
}

.header-wrapper {
  padding-top: 1.5em;
}

.header-logo {
  margin: 0;
  padding-bottom: 1.25em;
  color: #d30404;
  font-family: 'Rock Salt', cursive;
  font-size: 5em;
  text-shadow: -2px 2px 7px rgba(0, 0, 0, .25);
  letter-spacing: .115em;
}

.menu-btn {
  border: none;
  border-radius: 2em;
  padding: 1em 3.25em;
  background: #d30404;
  color: #efefef;
  box-shadow: 0px 30px 95px -15px rgba(0,0,0,.5);
  font-size: 1.15em;
}


/* Hours of Operation */

.hours-wrapper {
  background-color: red;
}

.hours-header {
  margin: 0;
}

.hours-list {
  list-style: none;
  padding: 0;
}


/* Navbar */

.nav {
  margin: 0;
}

.menu-box {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/menu.jpg');
}

.deals-box {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/dough.jpg');
}

.about-box {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/storefront.jpg');
}

.contact-box {
  background-image: url('/Users/rogerjorns/Desktop/DinosMain/assets/img/oven.jpg');
}

.box-logo {
  margin: 0;
  padding: 1.5em;
  color: white;
  font-size: 2em;
  font-family: 'Rock Salt', cursive;
  text-shadow: -2px 2px 7px rgba(0, 0, 0, .25);
}

.box {
  box-shadow: inset -1px 1px 43px -9px rgba(0,0,0,1);
  background-position: center;
  background-size: cover;
  background-attachment: scroll;
  width: 100%;
  height: 10em;
}


/* Menu */

.menu-title {
  color: #d30404;
  font-family: 'Rock Salt', cursive;
  font-size: 4em;
  margin: 0;
  padding: 1em 0 .25em 0;
  text-shadow: var(--main-text-shadow);
}

.menu-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
}

.menu-item {
  margin: 2em 0;
}

.menu-pic {
  width: auto;
  height: 15em;
  margin: .5em;
  box-shadow: -12px 11px 39px -12px rgba(0,0,0,0.81);
}

.pic2,
.pic6 {
  width: 95%;
}

.menu-heading {
  font-family: 'Raleway', sans-serif;
  font-weight: bolder;
  font-size: 1.5em;
}

/* Deals */

.deal-wrapper {
  padding: 1.5em 0;
}

.deals {
  margin: 0;
  color: #d30404;
  font-family: 'Rock Salt', cursive;
  font-size: 3em;
  text-shadow: var(--main-text-shadow);
}

.deal-img {
  width: auto;
  height: 15em;
  margin: 1em;
  box-shadow: -12px 11px 39px -12px rgba(0,0,0,0.81);
}


/* About */

.about {
  color: #d30404;
  font-family: 'Rock Salt', cursive;
  font-size: 3.5em;
  margin: 0;
  text-shadow: var(--main-text-shadow);
}

.store-pic {
  margin: 2em 0;
  width: 100%;
  height: auto;
  box-shadow: -1px 3px 17px -4px rgba(150,150,150,0.8);
}

.about-par {
  font-family: 'Raleway', sans-serif;
  font-size: 1.115em;
  line-height: 180%;
  padding: 1.35em 0;
  margin: 0 auto;
  max-width: 33ch;
}

/* Reviews */

.review-wrapper {
  padding-top: 2em;
}


.review {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  font-family: 'Nunito', sans-serif;
  font-style: italic;
  max-width: 32ch;
  margin: 0 auto;
}

.fa-yelp {
  color: #d32323;
}

.fa-facebook-f {
  color: #3b5998;
}

/* Footer */

.footer-wrapper {
  background-color: #d30404;
  box-shadow: inset 0px 1px 52px -10px rgba(0, 0, 0, .115);
  width: 100%;
  height: 5em;
  display: flex;
  justify-content: center;
}

.footer-social {
  display: flex;
  justify-content: space-around;
  padding: .75em 0;
}

.social {
  color: white;
  text-shadow: -3px 2px 5px rgba(0, 0, 0, 0.25);
}

.footer-cred {
  font-size: .75em;
  color: white;
  text-shadow: -3px 2px 5px rgba(0, 0, 0, 0.25);
}

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Dinos Pizza</title>

    <link rel="stylesheet" href="/Users/rogerjorns/Desktop/DinosMain/assets/index.css">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway|Rock+Salt|Nunito" rel="stylesheet">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">

  </head>
  <body>


<!-- Header -->

    <header class="header-image">
      <div class="header-wrapper">
        <h1 class="header-logo">Dino's Pizza</h1>
      </div>
      <a href="menu" class="menu-btn">Check our Menu</a>
    </header>


<!-- Hours of Operation -->


  <div class="hours-wrapper">
    <h2 class="hours-header">Hours of Operation</h2>
    <ul class="hours-list">
      <li class="hours">** Closed Mondays **</li>
      <li class="hours">Tues - Thurs: 11am - 8pm</li>
      <li class="hours">Fri - Sat: 11am - 9pm</li>
      <li class="hours">Sun: 2pm - 8pm</li>
    </ul>
  </div>


<!-- Navbar -->

  <div class="nav">
    <div href="#menu" class="menu-box box">
      <a href="#menu"><h2 class="box-logo">Menu</h2></a>
    </div>
    <div href="#deals" class="deals-box box">
      <a href="#deals"><h2 class="box-logo">Deals</h2></a>
    </div>
    <div href="#about" class="about-box box">
      <a href="#about"><h2 class="box-logo">About Us</h2></a>
    </div>
    <div href="#contact" class="contact-box box">
      <a href="#contact"><h2 class="box-logo">Contact</h2></a>
    </div>
  </div>

  <scroll-container>


<!-- Menu -->

<div class="menu-wrapper">
    <h1 id="menu" class="menu-title title scrolling-box">Menu</h1>
    <hr>
  <div class="menu-gallery">

    <div class="menu-item">
      <img class="menu-pic pic1" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/allmeat.jpg" alt="">
      <h3 class="menu-heading">All-Meat</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic2" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/hawaiian.jpg" alt="">
      <h3 class="menu-heading">Hawaiian</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic3" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/veggie.jpg" alt="">
      <h3 class="menu-heading">Veggie</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic4" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/onetopping.jpg" alt="">
      <h3 class="menu-heading">One Topping</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic5" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/twotopping.jpg" alt="">
      <h3 class="menu-heading">Two Topping</h3>
      <p class="menu-price">$11.95</p>
    </div>

    <div class="menu-item">
      <img class="menu-pic pic6" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/cheesybread.jpg" alt="">
      <h3 class="menu-heading">Cheesy Bread</h3>
      <p class="menu-price">$11.95</p>
    </div>

  </div>
</div>

<hr>


<!-- Deals -->

<div class="deal-wrapper">
  <scroll-page><h2 id="deals" class="deals scrolling-box">Deals</h2></scroll-page>
  <hr class="hr2">
  <img class="deal-img" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/deal.jpg" alt="">
  <img class="deal-img" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/deal2.jpg" alt="">
</div>



<!-- About Us -->
<hr>

  <div class="about-wrapper">
    <h2 id="about" class="about scrolling-box">About Us</h2>
    <hr class="hr2">
    <img class="store-pic" src="/Users/rogerjorns/Desktop/DinosMain/assets/img/storefront.jpg" alt="">
    <hr class="hr2">
    <p class="about-par">With aspirations to go into the restaurant business for many years,
      our dream became a reality in May 2014 when we opened the doors to Dino's Pizza in the great city of Blue Mound, TX.
      With a passion to serve up the best-tasting pizza and wings in town, made from quality ingredients,
      we look forward to having you as a guest at our restaurant or delivering straight to your door.</p>
      <br>
    <p class="about-par">At Dino's Pizza we pride ourselves in serving our customers with the utmost professionalism, friendliness, integrity and cleanliness.
      We make our pizza dough fresh from scratch daily.
      Dino's is committed to serving delicious, hot home-made tasting pizzas and savory wings day in and day out.</p>
      <br>
    <p class="about-par">Dino's Pizza is family-owned and operated.
      Our freshly made dough, homemade sauce, and real shredded cheese make a difference you will definitely taste!
      And our appetizing, flavorful chicken wingsand dessert options are second to none!</p>
    <p class="about-par">Don't just take our word for it...check out what our loyal customers have to say
      on Yelp, then order and be prepared to taste
      and experience awesomeness for yourself!  The Dino's Way!</p>
  </div>

  <hr class="hr2">


<!-- Reviews -->

  <div class="review-wrapper">
    <h3 class="review">"I've never had anything less than an outstanding meal from Dino's."</h3>
    <p> - Brittani <a href="#"><i class="fab fa-yelp"></i></a></p>
  </div>
  <div class="review-wrapper">
    <h3 class="review">"Pizza was some of the best I've ever eaten!  We will definitely be ordering again."</h3>
    <p> - Michelle <a href="#"><i class="fab fa-yelp"></i></a></p>
  </div>
  <div class="review-wrapper">
    <h3 class="review">"This is by far the Best pizza near me. I haven't bought pizza from anywhere else since..."</h3>
    <p> - Kevin <a href="#"><i class="fab fa-facebook-f"></i></a></p>
  </div>
  <div class="review-wrapper">
    <h3 class="review">"I couldn't stop eating the pizza. There's something in the crust they use that is impossible to describe other than heavenly."</h3>
    <p> - Matthew <a href="#"><i class="fab fa-yelp"></i></a></p>
  </div>
  <div class="review-wrapper">
    <h3 class="review">"I've yet to find the perfect pizza place until now and you guys nail it every time!"</h3>
    <p> - J.C. <a href="#"><i class="fab fa-yelp"></i></a></p>
  <div class="review-wrapper">
    <h3 class="review">"The staff is super friendly and the pizza is awesome!! This is by far the best pizza I've had in Texas!!!"</h3>
    <p> - Benjamin <a href="#"><i class="fab fa-facebook-f"></i></a></p>
  </div>


<!-- Contact -->

  <div class="footer-wrapper">
    <footer>
      <div class="footer-social">
        <a href="#"><i class="fab fa-yelp social"></i></a>
        <a href="#"><i class="fab fa-facebook-f social"></i></a>
        <a href="#"><i class="fab fa-twitter social"></i></a>
      </div>
      <div class="footer-cred">
        <p>Created by</p>
      </div>
    </footer>
  </div>


  </scroll-container>

  </body>
</html>

You can test it here as well

这篇关于CSS 中的平滑滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆