尖角在上面

成都創(chuàng)新互聯(lián)公司服務項目包括和平網(wǎng)站建設、和平網(wǎng)站制作、和平網(wǎng)頁制作以及和平網(wǎng)絡營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關系等,向廣大中小型企業(yè)、政府機構等提供互聯(lián)網(wǎng)行業(yè)的解決方案,和平網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務的客戶以成都為中心已經(jīng)輻射到和平省份的部分城市,未來相信會繼續(xù)擴大服務區(qū)域并繼續(xù)獲得客戶的支持與信任!
代碼:
html
head
title尖角div/title
style type="text/css"
#top
{
width:400px;
height:250px;
border:3px solid; /* 邊框寬度為3px */
position:relative;
}
.sp1,.sp2
{
display:block;
height:0px;
width:0px;
position:absolute;
font-size:0;
line-height:0;
}
.sp1
{
top:-9px; /* 它的絕對值加上span的邊框寬度等于div邊框寬度的5倍 */
left:40px; /* 它來確定尖角的位置 */
border-top:0px;
border-bottom:6px solid black; /* 注意顏色的變化 */
border-right:6px solid white;
border-left:6px solid white;
}
.sp2
{
top:6px; /* 是自身邊框寬度的2倍 */
left:-3px; /* 是自身邊框寬度的-1倍 */
border-top:0px;
border-bottom:3px solid white;
border-right:3px solid black;
border-left:3px solid black;
}
/style
/head
body
div id="top"
span class="sp1"
span class="sp2"/span
/span
/div
/body
/html
尖角在下面
代碼:
html
head
title尖角div/title
style type="text/css"
#bottom
{
width:400px;
height:250px;
border:3px solid; /* 邊框寬度為3px */
position:relative;
}
.sp1,.sp2
{
display:block;
height:0px;
width:0px;
position:absolute;
font-size:0;
line-height:0;
}
.sp1
{
bottom:-9px; /* 它的絕對值加上span的邊框寬度等于div邊框寬度的5倍 */
left:40px; /* 它來確定尖角的位置 */
border-bottom:0px;
border-top:6px solid black; /* 注意顏色的變化 */
border-right:6px solid white;
border-left:6px solid white;
}
.sp2
{
bottom:6px; /* 是自身邊框寬度的2倍 */
left:-3px; /* 是自身邊框寬度的-1倍 */
border-bottom:0px;
border-top:3px solid white;
border-right:3px solid black;
border-left:3px solid black;
}
/style
/head
body
div id="bottom"
span class="sp1"
span class="sp2"/span
/span
/div
/body
/html
尖角在左邊
代碼:
html
head
title尖角div/title
style type="text/css"
#left
{
width:400px;
height:250px;
border:3px solid; /* 邊框寬度為3px */
position:relative;
}
.sp1,.sp2
{
display:block;
height:0px;
width:0px;
position:absolute;
font-size:0;
line-height:0;
}
.sp1
{
left:-9px; /* 它的絕對值加上span的邊框寬度等于div邊框寬度的5倍 */
top:40px; /* 它來確定尖角的位置 */
border-left:0px;
border-top:6px solid white; /* 注意顏色的變化 */
border-right:6px solid black;
border-bottom:6px solid white;
}
.sp2
{
left:6px; /* 是自身邊框寬度的2倍 */
top:-3px; /* 是自身邊框寬度的-1倍 */
border-left:0px;
border-top:3px solid black;
border-right:3px solid white;
border-bottom:3px solid black;
}
/style
/head
body
div id="left"
span class="sp1"
span class="sp2"/span
/span
/div
/body
/html
尖角在右邊
代碼:
html
head
title尖角div/title
style type="text/css"
#right
{
width:400px;
height:250px;
border:3px solid; /* 邊框寬度為3px */
position:relative;
}
.sp1,.sp2
{
display:block;
height:0px;
width:0px;
position:absolute;
font-size:0;
line-height:0;
}
.sp1
{
right:-9px; /* 它的絕對值加上span的邊框寬度等于div邊框寬度的5倍 */
top:40px; /* 它來確定尖角的位置 */
border-right:0px;
border-top:6px solid white; /* 注意顏色的變化 */
border-bottom:6px solid white;
border-left:6px solid black;
}
.sp2
{
right:6px; /* 是自身邊框寬度的2倍 */
top:-3px; /* 是自身邊框寬度的-1倍 */
border-right:0px;
border-top:3px solid black;
border-bottom:3px solid black;
border-left:3px solid white;
}
/style
/head
body
div id="right"
span class="sp1"
span class="sp2"/span
/span
/div
/body
/html
用CSS定位的方法
css代碼
.caption{width:100%;height:180px;background-color:#000;opacity:.6;position:realtive;}
.triangle{display :block;width:20px;height:20px;background:url(三角形圖片路徑) no-repeat;position:absolute;left:200px;top:0;}
html代碼
div class="caption"span class="triangle"/span/div
是的
一、前言
前3篇文章實際都是為本文做鋪墊的,如果以下棋表示,前三篇是普通走棋,本篇是將軍!
目前市面上有不少表單驗證插件,看似強大,實在糟糕!
總結下,有以下一些問題:
過多干預
包括:改變了表單元素UI, 為表單元素綁定過多事件等
布局等限制
包括:需要特定結構的布局,需要特定的類名或者ID
學習成本
包括:N多元作者自定義的屬性,或者自定義的特定的數(shù)據(jù)結構
可用性
當JS出現(xiàn)錯誤的時候而無法正常運作的時候,驗證就是聾子的耳朵——擺設,即使在現(xiàn)代瀏覽器下也是如此。
面向未來的表單驗證
驗證驅動
驗證信息HTML驅動,例如HTML5中required,?pattern,?multiple等
驗證形式
非即時響應,submit驗證,如Chrome瀏覽器的處理;或者弱即時響應,如FireFox瀏覽器僅僅紅色外發(fā)光。
驗證交互
浮動形式,尖角指示。
換言之,所謂面向未來的表單驗證,是遵循W3C HTML5規(guī)范的表單驗證,我們可以從目前領先的瀏覽器中看到大致雛形。而本文所有展示的html5Validate表單驗證插件,就是基于這個未來設計的。
二、html5Validate概述
html5Validate插件的驗證機制、交互形式甚至形式與Chrome瀏覽器HTML5表單內置驗證走的很近。在使用的時候,就是寫寫原生的HTML5表單代碼。我只想說:走陽光大道和過獨木橋的感覺是完全不一樣的。
舉個簡單例子,一個郵箱驗證,HTML5代碼表示應該是下面這個樣子:
input type="email" required
好巧的是,使用html5Validate進行表單驗證的時候,也是使用上面這段HTML代碼!
類似下面的綁定:
$("form").html5Validate();
于是,您在提交表單的時候會(在各個瀏覽器下)看到這樣子的提示:
跟Chrome瀏覽器下的提示文字近似:
html5Validate支持我所知的HTML5驗證相關的東西,如type="email",?type="number",?type="tel",?type="url",?step,?min,?max,?required,?pattern,?multiple等,并有一些本地化擴展,如增加了type="zipcode"郵編等,支持type="hidden"的完整驗證(HTML5中是忽略的),支持多type共存,例如type="email|tel", 可以讓文本框輸入郵箱或者手機號碼。
type="date",?type="hour",?type="password"等因為不同網(wǎng)站規(guī)則不一樣,因此,沒有放在html5Validate中,不過,您可以很簡單地進行擴展,使您的項目支持之,這個后面會介紹(參見 part 9-4)。
為了滿足實際開發(fā)需求,額外增加了四個自定義屬性值:data-key,?data-target,?data-min,?data-max. 具體何用,下面會詳細講解。
支持自動的全角轉半角。
注意:type="submit",?type="reset",?type="file",?type="image"以及disabled的表單元素沒有驗證性可言,因此,下面所說的表單元素,并不包括他們。
兼容性
html5Validate通過jQuery1.4+測試,支持正常IE6-IE10瀏覽器,F(xiàn)ireFox, Chrome等現(xiàn)代瀏覽器。
新聞名稱:html5尖角,html尖角效果
標題路徑:http://chinadenli.net/article35/dsihcsi.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、Google、移動網(wǎng)站建設、品牌網(wǎng)站設計、ChatGPT、網(wǎng)站內鏈
聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)