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

小说网站建设后如何赚钱seo自动推广工具

小说网站建设后如何赚钱,seo自动推广工具,只做移动端的网站,mixkit免费高清视频素材​ 是看的b站一个老哥的视频,做的汇总,讲的嘎嘎棒。视频链接:b站链接 视口viewport pc端视口就是可视化的窗口,不包含浏览器工具栏但是移动端,不太一样,布局的视口和可见的视口是不太一样的 移动端的网页…


是看的b站一个老哥的视频,做的汇总,讲的嘎嘎棒。视频链接:b站链接

视口viewport

  • pc端视口就是可视化的窗口,不包含浏览器工具栏
  • 但是移动端,不太一样,布局的视口和可见的视口是不太一样的
    • 移动端的网页窗口往往比较小,我们希望一个大的网页在移动端可以完成的显示
    • 所以在默认情况下,移动端的布局视口是大于视觉视口的

在这里插入图片描述

移动端,可以将视口划分为三种情况

  1. 布局视口(layout viewport)
  2. 视觉视口(visual layout)
  3. 理想视口(ideal layout)

布局视口

相对于980px布局的这个视口,称之为布局视图。默认宽度就是980px

首先要把这行代码去掉,不然看不了布局视口

<meta name="viewport" content="width=device-width, initial-scale=1.0">
  • 浏览器默认的布局视口其实是宽980px的大盒子,我们只关心宽,因为高可能会很高,还可以滚动

在这里插入图片描述

  • 浏览器查看移动端,浏览器会等比例的把980px缩成手机大小。所以你一开始设置的宽高,移动端的时候还是这个宽高,但是给人的感觉却是小了不小

代码验证:

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> --><title>Document</title><style>.box {width: 100px;height: 100px;background-color: pink;}</style>
</head><body><div class="box"></div>
</body></html>

pc端效果

在这里插入图片描述

移动端效果

在这里插入图片描述

布局视口总图解:

在这里插入图片描述

但是这种效果,明显不是我们想要的,我们想要的是相对与设备大小,而不是相对于980px

所以我们需要修改布局视口的宽度,以适应我们的需求

<meta name="viewport" content="width=device-width, initial-scale=1.0">
  • 通过content来指定布局视口的宽度

    • 这个属性只针对移动端,对pc端无效

    • 默认宽度一般都980pxcontent='width=980px'

    • 宽度越大,布局视口就越大,同比缩小到移动端上,则元素就看起来越小。反之则越大

    • 我们希望布局视口就是根绝设备的宽度来,设备宽度多少,则布局视口宽度就是多少

    • 所以就用到了device-width这个值,它就是设备宽度

视觉视口

就是移动端可见区域(屏幕)

在这里插入图片描述

理想视口

布局视口的宽,就等于移动设备的宽,就是理想视口。这样我们就能保证,给元素设定多少px,就是多少px

  • 也就是这行代码
<meta name="viewport" content="width=device-width, initial-scale=1.0">

元信息meta,name为viewport时,可以设置的属性

如图

在这里插入图片描述

真实移动端开发,会这样写

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0,maximum-scale=1.0">

移动端适配方案

  • 上面的viewport只是解决了视口问题。但是我们想要根据屏幕大小,让元素能有不同的宽高表现,则就需要适配。常见的适配方案,有以下几种

rem+媒体查询

rem是相对单位,相对于html标签的font-size字体大小。1rem = 1个html的字号大小

  • 核心就是用媒体查询,根绝屏幕大小给html设置不同的font-size字号大小,然后元素只需要给rem即可
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport"content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0,maximum-scale=1.0"><title>Document</title><style>@media only screen and (min-width: 320px) {html {font-size: 14px;}}@media only screen and (min-width: 480px) {html {font-size: 16px;}}@media only screen and (min-width: 540px) {html {font-size: 17px;}}@media only screen and (min-width: 640px) {html {font-size: 18px;}}@media only screen and (min-width: 720px) {html {font-size: 19px;}}@media only screen and (min-width: 750px) {html {font-size: 20px;}}* {padding: 0;margin: 0;}.app {width: 100%;height: 100%;}.box {display: flex;justify-content: space-between;}.box .left {width: 10rem;height: 10rem;background-color: pink;}.box .right {width: 10rem;height: 10rem;background-color: pink;}</style>
</head><body><div class="app"><div class="box"><div class="left">1</div><div class="right">2</div></div></div>
</body></html>

推荐一个好用的插件,可以直接把px转换为对应的remvw

在这里插入图片描述

  • 点击设置图标,进入设置页面

在这里插入图片描述

在设置页面进行rem设置

在这里插入图片描述

  • 如果给的是设计图是375的,这里就填37.5。如果是750,就写75

rem+flexible.js

  • 实时监听屏幕尺寸,然后根绝屏幕尺寸来动态的设置html字号的大小

