當前位置:首頁 » 網頁前端 » 前端標簽
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

前端標簽

發布時間: 2022-03-14 01:26:44

前端開發時meta標簽一般怎麼寫

注釋:<meta> 標簽永遠位於 head 元素內部。
注釋:元數據總是以名稱/值的形式被成對傳遞的。
name屬性
name屬性主要用於描述網頁,與之對應的屬性值為content,content中的內容主要是便於搜索引擎機器人查找信息和分類信息用的。
meta標簽的name屬性語法格式是:<meta name="參數" content="具體的參數值">;。
其中name屬性主要有以下幾種參數:
A、Keywords(關鍵字)
說明:keywords用來告訴搜索引擎你網頁的關鍵字是什麼。
舉例:<meta name ="keywords" content="science,ecation,culture,politics,ecnomics,relationships,entertainment,human">
B、description(網站內容描述)
說明:description用來告訴搜索引擎你的網站主要內容。
網站內容描述(description)的設計要點:
①網頁描述為自然語言而不是羅列關鍵詞(與keywords設計正好相反);
②盡可能准確地描述網頁的核心內容,通常為網頁內容的摘要信息,也就是希望搜索引擎在檢索結果中展示的摘要信息;
③網頁描述中含有有效關鍵詞;
④網頁描述內容與網頁標題內容有高度相關性;
⑤網頁描述內容與網頁主體內容有高度相關性;
⑥網頁描述的文字不必太多,一般不超過搜索引擎檢索結果摘要信息的最多字數(通常在100中文字之內,不同搜索引擎略有差異)。
舉例:<meta name="description" content="This page is about the meaning of science,ecation,culture.">
C、robots(機器人向導)
說明:robots用來告訴搜索機器人哪些頁面需要索引,哪些頁面不需要索引。
content的參數有all,none,index,noindex,follow,nofollow。默認是all。
舉例:<meta name="robots" content="none">
D、author(作者)
說明:標注網頁的作者
http-equiv屬性
http-equiv顧名思義,相當於http的文件頭作用,它可以向瀏覽器傳回一些有用的信息,以幫助正確和精確地顯示網頁內容,與之對應的屬性值為content,content中的內容其實就是各個參數的變數值。
meta標簽的http-equiv屬性語法格式是:<meta http-equiv="參數" content="參數變數值"> ;其中http-equiv屬性主要有以下幾種參數:
A、Expires(期限)
說明:可以用於設定網頁的到期時間。一旦網頁過期,必須到伺服器上重新傳輸。
用法:<meta http-equiv="expires" content="Fri,12 Jan 2001 18:18:18 GMT">
注意:必須使用GMT的時間格式。
B、Pragma(cache模式)
說明:禁止瀏覽器從本地計算機的緩存訪問頁面內容。
用法:<meta http-equiv="Pragma" content="no-cache">
注意:這樣設定,訪問者將無法離線瀏覽。
C、Refresh(刷新)
說明:自動刷新並轉到新頁面。
用法:<meta http-equiv="Refresh" content="2;URL">;(注意後面的分號,分別在秒數的前面和網址的後面,URL可為空)
注意:其中的2是指停留2秒鍾後自動刷新到URL網址。
D、Set-Cookie(cookie設定)
說明:如果網頁過期,那麼存檔的cookie將被刪除。
用法:<meta http-equiv="Set-Cookie" content="cookievalue=xxx; expires=Friday,12-Jan-2001 18:18:18 GMT; path=/">
注意:必須使用GMT的時間格式。
E、Window-target(顯示窗口的設定)
說明:強制頁面在當前窗口以獨立頁面顯示。
用法:<meta http-equiv="Window-target" content="_top">
注意:用來防止別人在框架里調用自己的頁面。
F、content-Type(顯示字元集的設定)
說明:設定頁面使用的字元集。
用法:<meta http-equiv="content-Type" content="text/html; charset=gb2312">
G、content-Language(顯示語言的設定)
用法:<meta http-equiv="Content-Language" content="zh-cn" />
功能
上面我們介紹了meta標簽的一些基本組成,接著我們再來一起看看meta標簽的常見功能:

Ⅱ web前端img是什麼標簽

img 元素向網頁中嵌入一幅圖像。
請注意,從技術上講,<img> 標簽並不會在網頁中插入圖像,而是從網頁上鏈接圖像。<img> 標簽創建的是被引用圖像的佔位空間。
<img> 標簽有兩個必需的屬性:src 屬性 和 alt 屬性。

Ⅲ web前端開發中的實體標簽是什麼

