HTML制作网站的制作骤步骤

在互联网时代,网站已经成为展示信息、网站传递内容的制作骤如何看懂芯片文档重要平台。对于想要自己动手制作网站的网站朋友来说,掌握HTML的制作骤基础知识是必不可少的一步。HTML(HyperText Markup Language)是网站一种标记语言,用于创建网页的制作骤基本结构。接下来,网站我们将详细介绍使用HTML制作网站的制作骤如何看懂芯片文档几个关键步骤。

第一步:明确网站目标与规划内容

在开始编写代码之前,网站首先要明确网站的制作骤用途和目标用户群体。是网站为了展示个人作品,还是制作骤为企业提供介绍页面?不同的目标决定了网站的内容结构和设计风格。接着,网站可以规划网站的制作骤主要页面,如首页、关于我们、产品展示、联系方式等,并整理每一页需要展示的信息内容。

html制作网站的步骤 是网站为了展示个人作品

第二步:搭建开发环境

制作网站并不需要复杂的软件,一个简单的文本编辑器即可,如Notepad++、VS Code等。同时,还需要一个浏览器用于预览网页效果,推荐使用Chrome或Firefox等支持开发者工具的浏览器,方便调试和优化。

html制作网站的步骤 是网站为了展示个人作品

第三步:编写HTML基础结构