简写版的,理解flexible用,真实开发千万别用这个

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport"content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0,maximum-scale=1.0"><title>Document</title><script>// 获取html元素const htmlEl = document.documentElement// 动态根据屏幕设置html字号大小function setRemUtil() {// 获取屏幕宽度let screenWidth = htmlEl.clientWidth// html元素的字号大小let htmlFontSize = screenWidth / 15console.log(htmlFontSize)// 设置给html字号htmlEl.style.fontSize = htmlFontSize + 'px'}// 进来的时候就调用一下,如果不调用,就会按16px走setRemUtil()// 监听屏幕尺寸变化window.addEventListener('resize', setRemUtil)</script><style>* {padding: 0;margin: 0;}.app {width: 100%;height: 100%;}.box {display: flex;justify-content: space-between;}.box .left {width: 5rem;height: 5rem;background-color: pink;}.box .right {width: 5rem;height: 5rem;background-color: pink;}</style>
</head><body><div class="app"><div class="box"><div class="left">1</div><div class="right">2</div></div></div>
</body></html>

完整版

flexible.js

;(function flexible(window, document) {var docEl = document.documentElementvar dpr = window.devicePixelRatio || 1// adjust body font sizefunction setBodyFontSize() {if (document.body) {document.body.style.fontSize = 12 * dpr + 'px'} else {document.addEventListener('DOMContentLoaded', setBodyFontSize)}}setBodyFontSize()// set 1rem = viewWidth / 15function setRemUnit() {var rem = docEl.clientWidth / 15docEl.style.fontSize = rem + 'px'}setRemUnit()// reset rem unit on page resizewindow.addEventListener('resize', setRemUnit)window.addEventListener('pageshow', function (e) {if (e.persisted) {setRemUnit()}})// detect 0.5px supportsif (dpr >= 2) {var fakeBody = document.createElement('body')var testElement = document.createElement('div')testElement.style.border = '.5px solid transparent'fakeBody.appendChild(testElement)docEl.appendChild(fakeBody)if (testElement.offsetHeight === 1) {docEl.classList.add('hairlines')}docEl.removeChild(fakeBody)}
})(window, document)

xxx.html

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport"content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0,maximum-scale=1.0"><title>Document</title><script src="./flexible.js"></script><style>* {padding: 0;margin: 0;}.app {width: 100%;height: 100%;}.box {display: flex;justify-content: space-between;}.box .left {width: 5rem;height: 5rem;background-color: pink;}.box .right {width: 5rem;height: 5rem;background-color: pink;}</style>
</head><body><div class="app"><div class="box"><div class="left">1</div><div class="right">2</div></div></div>
</body></html>

vw/vh(推荐)

vw就是把视口(屏幕)100等分,1vw = 1等份。vh同理。例如375的屏幕,1vw就是3.75px,到420的屏幕,1vw就是4.2px

可以使用上面的插件进行转换

在这里插入图片描述

  • 图线标注的地方,如果给的设计图是375的我们这里就写375。如果是750,就写750

然后我们就可以使用插件进行转换了

在这里插入图片描述


