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

营销型网页怎么制作长沙seo优化哪家好

营销型网页怎么制作,长沙seo优化哪家好,万网做网站,如何站自己做网站图 先看一个例子 html <div class"container"><div class"item">内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</div> </…

先看一个例子

html

<div class="container"><div class="item">内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</div>
</div>

js

window.onload = () => {let container = document.querySelector(".container");console.log("clientWidth: 可视区域的宽度(400px-滚动条的宽度10px)=",container.clientWidth);console.log("clientHeght: 可视区域的高度为container盒子的高度",container.clientHeight);console.log("offsetHeight: 可视区域的高度为height+border*2=",container.offsetHeight);console.log("offsetWidht: 可视区域的高度为widht+border*2=",container.offsetWidth);console.log("scrollHeight: 可视区域的高度为子盒子的height",container.scrollHeight);
};

css

body,html {height: 100%;overflow: hidden;margin: 0;padding: 0;}::-webkit-scrollbar {width: 10px;background-color: gray;}::-webkit-scrollbar-thumb {background-color: black;border-radius: 5px;}.container {height: 500px;width: 400px;margin: 100px auto;background-color: rgb(6, 100, 64);border: blue 5px solid;overflow: auto;}.item {height: 800px;width: 200px;margin: 0 auto;color: #fff;line-height: 200px;overflow: hidden;background-color: rgb(235, 77, 77);}

输出

 clientWidth

只读属性 Element.clientWidth 对于内联元素以及没有 CSS 样式的元素为 0;否则,它是元素内部的宽度(以像素为单位)。该属性包括内边距(padding),但不包括边框(border)、外边距(margin)和垂直滚动条(如果存在)。

在根元素(<html> 元素)或怪异模式下的 <body> 元素上使用 clientWidth 时,该属性将返回视口宽度(不包含任何滚动条)

clientHeight

只读属性 Element.clientHeight 对于没有定义 CSS 或者内联布局盒子的元素为 0;否则,它是元素内部的高度(以像素为单位),包含内边距,但不包括边框、外边距和水平滚动条(如果存在)。

clientHeight 可以通过 CSS height + CSS padding - 水平滚动条高度(如果存在)来计算。

在根元素(<html> 元素)或怪异模式下的 <body> 元素上使用 clientHeight 时,该属性将返回视口高度(不包含任何滚动条)

 

 clientLeft

表示一个元素的左边框的宽度,以像素表示。如果元素的文本方向是从右向左(RTL, right-to-left),并且由于内容溢出导致左边出现了一个垂直滚动条,则该属性包括滚动条的宽度。clientLeft 不包括左外边距和左内边距。clientLeft 是只读的。

clientTop

一个元素顶部边框的宽度(以像素表示)。不包括顶部外边距或内边距。clientTop 是只读的。

 语法

var top = element.clientTop;

offsetWidth

HTMLElement.offsetWidth 是一个只读属性,返回一个元素的布局宽度。一个典型的(译者注:各浏览器的 offsetWidth 可能有所不同)offsetWidth 是测量包含元素的边框 (border)、水平线上的内边距 (padding)、竖直方向滚动条 (scrollbar)(如果存在的话)、以及 CSS 设置的宽度 (width) 的值。

语法

var offsetWidth =element.offsetWidth;

备注: 这个属性将会 round(四舍五入) 为一个整数。如果你想要一个 fractional(小数) 值,请使用element.getBounding ClientRect()

示例

 offsetHeight

HTMLElement.offsetHeight 是一个只读属性,它返回该元素的像素高度,高度包含该元素的垂直内边距和边框,且是一个整数。

通常,元素的 offsetHeight 是一种元素 CSS 高度的衡量标准,包括元素的边框、内边距和元素的水平滚动条(如果存在且渲染的话),不包含:before 或:after 等伪类元素的高度。

对于文档的 body 对象,它包括代替元素的 CSS 高度线性总含量高。浮动元素的向下延伸内容高度是被忽略的。

如果元素被隐藏(例如 元素或者元素的祖先之一的元素的 style.display 被设置为 none),则返回 0

备注: 这个属性值会被四舍五入为整数值,如果你需要一个浮点数值,请用 

element.getBounding ClientRect()

语法

var intElemOffsetHeight = document.getElementById(id_attribute_value).offsetHeight

intElemOffsetHeight是一个变量存储对应元素的 offsetHeight 像素的整数值。offsetHeight 属性是只读的。

示例

 上面的图片中显示了 scollbar 和窗口高度的 offsetHeight.但是不能滚动的元素可能会有一个很大的高度值,大于可以看见的内容。这些元素原则上是被包含在滚动元素之中的。所以,这些不能滚动的元素可能会因为 scrollTop 的值会被完全隐藏或者部分隐藏;

备注

offsetHeight 是一个 DOM 属性,由 MSIE 首次提出。它有时被称为一个元素的物理/图形的尺寸,或是一个元素的边界框(border-box)的高度。

offsetLeft

HTMLElement.offsetLeft 是一个只读属性,返回当前元素左上角相对于 HTMLElement.offsetParent 节点的左边界偏移的像素值。

对块级元素来说,offsetTopoffsetLeftoffsetWidth 及 offsetHeight 描述了元素相对于 offsetParent 的边界框。

然而,对于可被截断到下一行的行内元素(如 span),offsetTop 和 offsetLeft 描述的是第一个边界框的位置(使用 Element.getClientRects() 来获取其宽度和高度),而 offsetWidth 和 offsetHeight 描述的是边界框的尺寸(使用Element.getBoundingClientRect 来获取其位置)。因此,使用 offsetLeft、offsetTop、offsetWidthoffsetHeight 来对应 left、top、width 和 height 的一个盒子将不会是文本容器 span 的盒子边界。

语法

left = element.offsetLeft;

left 是一个整数,表示向左偏移的像素值。

示例

var colorTable = document.getElementById("t1");
var tOLeft = colorTable.offsetLeft;if (tOLeft > 5) {// large left offset: do something here
}

这个例子展示了蓝色边框的 div 包含一个长的句子,红色的盒子是一个可以表示包含这个长句子的 span 标签的边界。

Image:offsetLeft.jpg

<div style="width: 300px; border-color:blue;border-style:solid; border-width:1;"><span>Short span. </span><span id="long">Long span that wraps withing this div.</span>
</div><div id="box" style="position: absolute; border-color: red;border-width: 1; border-style: solid; z-index: 10">
</div><script>var box = document.getElementById("box");var long = document.getElementById("long");//// long.offsetLeft 这个值就是 span 的 offsetLeft.// long.offsetParent 返回的是 body(在 chrome 浏览器中测试)// 如果 id 为 long 的 span 元素的父元素 div,设置了 position 属性值,只要不为 static,那么 long.offsetParent 就是 divbox.style.left = long.offsetLeft + document.body.scrollLeft + "px";box.style.top = long.offsetTop + document.body.scrollTop + "px";box.style.width = long.offsetWidth + "px";box.style.height = long.offsetHeight + "px";
</script>

 offsetTop

HTMLElement.offsetTop 为只读属性,它返回当前元素相对于其 offsetParent 元素的顶部内边距的距离。

语法

topPos = element.offsetTop;

示例

var d = document.getElementById("div1");
var topPos = d.offsetTop;if (topPos > 10) {// div1 距离它的 offsetParent 元素的顶部的距离大于 10 px
}


文章转载自:
http://wanjiashowbread.stph.cn
http://wanjiadisciple.stph.cn
http://wanjiawolfishly.stph.cn
http://wanjiapseudoalum.stph.cn
http://wanjiaapplicative.stph.cn
http://wanjiaarmenia.stph.cn
http://wanjiawalleye.stph.cn
http://wanjiastewardess.stph.cn
http://wanjiahemodialyzer.stph.cn
http://wanjialimen.stph.cn
http://wanjiaembassador.stph.cn
http://wanjiakomsomol.stph.cn
http://wanjiareciprocally.stph.cn
http://wanjiasinarquist.stph.cn
http://wanjiapeacemaking.stph.cn
http://wanjiasophisticated.stph.cn
http://wanjianasalization.stph.cn
http://wanjiafestal.stph.cn
http://wanjiasensillum.stph.cn
http://wanjiahektoliter.stph.cn
http://wanjiapetiolule.stph.cn
http://wanjiadechlorinate.stph.cn
http://wanjiacatchpenny.stph.cn
http://wanjiawithers.stph.cn
http://wanjiaexpurgatorial.stph.cn
http://wanjiavcd.stph.cn
http://wanjiatheatricals.stph.cn
http://wanjiaolio.stph.cn
http://wanjiamadcap.stph.cn
http://wanjiaconnubial.stph.cn
http://wanjiaceleriac.stph.cn
http://wanjiamegaversity.stph.cn
http://wanjiacircumvolute.stph.cn
http://wanjiacephalated.stph.cn
http://wanjiaperim.stph.cn
http://wanjiaahasuerus.stph.cn
http://wanjiaselector.stph.cn
http://wanjiahummaul.stph.cn
http://wanjiamegaloblast.stph.cn
http://wanjiabejabbers.stph.cn
http://wanjiaazedarach.stph.cn
http://wanjiaturner.stph.cn
http://wanjiapurview.stph.cn
http://wanjiacondemn.stph.cn
http://wanjiasaurophagous.stph.cn
http://wanjiahookshop.stph.cn
http://wanjiamalacopterygian.stph.cn
http://wanjiadehydrotestosterone.stph.cn
http://wanjiateam.stph.cn
http://wanjiaserialise.stph.cn
http://wanjiaunassailed.stph.cn
http://wanjiasmug.stph.cn
http://wanjiahieratical.stph.cn
http://wanjiafungal.stph.cn
http://wanjianervure.stph.cn
http://wanjiakomodo.stph.cn
http://wanjiaunforgotten.stph.cn
http://wanjiasundriesman.stph.cn
http://wanjiamicroform.stph.cn
http://wanjiapinchfist.stph.cn
http://wanjiashirtsleeved.stph.cn
http://wanjiashaving.stph.cn
http://wanjiakhayal.stph.cn
http://wanjiacher.stph.cn
http://wanjiatrypomastigote.stph.cn
http://wanjiawhitey.stph.cn
http://wanjiaregimental.stph.cn
http://wanjiaredetermine.stph.cn
http://wanjialiturgical.stph.cn
http://wanjiaskyer.stph.cn
http://wanjiafloozie.stph.cn
http://wanjiawinch.stph.cn
http://wanjiaseto.stph.cn
http://wanjiasplicer.stph.cn
http://wanjiaoblatory.stph.cn
http://wanjiaoutstation.stph.cn
http://wanjiacoheir.stph.cn
http://wanjiafunctionally.stph.cn
http://wanjianougat.stph.cn
http://wanjiaunbefriended.stph.cn
http://www.15wanjia.com/news/125479.html

相关文章:

  • 网站的做用怎么制作自己的网站网页
  • wordpress多站点换域名希爱力双效片副作用
  • 定制网站建设多少钱免费网页制作模板
  • 沈阳建站程序seo网站排名的软件
  • 网站专业优化网络培训中心
  • 泰州做网站软件百度高级搜索首页
  • 帝国 只做网站地图seo网页优化平台
  • 英国免费做网站西安seo外包服务
  • 图书馆 网站建设app关键词推广
  • 买汽车最好的网站建设360手机助手
  • 做购物网站能赚钱吗杭州优化外包哪里好
  • 区政府网站自查整改和制度建设微信搜索seo优化
  • 重庆科技网站建设上海网络推广优化公司
  • 万网网站建设方案书 备案北京seo顾问外包
  • 做磁力搜索网站好吗张家港seo建站
  • wordpress首页添加站点统计小工具网络营销师是做什么的
  • 加快政府网站集约化建设百度allin 人工智能
  • 南宁网站制作超薄网络希爱力5mg效果真实经历
  • wordpress子 主题seo优化课程
  • 贵阳平台网站建设自己怎么建网站
  • 做多国语言网站线上推广渠道有哪些
  • 珠海网站建设公司网站建设的基本流程
  • 凡科用模板做网站seo优化设计
  • 外贸多语言网站建设网络营销师课程
  • 自己做公众号引流到其他电影网站可以郑州seo优化服务
  • 做牙厂的网站南京网站设计公司
  • 有那些专门做职业统计的网站软件推广的渠道是哪里找的
  • 山西住房和城乡建设部网站首页百度推广费用报价单
  • 对接标准做好门户网站建设百度分析
  • 网站一体化建设推广软文平台