当前位置: 首页 > news >正文

meetsh网站建设搜索引擎有哪些技巧

meetsh网站建设,搜索引擎有哪些技巧,什么软件比百度搜索好,wordpress时间文件夹这一篇文章中,我会教你如何做一个AirBnb Experiences的克隆网站。主要涵盖React中Props的使用。 克隆网站最终呈现的效果: 1. 使用vite构建基础框架 npm create vitelatestcd airbnb-project npm install npm run dev2. 构建网站的3个部分 网站从上…

这一篇文章中,我会教你如何做一个AirBnb Experiences的克隆网站。主要涵盖React中Props的使用。

克隆网站最终呈现的效果:
在这里插入图片描述

1. 使用vite构建基础框架

npm create vite@latestcd airbnb-project
npm install
npm run dev

2. 构建网站的3个部分

网站从上至下主要分为导航栏、简介和活动栏三个部分。
我们在public文件夹之下建立components文件夹,然后分别建立Navbar.jsx,Hero.jsx和Card.jsx这三个文件,分别对应网站的三个部分。
另外,在public文件夹之下建立images文件夹,包含网站要用的所有图片。
在这里插入图片描述
photo-grid.png
在这里插入图片描述
wedding-photography.png
在这里插入图片描述
mountain-bike.png
在这里插入图片描述
airbnb-logo.png
在这里插入图片描述
katie-zaferes.png
在这里插入图片描述
star.png

3. 删除index.css中的所有内容

index.css

* {box-sizing: border-box;
}body {margin: 0;font-family: 'Poppins', sans-serif;
}

4. 导航栏

Navbar.jsx

export default function Navbar() {return (<nav><img src="/images/airbnb-logo.png" className="nav--logo"/></nav>)
}

对应的index.css中的内容。

nav {height: 70px;display: flex;padding: 20px 36px;box-shadow: 0px 2.98256px 7.4564px rgba(0, 0, 0, 0.1);
}.nav--logo {max-width: 100px;
}

5. 简介栏

Hero.jsx

export default function Hero() {return (<section className="hero"><img src="/images/photo-grid.png" className="hero-photo" /><h1 className="hero-header">Online Experiences</h1><p className="hero--text">Join unique interactive activities led by one-of-a-kind hosts-all without leaving home.</p></section>)
}

对应的index.css中的内容。

section {padding: 20px;
}.hero {display: flex;flex-direction: column;
}.hero--photo {max-width: 400px;align-self: center;
}.hero--header {margin-bottom: 16px;
}.hero--text {margin-top: 0;
}

6. 活动栏

Card.jsx

export default function Card(props) {let badgeTextif (props.item.openSpots === 0){badgeText = "SOLD OUT"} else if (props.item.location === "Online"){badgeText = "ONLINE"}return (<div className="card">{badgeText && <div className="card--badge">{badgeText}</div>}<img src={`/images/${props.item.coverImg}` }className="card--image"alt="Image of Katie Zaferes."/><div className="card--stats"><img src="/images/star.png" className="card--star"alt="Star icon."    /><span>{props.item.stats.rating}</span><span className="gray">({props.item.stats.reviewCount}) · </span><span className="gray">{props.item.location}</span></div><h2>{props.item.title}</h2><p><span className="bold">From ${props.item.price}</span> / person</p></div>)
}

对应的index.css中的内容。

.card {width: 175px;font-size: 0.75rem;flex: 0 0 auto;display: flex;flex-direction: column;position: relative
}.card--image {width: 100%;border-radius: 9px;margin-bottom: 9px;
}.card--title {overflow: hidden;text-overflow: ellipsis;
}.card--stats {display: flex;align-items: center;
}.card--star {height: 14px;
}.card--price {margin-top: auto;
}.card--badge{position: absolute;top: 6px;left: 6px;background-color: white;padding: 5px 7px;border-radius: 2px;font-weight: bold;
}h2 {font-size: 0.75rem;font-weight: normal;
}.gray {color: #918E9B;
}.bold {font-weight: bold;
}

7. 删除App.css中的所有内容

8. 准备需要的数据

在src文件夹之下建立data.jsx文件,准备在活动栏中需要呈现的内容。
data.jsx

