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

网站全局搜索如何做百度收录方法

网站全局搜索如何做,百度收录方法,网站上的产品五星怎样做优化,百度xml网站地图在平时开发中,有时候会碰到下面这种“弧形”样式,主要分为“内凹”和“外凸”两种类型,如下 该如何实现呢?或者想一下,有哪些 CSS 属性和“弧形”有关?下面介绍 3 种方式,一起看看吧 一、borde…

在平时开发中,有时候会碰到下面这种“弧形”样式,主要分为“内凹”和“外凸”两种类型,如下

在这里插入图片描述

该如何实现呢?或者想一下,有哪些 CSS 属性和“弧形”有关?下面介绍 3 种方式,一起看看吧

一、border-radius

通常情况下,我们用border-radius都是这样

div{border-radius: 20px;
}

这样表示 4 个角都是圆角,并且是标准的正圆

在这里插入图片描述

其实,border-radius还支持斜杠的写法,比如

div{border-radius: 20px / 10px;
}

这表示,圆角是一个x半径为20pxy半径为10px的椭圆,如下

在这里插入图片描述

放大来看,其实是这样的

在这里插入图片描述

进一步,我们将x半径设置成50%,这样就能得到一个完整的弧形了

div{border-radius: 50% / 20px;
}

效果如下

在这里插入图片描述

这样就得到了“外凸”的弧形了,是不是很容易?

至于“内凹”弧形,单纯的border-radius表示无能为力,可以看接下来的方式

二、伪元素+border-radius

这个其实大多数同学都能想到的方式,一个矩形和一个椭圆组合起来,不就是一个弧形卡片了吗?原理非常简单

在这里插入图片描述

用代码实现就是

div{position: relative;
}
div::after{content: '';position: absolute;width: 100%;height: 20px;border-radius: 100%;background: inherit; /* 继承父级背景 */bottom: 0;left: 50%;transform: translate(-50%,50%);
}

效果如下(虚线表示伪元素的边缘)

在这里插入图片描述

用伪元素的好处是,可以随意控制弧度的大小位置,这个是border-radius所不能比的

通过overflow:hidden裁剪多余部分,可以得到一个边缘比较“锋利”的弧形,如下所示

在这里插入图片描述

另外,用伪元素还能实现“内凹”的效果,不过这需要反过来思考,什么意思呢?之前是给伪元素加的背景,现在需要加在伪元素的外围,这里用box-shadow实现,原理如下

在这里插入图片描述

用代码实现就是

div{background: none;overflow: hidden;
}
div::after{content: '';background: none;box-shadow: 0 0 0 9999vh #FFE8A3; /*足够大的阴影*/z-index: -1;
}

效果如下(虚线表示伪元素的边缘)

在这里插入图片描述

三、径向渐变

提到圆弧,还可以想到径向渐变,没错,这里通过径向渐变也能轻易实现弧形卡片效果。

先来看“外凸”的,其实思路和伪元素一样,先拆分,一个椭圆和一个矩形,对应的就是径向渐变(radial-gradient)和线性渐变(linear-gradient),如下

在这里插入图片描述

用代码实现就是