查閱資料之後想到一下幾種解決方法
1,使用position:absolute模擬
<script type="text/javascript">
window.onscroll=function(){
$(".fixed").css("top",$(window).scrollTop());
$(".foot").css("top",$(window).scrollTop()+$(window).height());
}
</script>
問題來了:滑動頁面時頭部底部div會有明顯的抖動。
2,判斷當前獲得焦點元素是input則隱藏div改為position:absolute
<body onload=setInterval("a()",500)>
<script type="text/javascript">
function a(){
if(document.activeElement.tagName == 'INPUT'){
$(".fixed").css({'position': 'absolute','top':'0'});
} else {
$(".fixed").css('position', 'fixed');
}
}
</script>
問題來了:不停監控dom,消耗資源。如果input個數較少,可在input裡面添加onfocus事件好一些。但是如果是底部固定div此方法好像不太給力。

3,插件iscroll.js個人感覺不是很好用。可能方法不對,jQuery Mobile 沒嘗試,感覺會增負擔。

4,重點來了:
只需要在中間部分外層div添加css樣式position:fixed;top:50px; bottom:50px;overflow:scroll;就可以實現效果,無需插件。可拷貝下面代碼運行。
<!DOCTYPE html>
<html lang="zh_cmn">
<head>
<meta charset=utf-8 />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<title></title>
<style>
.head,.foot{position:fixed;left:0;height:38px;line-height:38px;width:100%;background-color:#99CC00;}
.head{top:0;}
.foot{bottom:0;}
.main{position:fixed;top:38px;bottom:38px;width:100%;overflow:scroll;background-color:#BABABA;}
</style>
</head>
<body>
<header class="head">頂部固定區域</header>
<article class="main" id="wrapper">
<div>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<p>當內容欲出隱藏時,灰色區域可上下拖動</p>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
<input type="text" value="" class="inputtext"> <br>
content <br>
content <br>
content <br>
content <br>
content <br>
content <br>
content <br>
content <br>
content <br>
</div>
</article>
<footer class="foot">底部固定區域</footer>
</body>
</html>
當小鍵盤出現時頭部、底部自動跳到頁面最頂端、最底端。鍵盤隱藏時又會固定在頭部,底部。頓時感覺開朗了。

—— 【仙】墨紙

Ⅳ web前端下劃線標簽是什麼

在網頁上顯示下劃線效果的標簽是<u></u>。這是一個雙閉合標簽,使用下劃線強調的內容放在開始標簽和結束標簽之內。如圖:

<u>標簽使用案例

Ⅳ 前端規范,HTML的標簽內,等標簽順序是怎樣的

李南江的視頻里教了很多

Ⅵ web前端a標簽、span標簽、p標簽、h標簽有什麼區別

在html標准文檔流裡面,
1.
a,span標簽屬於行內元素,p,h標簽屬於塊級元素
2.
a標簽中的內容是頁面鏈接形式,span標簽往往是純文本,p標簽中可包含多個span標簽文本,h標簽內也主要是文本(在seo優化當中,h標簽往往具有較高權重)

Ⅶ 前端的標簽這么多,怎麼記憶

其實,你只要記住一些常用的就可以了,到了後期的實際工作,忘了你可以網路一下……

Ⅷ 【Web前端基礎】JavaScript標簽有哪些

只有一個標簽<script>,寫在html中,可以寫在html的head標簽中也可以寫在body標簽中

script標簽可以用來引入外部js文件,也可以直接寫js代碼:

  1. <script type="text/javascript" src="yourjsfile.js"></script>

  2. <scripttype="text/javascript">

    //js代碼

    </script>

Ⅸ 前端 標簽裡面放{}是什麼意思

沒有看到是標簽里有花括弧,你這個不就是正常文本嗎,顯示在瀏覽器上就是代碼中的一樣,或者你這個html模板是通過某種框架渲染出來的,花括弧就代表知道的功能,比如mako模板中使用 ${xxx} 就是渲染後台傳過來的xxx值,所以你看下是否使用了什麼web框架

Ⅹ web前端頁面布局,一般情況用哪些標簽最好,可以盡可能地達到各瀏覽器對標簽元素的識別

用DIV寫是最好的。瀏覽器無論是信息的爬蟲和頁面的重構都會很好。瀏覽器兼容的問題主要是你CSS寫的嚴謹不嚴謹。你CSS寫的不夠全有的瀏覽器自然會有這些問題。而且有的屬性可能不兼容每個瀏覽器。標簽最好的就是DIV了。