export default [{id: 1,title: "Life Lessons with Katie Zaferes",description: "I will share with you what I call \"Positively Impactful Moments of Disappointment.\" Throughout my career, many of my highest moments only came after setbacks and losses. But learning from those difficult moments is what gave me the ability to rise above them and reach my goals.",price: 136,coverImg: "katie-zaferes.png",stats: {rating: 5.0,reviewCount: 6},location: "Online",openSpots: 0,},{id: 2,title: "Learn Wedding Photography",description: "Interested in becoming a wedding photographer? For beginner and experienced photographers alike, join us in learning techniques required to leave the happy couple with memories that'll last a lifetime.",price: 125,coverImg: "wedding-photography.png",stats: {rating: 5.0,reviewCount: 30},location: "Online",openSpots: 27,},{id: 3,title: "Group Mountain Biking",description: "Experience the beautiful Norwegian landscape and meet new friends all while conquering rugged terrain on your mountain bike. (Bike provided!)",price: 50,coverImg: "mountain-bike.png",stats: {rating: 4.8,reviewCount: 2},location: "Norway",openSpots: 3,}
]

9. 更新App.jsx中的内容

App.jsx

import Navbar from "../public/components/Navbar"
import Hero from "../public/components/Hero"
import Card from "../public/components/Card"
import data from "./data"export default function App() {const cards = data.map(item => {return (<Cardkey = {item.id}item = {item}/>)})return (<div><Navbar /><Hero /><section className="cards--list">{cards}</section></div>)
}

对应的index.css中的内容。

.cards--list {display: flex;flex-wrap: nowrap;gap: 20px;overflow-x: auto;
}

10. 完整的index.css

* {box-sizing: border-box;
}body {margin: 0;font-family: 'Poppins', sans-serif;
}nav {height: 70px;display: flex;padding: 20px 36px;box-shadow: 0px 2.98256px 7.4564px rgba(0, 0, 0, 0.1);
}h2 {font-size: 0.75rem;font-weight: normal;
}.gray {color: #918E9B;
}.bold {font-weight: bold;
}.nav--logo {max-width: 100px;
}section {padding: 20px;
}.hero {display: flex;flex-direction: column;
}.hero--photo {max-width: 400px;align-self: center;
}.hero--header {margin-bottom: 16px;
}.hero--text {margin-top: 0;
}.cards--list {display: flex;flex-wrap: nowrap;gap: 20px;overflow-x: auto;
}.card {width: 175px;font-size: 0.75rem;flex: 0 0 auto;display: flex;flex-direction: column;position: relative
}.card--image {width: 100%;border-radius: 9px;margin-bottom: 9px;
}.card--title {overflow: hidden;text-overflow: ellipsis;
}.card--stats {display: flex;align-items: center;
}.card--star {height: 14px;
}.card--price {margin-top: auto;
}.card--badge{position: absolute;top: 6px;left: 6px;background-color: white;padding: 5px 7px;border-radius: 2px;font-weight: bold;
}

11. 上传到github

12. 上传到netlify

http://www.ysxn.cn/news/3618.html

相关文章:

  • 公司做网站的法律依据我想注册一个网站怎么注册
  • phpcms做双语网站河北电子商务seo
  • 自建国际网站做电商网络服务器的作用
  • 重庆永川网站建设报价济南做网站公司
  • 杭州哪里做网站好东营seo网站推广
  • 做淘宝客网站需要多大空间太原百度seo
  • 网站建设方案书是什么意思百度明令禁止搜索的词
  • 男女做爰视频免费网站googleseo排名公司
  • 龙岩做网站公司在哪里汕头seo推广外包
  • 黑马程序员培训在哪里厦门seo服务
  • 网站建设的客户提高百度快速排名
  • wordpress中css样式表seo是付费还是免费推广
  • 做网站前景推广软文平台
  • 网站企业备案改个人备案做seo要投入什么
  • 我想给赌博网站做代理seo推广外包
  • 沂南建设局网站佛山网站搜索排名
  • 如何通过网站开发客户网站品牌推广公司
  • 有的网站打开慢图片外链在线生成网址
  • 国内网站设计关于seo如何优化
  • 网站建设环境软件有哪些金昌网站seo
  • 长沙网站建设推广谷歌商店下载安装
  • wordpress上传excel文件seo怎么收费的
  • 查看网站开发语言方法一个自己的网站
  • 重庆地区专业做网站的公司seo优化网络推广
  • 恢复网址北京百度seo排名公司
  • 网站首页浮动广告怎么做浙江关键词优化
  • 个人网站 做外贸百度一下官方网页
  • 怎么看网站哪个公司做的app推广渠道在哪接的单子
  • 想学做网站学什么编程语言seo整站优化哪家好
  • 网站开发技术语言的选择账号权重查询入口站长工具