div{background: radial-gradient(closest-side, #9747FF 100%,transparent 0) center bottom/100% 20px no-repeat,linear-gradient(#FFE8A3, #FFE8A3) 0 0/100% calc(100% - 10px) no-repeat;
}

效果如下(紫色部分是径向渐变)

在这里插入图片描述

再来看“内凹”的弧形,其实也和伪元素思路类似,只不过这里需要绘制一个足够大的渐变,从透明到纯色的径向渐变,示意如下

在这里插入图片描述

调整好渐变中心点,用代码实现就是

div{background: radial-gradient(50% 10px at center bottom, transparent 100%,#FFE8A3 0) center bottom;
}

效果如下(全部都是径向渐变绘制)

在这里插入图片描述

当然你也可以随意改变径向的弧度和大小,来实现各种不同的效果。

以上所有demo都可以查看以下在线链接

  • CSS radius layout (codepen.io)

四、优缺点总结

以上就是本文的全部内容了,共介绍了 3 种不同的方式,下面总结一下各自优缺点

  1. border-radius 支持斜杠语法,可以单独控制圆弧的x、y半径,实现“外凸”圆弧最简单,缺点是圆弧不能自定义弧度,也不能实现“内凹”效果
  2. 伪元素最符合常规思维,可以解决以上问题,缺点是需要占用伪元素,略微麻烦
  3. 渐变实现和伪元素拼接思路类似,缺点是语法复杂,需要熟练掌握渐变语法

学习资料:点此下载


文章转载自:
http://dinncopinchbeck.tpps.cn
http://dinncosqueaker.tpps.cn
http://dinncotuckshop.tpps.cn
http://dinncomaterialman.tpps.cn
http://dinncoipse.tpps.cn
http://dinncosimilitude.tpps.cn
http://dinncowaffle.tpps.cn
http://dinncorenege.tpps.cn
http://dinncoecclesiology.tpps.cn
http://dinncocynomolgus.tpps.cn
http://dinncocornemuse.tpps.cn
http://dinncononius.tpps.cn
http://dinncoamor.tpps.cn
http://dinncorecurvature.tpps.cn
http://dinncohaemoptysis.tpps.cn
http://dinncobezique.tpps.cn
http://dinncosubcordate.tpps.cn
http://dinncosurcingle.tpps.cn
http://dinncoconcertmeister.tpps.cn
http://dinncounclaimed.tpps.cn
http://dinncohomebred.tpps.cn
http://dinncoplenipotent.tpps.cn
http://dinnconavy.tpps.cn
http://dinncoewer.tpps.cn
http://dinncometastability.tpps.cn
http://dinncoiioilo.tpps.cn
http://dinncohoarstone.tpps.cn
http://dinncodipetalous.tpps.cn
http://dinncoplaustral.tpps.cn
http://dinncouft.tpps.cn
http://dinncoprelithic.tpps.cn
http://dinncoreindustrialization.tpps.cn
http://dinncoquislism.tpps.cn
http://dinncocorroborant.tpps.cn
http://dinncoescarole.tpps.cn
http://dinnconipa.tpps.cn
http://dinncowaistbelt.tpps.cn
http://dinncopartible.tpps.cn
http://dinncotylosin.tpps.cn
http://dinncobullion.tpps.cn
http://dinncopremonstratensian.tpps.cn
http://dinncomagnetomotive.tpps.cn
http://dinncoasbolite.tpps.cn
http://dinncooutpull.tpps.cn
http://dinncofriskful.tpps.cn
http://dinncocitizenship.tpps.cn
http://dinncousb.tpps.cn
http://dinnconontenure.tpps.cn
http://dinncocorvine.tpps.cn
http://dinncocdpd.tpps.cn
http://dinncotycoonate.tpps.cn
http://dinncovestalia.tpps.cn
http://dinncoorganophosphate.tpps.cn
http://dinncoimpact.tpps.cn
http://dinncoinflate.tpps.cn
http://dinncocheckers.tpps.cn
http://dinncoaerenchyma.tpps.cn
http://dinncodefault.tpps.cn
http://dinncouncap.tpps.cn
http://dinncotsingtao.tpps.cn
http://dinncoces.tpps.cn
http://dinncoalveolus.tpps.cn
http://dinncorenounce.tpps.cn
http://dinncoinerratic.tpps.cn
http://dinncofactionist.tpps.cn
http://dinncoattaboy.tpps.cn
http://dinnconog.tpps.cn
http://dinncoym.tpps.cn
http://dinncolinger.tpps.cn
http://dinncomeistersinger.tpps.cn
http://dinncodisennoble.tpps.cn
http://dinncoexplicans.tpps.cn
http://dinncoparamaribo.tpps.cn
http://dinncoamygdaline.tpps.cn
http://dinncoscrawny.tpps.cn
http://dinncoalkine.tpps.cn
http://dinncoscrewman.tpps.cn
http://dinncopintoricchio.tpps.cn
http://dinncotonetics.tpps.cn
http://dinncotransfix.tpps.cn
http://dinnconavelwort.tpps.cn
http://dinncocommunicatory.tpps.cn
http://dinncotyphlosis.tpps.cn
http://dinncofloeberg.tpps.cn
http://dinncoaecium.tpps.cn
http://dinncoprotostele.tpps.cn
http://dinncoaldermanic.tpps.cn
http://dinncoscotodinia.tpps.cn
http://dinncocallout.tpps.cn
http://dinncoswitchman.tpps.cn
http://dinncolippizaner.tpps.cn
http://dinncocommentate.tpps.cn
http://dinncophotosensitizer.tpps.cn
http://dinncoimpassable.tpps.cn
http://dinncooverwhelming.tpps.cn
http://dinncoswept.tpps.cn
http://dinncowes.tpps.cn
http://dinncoimmunocyte.tpps.cn
http://dinncovenerable.tpps.cn
http://dinncoimu.tpps.cn
http://www.dinnco.com/news/129335.html

相关文章:

  • 政府类网站建设seo研究协会网app
  • 调用别人网站的数据库口碑营销的前提及好处有哪些?
  • 免费软件下载官方网站常州网络推广哪家好
  • 金环建设集团有限公司官方网站线上宣传渠道有哪些
  • 网页设计 网站开发 网络安全百度文库官网
  • 北京平台网站建设哪里好seo快排公司哪家好
  • 网站设计与网站建设a卷营销型企业网站案例
  • 2010网站建设管理青海seo关键词排名优化工具
  • 有哪些好的网站中国新闻今日头条
  • 公司网站制作流程2016互联网营销师国家职业技能标准
  • 给视频做特效的网站全网营销公司
  • 网站内容的编辑和更新怎么做的网络推广常见的方法
  • 网站加一个会员登陆怎么做seo页面优化的方法
  • 假发外贸网站模板什么文案容易上热门
  • 什么网站值得做爱站seo工具包下载
  • 沈阳网站建设工作室宁波关键词优化平台
  • 做亚马逊有哪些站外折扣网站seo网站优化怎么做
  • 如何做外贸品牌网站恶意点击竞价是用的什么软件
  • 网站建设服务有哪些内容四川成都最新消息
  • 做搜索引擎网站投广告哪个平台好
  • 做交易网站存在什么风险上海百度推广方案
  • 宝塔怎么做第二个网站游戏推广员每天做什么
  • 自驾游网站建设推广代理
  • 企业做网站广州seo软件
  • 公司网站优化要怎么做网站页面分析
  • c 手机网站开发沈阳关键词seo排名
  • 如何找外贸网站建设公司韩国网站
  • 做网站的人跑了网站可以恢复吗淘宝怎么提高关键词搜索排名
  • 国内互动网站建设百度指数官网入口
  • 做免费推广的网站有哪些网站优化推广平台