每一个HTML页面都有一个基本的结构框架。通常包括、、、<body>等标签。其中,<head>部分用于定义页面的元数据,如字符编码、页面标题等;而<body>部分则是网页的主要内容区域,包括文字、图片、链接等元素。</p><p><img lang="dfc37d" alt="html制作网站的步骤 是网站为了展示个人作品" src="/template/company/111/images2/image_0119_9e811dc7.jpg"/></p><h3>第四步:添加网页内容</h3><p>根据前期规划的内容,逐步在<body>标签中添加相应的HTML元素。例如,使用<h1>到<h6>标签添加标题,用<p>标签添加段落文字,用<img>标签插入图片,用<a>标签创建超链接等。这一阶段的目标是让网页内容完整呈现,确保信息传递清晰。</p><h3>第五步:美化网页样式</h3><p>虽然HTML负责网页的结构,但网页的外观设计则需要借助CSS(层叠样式表)。可以通过内联样式、内部样式表或外部样式表的方式为网页添加颜色、字体、布局等视觉效果。建议使用外部CSS文件,这样可以实现样式与内容的分离,便于后期维护。</p><h3>第六步:测试与优化</h3><p>完成网页的初步制作后,需要在不同设备和浏览器中进行测试,确保网页在各种环境下都能正常显示。同时,还需要优化页面加载速度,比如压缩图片、减少不必要的代码等。</p><h3>第七步:部署上线</h3><p>当网页测试无误后,就可以将其上传到服务器,让全世界都能访问。可以选择免费或付费的主机服务,如GitHub Pages、Netlify等。上传方式通常使用FTP(文件传输协议)或通过平台提供的上传工具完成。</p><h3>第八步:持续更新与维护</h3><p>网站上线并不意味着工作的结束,还需要定期更新内容、修复错误,并根据用户反馈不断优化体验。一个成功的网站需要长期的维护和运营,才能持续吸引访问者。</p></div><tt dir="51d768"></tt><var lang="6f59eb"></var><area draggable="67c000"></area><table draggable="94167a" style="border:none;"><tbody><tr><td class="jc6031 center" style="font-size:2em; border:none;"><strong><a class="k6a1c8 pink space" href="#"> 回顶部</a></strong></td></tr></tbody></table></div><map dropzone="53ea72"></map><bdo date-time="f82a62"></bdo><dfn dir="2a373b"></dfn><div dropzone="c6031a" class="lcfdf1 right_outer" style="display: block;"><font lang="b01f2a"></font><ins draggable="2fdd68"></ins><small dropzone="3a0edf"></small><div date-time="6a1c81" class="m1a43d right_inner"><sup date-time="711c2a"></sup><time dir="bcfe49"></time><tt lang="8d9770"></tt><div dir="cfdf18" class="n32a14 right"><p><a href="/?s=一线品牌厨电十大排名&gpc=stf%3D1719820872%2C1719907272%7Cstftype%3D1" rel="nofollow">最近1</a><br><a href="/?s=一线品牌厨电十大排名&gpc=stf%3D1719302472%2C1719907272%7Cstftype%3D1" rel="nofollow">最近1週</a><br><a href="/?s=一线品牌厨电十大排名&gpc=stf%3D1717228872%2C1719907272%7Cstftype%3D1" rel="nofollow">最近1月</a><br><a href="/?s=一线品牌厨电十大排名&gpc=stf%3D1688371272%2C1719907272%7Cstftype%3D1" rel="nofollow">最近1年</a><br><a href="https://www.google.com/#q=一线品牌厨电十大排名" rel="external nofollow noreferrer" target="_blank">谷歌搜索</a><br><a href="https://www.baidu.com/s?wd=一线品牌厨电十大排名" rel="external nofollow noreferrer" target="_blank">百度一下</a><br><a href="http://www.sogou.com/web?query=一线品牌厨电十大排名" rel="external nofollow noreferrer" target="_blank">搜狗搜索</a><br><a href="http://s.weibo.com/weibo/一线品牌厨电十大排名" rel="external nofollow noreferrer" target="_blank">微搜索</a><br><a href="https://web.archive.org/" rel="external nofollow noreferrer" target="_blank">Internet Archive</a><br><a href="https://mail.google.com/mail/u/0/#inbox" rel="external nofollow noreferrer" target="_blank">Gmail 邮箱</a><br><a href="https://validator.w3.org/unicorn/check?ucn_uri=" rel="external nofollow noreferrer" target="_blank">W3C 统一验证</a><br><a href="https://developers.google.com/speed/pagespeed/insights/" rel="external nofollow noreferrer" target="_blank">PageSpeed</a><br><a href="http://www.aizhan.com/" rel="external nofollow noreferrer" target="_blank">站</a><br><a href="http://www.5118.com/" rel="external nofollow noreferrer" target="_blank">5118 站长大数据</a><br><a href="http://www.bejson.com/" rel="external nofollow noreferrer" target="_blank">JSON校验工具</a><br><a href="http://zh.numberempire.com/texequationeditor/equationeditor.php" rel="external nofollow noreferrer" target="_blank">LaTeX公式编辑器</a><br><a href="http://opendata.baidu.com/post/" rel="external nofollow noreferrer" target="_blank">邮编查询</a><br><a href="http://tool.chinaz.com/Tools/unixtime.aspx" rel="external nofollow noreferrer" target="_blank">Unix 时间戳</a><br><a href="http://fanyi.baidu.com/#auto/zh/" rel="external nofollow noreferrer" target="_blank">百度翻译</a><br><a href="http://www.zdic.net" rel="external nofollow noreferrer" target="_blank">汉典字典</a><br><a href="https://deerchao.net/tutorials/regex/regex.htm" rel="external nofollow noreferrer" target="_blank">正则表达式入门</a><br><a href="https://github.com/ausdruck/spec" rel="external nofollow noreferrer" target="_blank">百度内部编规范</a><br><a href="http://schema.org/docs/full.html" rel="external nofollow noreferrer" target="_blank">微数据层级</a><br><a href="https://www.google.com/webmasters/tools/home?hl=zh" rel="external nofollow noreferrer" target="_blank">谷歌搜索控制台</a><br><a href="http://cn.bing.com/webmaster/" rel="external nofollow noreferrer" target="_blank">必应管工具</a><br><a href="http://zhanzhang.baidu.com/site/index" rel="external nofollow noreferrer" target="_blank">百度站长平台</a><br><a href="http://zhanzhang.so.com" rel="external nofollow noreferrer" target="_blank">好搜站长平台</a><br><a href="http://zhanzhang.sogou.com/index.php/dashboard/index" rel="external nofollow noreferrer" target="_blank">搜狗站长平台</a><br><a href="https://mp.weixin.qq.com/" rel="external nofollow noreferrer" target="_blank">微信公众平台登录</a><br><a href="http://index.baidu.com/" rel="external nofollow noreferrer" target="_blank">百度指数</a><br><a href="http://i.baidu.com/my/history" rel="external nofollow noreferrer" target="_blank">百度搜索历史记录</a><br><a href="https://www.smashingmagazine.com/tag/wallpapers/" rel="external nofollow noreferrer" target="_blank">Wallpaper</a><br><a href="/" rel="external nofollow noreferrer" target="_blank">本列友链售卖</a></p><p><a class="od6d9c pink space" href="#"> 回顶部</a></p></div></div></div><script> // 百度下拉框提示 (function(){var A=window.baidu||{version:"1-1-0"};A.object=A.object||{};A.object.extend=function(B,D){for(var C in D){if(D.hasOwnProperty(C)){B[C]=D[C]}}};A.extend=A.object.extend;A.dom=A.dom||{};A.dom.g=function(B){if("string"==typeof B||B instanceof String){return document.getElementById(B)}else{if(B&&(B.nodeName&&(B.nodeType==1||B.nodeType==9))){return B}}return null};A.g=A.G=A.dom.g;A.dom.getDocument=function(B){B=A.dom.g(B);return B.nodeType==9?B:B.ownerDocument||B.document};A.dom._styleFixer=A.dom._styleFixer||{};A.dom._styleFilter=A.dom._styleFilter||[];A.dom._styleFilter.filter=function(C,G,E){for(var B=0,D=A.dom._styleFilter,F;F=D[B];B++){if(F=F[E]){G=F(C,G)}}return G};A.string=A.string||{};A.string.toCamelCase=function(B){return String(B).replace(/[-_]\D/g,function(C){return C.charAt(1).toUpperCase()})};A.dom.getStyle=function(F,G){var D=A.dom;F=D.g(F);G=A.string.toCamelCase(G);var B=F.style[G];if(B){return B}var C=D._styleFixer[G],E=F.currentStyle||(A.browser.ie?F.style:getComputedStyle(F,null));B="object"==typeof C&&C.get?C.get(F,E):E[C||G];if(C=D._styleFilter){B=C.filter(G,B,"get")}return B};A.getStyle=A.dom.getStyle;A.browser=A.browser||{};if(/msie (\d+\.\d)/i.test(navigator.userAgent)){A.ie=A.browser.ie=parseFloat(RegExp.$1)}if(/opera\/(\d+\.\d)/i.test(navigator.userAgent)){A.browser.opera=parseFloat(RegExp.$1)}A.browser.isWebkit=/webkit/i.test(navigator.userAgent);A.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent);A.browser.isStrict=document.compatMode=="CSS1Compat";A.dom.getPosition=function(D){var B=A.dom.getDocument(D),E=A.browser;D=A.dom.g(D);var I=E.isGecko>0&&(B.getBoxObjectFor&&(A.dom.getStyle(D,"position")=="absolute"&&(D.style.top===""||D.style.left===""))),J={left:0,top:0},H=E.ie&&!E.isStrict?B.body:B.documentElement;if(D==H){return J}var C=null,F;if(D.getBoundingClientRect){F=D.getBoundingClientRect();J.left=Math.floor(F.left)+Math.max(B.documentElement.scrollLeft,B.body.scrollLeft);J.top=Math.floor(F.top)+Math.max(B.documentElement.scrollTop,B.body.scrollTop);J.left-=B.documentElement.clientLeft;J.top-=B.documentElement.clientTop;if(E.ie&&!E.isStrict){J.left-=2;J.top-=2}}else{if(B.getBoxObjectFor&&!I){F=B.getBoxObjectFor(D);var G=B.getBoxObjectFor(H);J.left=F.screenX-G.screenX;J.top=F.screenY-G.screenY}else{C=D;do{J.left+=C.offsetLeft;J.top+=C.offsetTop;if(E.isWebkit>0&&A.dom.getStyle(C,"position")=="fixed"){J.left+=B.body.scrollLeft;J.top+=B.body.scrollTop;break}C=C.offsetParent}while(C&&C!=D);if(E.opera>0||E.isWebkit>0&&A.dom.getStyle(D,"position")=="absolute"){J.top-=B.body.offsetTop}C=D.offsetParent;while(C&&C!=B.body){J.left-=C.scrollLeft;if(!b.opera||C.tagName!="TR"){J.top-=C.scrollTop}C=C.offsetParent}}}return J};A.event=A.event||{};A.event._unload=function(){var C=A.event._listeners,B=C.length,D=!(!window.removeEventListener),E,F;while(B--){E=C[B];F=E[0];if(F.removeEventListener){F.removeEventListener(E[1],E[3],false)}else{if(F.detachEvent){F.detachEvent("on"+E[1],E[3])}}}if(D){window.removeEventListener("unload",A.event._unload,false)}else{window.detachEvent("onunload",A.event._unload)}};if(window.attachEvent){window.attachEvent("onunload",A.event._unload)}else{window.addEventListener("unload",A.event._unload,false)}A.event._listeners=A.event._listeners||[];A.event.on=function(F,B,E){B=B.replace(/^on/i,"");if("string"==typeof F){F=A.dom.g(F)}var C=function(G){E.call(F,G)},D=A.event._listeners;D[D.length]=[F,B,E,C];if(F.attachEvent){F.attachEvent("on"+B,C)}else{if(F.addEventListener){F.addEventListener(B,C,false)}}return F};A.on=A.event.on;A.event.preventDefault=function(B){if(B.preventDefault){B.preventDefault()}else{B.returnValue=false}};A.ui=A.ui||{};A.suggestion=A.ui.suggestion=A.ui.suggestion||{};(function(){var B={},C=function(E){var D={};E.listen=function(F,H){D[F]=D[F]||[];var G=0;while(G<D[F].length&&D[F][G]!=H){G++}if(G==D[F].length){D[F].push(H)}return E};E.call=function(G){if(D[G]){for(var F=0;F<D[G].length;F++){D[G][F].apply(this,Array.prototype.slice.call(arguments,1))}}return E}};B.extend=function(D){new C(D);return D};B.extend(B);A.suggestion._Central=B})();A.ui.suggestion._Div=function(V,o,Z,a,X){var d=this,h,T,Y,l,f=X.class_prefix,U,S=document.createElement("DIV");S.id=f+(new Date()).getTime();S.className=f+"wpr";S.style.display="none";var c=document.createElement("IFRAME");c.className=f+"sd";c.style.display="none";c.style.position="absolute";c.style.borderWidth="0px";if(X.apd_body){document.body.appendChild(S)}else{o.parentNode.appendChild(S)}S.parentNode.insertBefore(c,S);V.listen("start",function(){A.on(document,"mousedown",function(B){B=B||window.event;var C=B.target||B.srcElement;if(C==o){return}while(C=C.parentNode){if(C==S){return}}W()});A.on(window,"blur",W)});V.listen("key_enter",function(){var B=i(),C=B[0]==-1?l:B[1];X.onconfirm(Z.getValue(),B[0],C,B[2],true);W()});function m(F,D){if(S.style.display=="none"){V.call("need_data",Z.getValue());return}var B=i()[0];j();if(F){if(B==0){g(D);B--;return}if(B==-1){B=T.length}B--}else{if(B==T.length-1){g(D);B=-1;return}B++}n(B);k();var E=Z.getValue();g(B);var C=i();X.onpick(E,C[0],C[1],C[2])}V.listen("key_up",function(B){m(1,B)});V.listen("key_down",function(B){m(0,B)});V.listen("key_tab",W);V.listen("key_esc",W);V.listen("all_clear",W);V.listen("data_ready",function(E,C){l=C;T=[];Y=[];for(var B=0,D=C.length;B<D;B++){if(typeof C[B].input!="undefined"){T[B]=C[B].input;Y[B]=C[B].selection}else{Y[B]=T[B]=C[B]}}if(T.length!=0){U=a(S,Y,d);for(var B=0,D=U.length;B<D;B++){A.on(U[B],"mouseover",function(){j();this.className=f+"mo";k()});A.on(U[B],"mouseout",j);A.on(U[B],"mousedown",function(F){V.call("mousedown_item");if(!A.ie){F.stopPropagation();F.preventDefault();return false}});A.on(U[B],"click",e(B))}}else{W()}});function j(){for(var B=0;B<U.length;B++){U[B].className=f+"ml"}}function i(){if(U&&S.style.display!="none"){for(var B=0;B<U.length;B++){if(U[B].className==f+"mo"){return[B,T[B],Y[B]]}}}return[-1,""]}function k(){var B=i();X.onhighlight(Z.getValue(),B[0],B[1],B[2])}function n(B){j();U[B].className=f+"mo"}function g(C){var B=T&&(typeof C=="number"&&typeof T[C]!="undefined")?T[C]:C;V.call("pick_word",B)}function W(){if(S.style.display=="none"){return null}c.style.display=S.style.display="none";X.onhide()}function e(B){var C=B;return function(){V.call("confirm_item",Z.getValue(),T[C],C,Y[C]);var D=Z.getValue();g(T[C]);X.onpick(D,C,T[C],Y[C]);X.onconfirm(Z.getValue(),C,T[C],Y[C]);W()}}return{element:S,shade:c,pick:g,highlight:n,hide:W,dispose:function(){S.parentNode.removeChild(S)}}};A.ui.suggestion._Data=function(D,B){var C=this,E={};D.listen("response_data",function(G,F){E[G]=F;D.call("data_ready",G,F)});D.listen("need_data",function(F){if(typeof E[F]=="undefined"){B(F)}else{D.call("data_ready",F,E[F])}});return{}};A.ui.suggestion._InputWatcher=function(H,G,E){var F=this,K,D=0,L="",C="",J="",M,I=false,N=false,B=false;G.setAttribute("autocomplete","off");A.on(G,"keydown",function(O){if(!B){H.call("start");B=true}O=O||window.event;var P;switch(O.keyCode){case 9:P="tab";break;case 27:P="esc";break;case 13:P="enter";break;case 38:P="up";A.event.preventDefault(O);break;case 40:P="down"}if(P){H.call("key_"+P,C)}});A.on(G,"mousedown",function(){if(!B){H.call("start");B=true}});A.on(G,"beforedeactivate",function(){if(I){window.event.cancelBubble=true;window.event.returnValue=false}});H.listen("start",function(){J=G.value;D=setInterval(function(){if(N){return}if(A.G(G)==null){suggestion.dispose()}var O=G.value;if(O==L&&(O!=""&&(O!=J&&O!=M))){if(K==0){K=setTimeout(function(){H.call("need_data",O)},100)}}else{clearTimeout(K);K=0;if(O==""&&L!=""){M="";H.call("all_clear")}L=O;if(O!=M){C=O}if(J!=G.value){J=""}}},10)});H.listen("pick_word",function(O){if(I){G.blur()}G.value=M=O;if(I){G.focus()}});H.listen("mousedown_item",function(O){I=true;N=true;setTimeout(function(){N=false;I=false},500)});H.listen("confirm_item",function(R,P,Q,O){N=false;C=L=Q});return{getValue:function(){return G.value},dispose:function(){clearInterval(D)}}};A.ui.suggestion._Suggestion=function(F,B){var E=this,C=A.ui.suggestion._MessageDispatcher;E.options={onpick:function(){},onconfirm:function(){},onhighlight:function(){},onhide:function(){},view:null,getData:false,prepend_html:"",append_html:"",class_prefix:"tangram_sug_",apd_body:false};A.extend(E.options,B);if(!(F=A.G(F))){return null}E.inputElement=F;if(F.id){E.options._inputId=F.id}else{F.id=E.options._inputId=E.options.class_prefix+"ipt"+(new Date()).getTime()}E._adjustPos=function(S){var J=G.element,M=G.shade,P=document,N=P.compatMode=="BackCompat"?P.body:P.documentElement,O=N.clientHeight,K=N.clientWidth;if(J.style.display=="none"&&S){return}var Q=A.dom.getPosition(F),L=[Q.top+F.offsetHeight-1,Q.left,F.offsetWidth];L=typeof E.options.view=="function"?E.options.view(L):L;J.style.display=M.style.display="block";M.style.top=L[0]+"px";M.style.left=L[1]+"px";M.style.width=L[2]+"px";var V=parseFloat(A.getStyle(J,"marginTop"))||0,R=parseFloat(A.getStyle(J,"marginLeft"))||0;J.style.top=L[0]-V+"px";J.style.left=L[1]-R+"px";if(A.ie&&document.compatMode=="BackCompat"){J.style.width=L[2]+"px"}else{var U=parseFloat(A.getStyle(J,"borderLeftWidth"))||0,W=parseFloat(A.getStyle(J,"borderRightWidth"))||0,T=parseFloat(A.getStyle(J,"marginRight"))||0;J.style.width=L[2]-U-W-R-T+"px"}M.style.height=J.offsetHeight+"px";if(O!=N.clientHeight||K!=N.clientWidth){E._adjustPos()}};E._draw=function(M,T){var Q=[],L=document.createElement("TABLE");L.cellPadding=2;L.cellSpacing=0;var R=document.createElement("TBODY");L.appendChild(R);for(var O=0,J=T.length;O<J;O++){var S=R.insertRow(-1);Q.push(S);var K=S.insertCell(-1);K.innerHTML=T[O]}var P=document.createElement("DIV");P.className=E.options.class_prefix+"pre";P.innerHTML=E.options.prepend_html;var N=document.createElement("DIV");N.className=E.options.class_prefix+"app";N.innerHTML=E.options.append_html;M.innerHTML="";M.appendChild(P);M.appendChild(L);M.appendChild(N);E._adjustPos();return Q};var H=A.suggestion._Central.extend(E),D=new A.ui.suggestion._Data(H,E.options.getData),I=new A.ui.suggestion._InputWatcher(H,F,G),G=new A.ui.suggestion._Div(H,F,I,E._draw,E.options);H.listen("start",function(){setInterval(function(){var J=G.element;if(J.offsetWidth!=0&&F.offsetWidth!=J.offsetWidth){E._adjustPos()}},100);A.on(window,"resize",function(){E._adjustPos(true)})});return{pick:G.pick,hide:G.hide,highlight:G.highlight,getElement:function(){return G.element},getData:E.options.getData,giveData:function(K,J){H.call("response_data",K,J)},dispose:function(){G.dispose();I.dispose()}}};A.ui.suggestion.create=function(B,C){return new A.ui.suggestion._Suggestion(B,C)};window.baidu=A})();var BaiduSuggestion=(function(){var D={};var E={};function O(P){return document.createElement(P)}var J={createSugOptions:function(S,R,Q,P){return{class_prefix:"bdSug_",onconfirm:function(Y,W,U,V,X){if(Q&&W>-1){try{Q.apply(window,[U])}catch(T){}}if(P&&!X){P.submit()}},view:function(T){if(R&&R.width){T[2]=parseInt(R.width)}if(R&&R.XOffset&&R.YOffset){return[T[0]-R.YOffset,T[1]-R.XOffset,T[2]]}return[T[0],T[1],T[2]]},getData:function(U){var V=(new Date()).getTime();var W=baidu.G("bdSug_script");if(W){document.body.removeChild(W)}var T=O("script");T.setAttribute("charset","gbk");T.src="//unionsug.baidu.com/su?wd="+encodeURIComponent(U)+"&p=3&cb=BaiduSuggestion.callbacks.give"+S+"&t="+V;T.id="bdSug_script";document.body.appendChild(T)},append_html:"",apd_body:true}},createSugCallback:function(P){return function(R){if(!R){return}var S=[];for(var T=0;T<R.s.length;T++){var Q={};Q.input=R.s[T];Q.selection=R.s[T];S.push(Q)}E["sug"+P].giveData(R.q,S)}}};function I(T,Z,S,X){if(!T){return}if(typeof (T)=="string"||T instanceof String){T=baidu.G(T)}if(!T.sugId){T.sugId=(new Date).getTime()}if(E["sug"+T.sugId]){return false}if(Z==null){var Z=[]}else{X=Z.sugSubmit;var Q=Z.fontColor?Z.fontColor:"#000";var W=Z.fontSize?Z.fontSize:"14px";var P=Z.fontFamily?Z.fontFamily:"verdana";var U=Z.bgcolorHI?Z.bgcolorHI:"#36c";var R=Z.fontColorHI?Z.fontColorHI:"#FFF";var Y=Z.borderColor?Z.borderColor:"#817f82";L(".bdSug_wpr","border:1px solid "+Y+";position:absolute;z-index:9;top:28px;left:0;color:"+Q);L(".bdSug_wpr td","font-size:"+W+";font-family:"+P);L(".bdSug_mo","background-color:"+U+";color:"+R)}if(G(document.body,"position")=="relative"||G(document.body,"position")=="absolute"){var V=B(document.body);Z.XOffset=(Z.XOffset?parseInt(Z.XOffset):0)+V.x;Z.YOffset=(Z.YOffset?parseInt(Z.YOffset):0)+V.y}E["sug"+T.sugId]=baidu.suggestion.create(T,J.createSugOptions(T.sugId,Z,S,X?N(T):null));D["give"+T.sugId]=J.createSugCallback(T.sugId)}function N(Q){var P=Q;while(P!=document.body&&P.tagName!="FORM"){P=P.parentNode}return(P.tagName=="FORM")?P:null}function B(R){var P=document;var Q=0;var S=0;if(R.getBoundingClientRect){var T=R.getBoundingClientRect();Q=T.left+Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);S=T.top+Math.max(P.documentElement.scrollTop,P.body.scrollTop);Q-=P.documentElement.clientLeft;S-=P.documentElement.clientTop}else{while(R=R.offsetParent){Q+=R.offsetLeft;S+=R.offsetTop}}return{x:Q,y:S}}function L(R,Q){var S=document.styleSheets;if(!S||S.length<=0){var P=document.createElement("STYLE");P.type="text/css";var T=document.getElementsByTagName("HEAD")[0];T.appendChild(P)}S=document.styleSheets;S=S[S.length-1];if(baidu.ie){S.addRule(R,Q)}else{S.insertRule(R+" { "+Q+" }",S.cssRules.length)}}function G(R,P,Q){if(!R){return}if(Q!=undefined){R.style[P]=Q}else{if(R.style[P]){return R.style[P]}else{if(R.currentStyle){return R.currentStyle[P]}else{if(document.defaultView&&document.defaultView.getComputedStyle){P=P.replace(/([A-Z])/g,"-u00241").toLowerCase();var S=document.defaultView.getComputedStyle(R,"");return S&&S.getPropertyValue(P)||""}}}}}function A(){L(".bdSug_wpr","line-height:normal;background:#FFF;padding:0;margin:0;border:1px solid #817F82;position:absolute;z-index:9999;");L(".bdSug_wpr table","padding:0;width:100%;background:#fff;cursor:default;");L(".bdSug_wpr tr","padding:0;margin:0");L(".bdSug_wpr td","padding:2px;margin:0;text-align:left;vertical-align:middle;font:14px verdana;font-weight:normal;text-decoration:none;text-indent:0");L(".bdSug_mo","background:#36c;color:#fff");L(".bdSug_app","padding:0;margin:0;background:#fff");L(".bdSug_pre","padding:0;margin:0");L()}A();var H=document.body.getElementsByTagName("INPUT");for(var K=0,F=H.length;K<F;K++){var M=H[K];if(M&&M.type=="text"&&(M.getAttribute("baiduSug")==1||M.getAttribute("baiduSug")==2)){M.sugId=K;var C=(M.getAttribute("baiduSug")==1);I(M,null,null,C)}}return{bind:I,callbacks:D}})(); // 回调函数,用于获取用户当前选择的文字 function show(str) { txtObj.innerHTML = str; } var params = { // "XOffset": 0, // 提示框位置横向偏移量,单位 px // "YOffset": 0, // 提示框位置纵向偏移量,单位 px // "width": 204, // 提示框宽度,单位 px // "fontColor": "#f70", // 提示框文字颜 "fontColorHI": "#000000", // 提示框高亮选择时文字颜 "fontSize": "1em", // 文字大小 "fontFamily": "Helvetica Neue", // 文字字体 "borderColor": "#DDDDDD", // 提示框的边框颜 "bgcolorHI": "#DDDDDD", // 提示框高亮选择的颜 "sugSubmit": true // 在选择提示词条是是否提交表单 }; BaiduSuggestion.bind("sug", params, show); // 复制到剪贴板 function cp() { var e = document.getElementById("c"); e.select(); document.execCommand("copy"); } // 清空搜索框 function clearInput(){document.getElementById("js-in").value="";}</script></body></html>