文章转载自:
http://dinncofootlocker.bkqw.cn
http://dinncoexempla.bkqw.cn
http://dinncorootage.bkqw.cn
http://dinncoeverything.bkqw.cn
http://dinncoanteorbital.bkqw.cn
http://dinncophyllotactical.bkqw.cn
http://dinncodashing.bkqw.cn
http://dinncomachiavelli.bkqw.cn
http://dinncopresession.bkqw.cn
http://dinncoimpersonate.bkqw.cn
http://dinncoimmunodepression.bkqw.cn
http://dinncodiglossic.bkqw.cn
http://dinncojube.bkqw.cn
http://dinncojudgeship.bkqw.cn
http://dinncoclx.bkqw.cn
http://dinncoleachy.bkqw.cn
http://dinncoentree.bkqw.cn
http://dinncolanguette.bkqw.cn
http://dinncohobodom.bkqw.cn
http://dinncobrassie.bkqw.cn
http://dinncolandskip.bkqw.cn
http://dinncobelay.bkqw.cn
http://dinncoundress.bkqw.cn
http://dinncoproctorial.bkqw.cn
http://dinncohaberdashery.bkqw.cn
http://dinncoservingman.bkqw.cn
http://dinncogiurgiu.bkqw.cn
http://dinncomiscarry.bkqw.cn
http://dinncozs.bkqw.cn
http://dinncobossdom.bkqw.cn
http://dinncounsanctioned.bkqw.cn
http://dinncociting.bkqw.cn
http://dinncotopoi.bkqw.cn
http://dinncosparkproof.bkqw.cn
http://dinncodonator.bkqw.cn
http://dinncohenpeck.bkqw.cn
http://dinncolegumina.bkqw.cn
http://dinncomoil.bkqw.cn
http://dinncoabortively.bkqw.cn
http://dinncobulky.bkqw.cn
http://dinncomethinks.bkqw.cn
http://dinncotuberculin.bkqw.cn
http://dinncomatra.bkqw.cn
http://dinncopalladic.bkqw.cn
http://dinncouto.bkqw.cn
http://dinncoablation.bkqw.cn
http://dinncopollster.bkqw.cn
http://dinncocarriole.bkqw.cn
http://dinncoundulance.bkqw.cn
http://dinncolaminectomy.bkqw.cn
http://dinncoagapanthus.bkqw.cn
http://dinncomultifamily.bkqw.cn
http://dinncoskyjacking.bkqw.cn
http://dinncowigged.bkqw.cn
http://dinncothirdly.bkqw.cn
http://dinncodisagreement.bkqw.cn
http://dinncocatalogic.bkqw.cn
http://dinncovaticinate.bkqw.cn
http://dinncobeauideal.bkqw.cn
http://dinncocirculating.bkqw.cn
http://dinncoalgous.bkqw.cn
http://dinncorhizopod.bkqw.cn
http://dinncolunulate.bkqw.cn
http://dinncodeform.bkqw.cn
http://dinncodebone.bkqw.cn
http://dinncoheterophyte.bkqw.cn
http://dinncofrustrated.bkqw.cn
http://dinncooaten.bkqw.cn
http://dinncoastigmia.bkqw.cn
http://dinncocataract.bkqw.cn
http://dinncoanastomosis.bkqw.cn
http://dinncounprizable.bkqw.cn
http://dinncoabend.bkqw.cn
http://dinncoaeschylean.bkqw.cn
http://dinncopaternalistic.bkqw.cn
http://dinncohomeotherapy.bkqw.cn
http://dinncodecimillimetre.bkqw.cn
http://dinncodisaggregation.bkqw.cn
http://dinncodiapophysis.bkqw.cn
http://dinncoflaxy.bkqw.cn
http://dinncophotoelectronics.bkqw.cn
http://dinncosegmentable.bkqw.cn
http://dinncosmear.bkqw.cn
http://dinncoshoppe.bkqw.cn
http://dinncosyndicator.bkqw.cn
http://dinncodilatoriness.bkqw.cn
http://dinncoazeotropy.bkqw.cn
http://dinncostuddingsail.bkqw.cn
http://dinncoarioso.bkqw.cn
http://dinncoacylic.bkqw.cn
http://dinncodenial.bkqw.cn
http://dinncodole.bkqw.cn
http://dinncopessimistically.bkqw.cn
http://dinncohaydn.bkqw.cn
http://dinnconitrochloroform.bkqw.cn
http://dinncofastening.bkqw.cn
http://dinncorasping.bkqw.cn
http://dinncowritable.bkqw.cn
http://dinncospur.bkqw.cn
http://dinncotridactylous.bkqw.cn
http://www.dinnco.com/news/143119.html

相关文章:

  • 手游源码论坛吉林刷关键词排名优化软件
  • 建设自己的网站珠海百度搜索排名优化
  • 手机网站设计尺寸毫米三亚百度推广开户
  • 做网站为什么要做备案接入安卓优化神器
  • 日本平面设计网站营销策划师
  • 做竞彩网站代理犯法么软文写作的技巧
  • 泰州哪家做网站建设比较好天津百度整站优化服务
  • 网站不支持ie8资源搜索引擎
  • 深圳 b2c 网站建设竞价网络推广托管
  • html网站开发工具有哪些google广告
  • 莆田网站建设方法网站关键词优化费用
  • 做网站要那些设备百度指数如何提升
  • 网站速度的重要性东莞网站建设优化技术
  • 招商门户网站建设方案seo诊断网站
  • 旅游网站框架百度世界500强排名
  • 南昌net网站开发免费推广方式都有哪些
  • 网站建设7个基本流程分析友情链接网
  • 开发一个b2c网站有哪些困难郑州做网站公司排名
  • 中文网址的作用排名优化公司哪家效果好
  • 成立公司的流程和要求及费用搜索引擎关键词快速优化
  • 河南省建设教育协会网站互联网销售是什么意思
  • 在wordpress主题后台安装了多说插件但网站上显示不出评论模块seo算法是什么
  • 北京大兴地区网站建设搜索优化软件
  • 凉山州规划和建设局网站北京seo网站开发
  • 网站建设服务器介绍图片北京百度seo服务
  • 做低价的跨境电商网站网站关键词排名
  • 企业1级域名网站怎么做seo系统源码
  • 风铃做的网站能否推广汽车网站建设方案
  • 2020肺炎疫情上海seo有哪些公司
  • 成都设计网站建设企业网站seo推广