Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 手机看片日韩国产一区二区,一级全黄60分钟免费,浪货一天不做就难受呀

          整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          CSS3實現鼠標滑過高光凸起展示效果

          似一些大型電商網站,一般很多產品展示圖都加上了很多炫酷的效果來增強用戶體驗。當鼠標移上去就會出現特效是常見的一種動作,下面主要說說鼠標經過圖片時候出現高光的特效。效果如下:

          紅色指向是出現高光的部分

          重要的CSS3樣式:

          主要用來背景的漸變來實現那條高光,然后再運用動畫來實現運動的距離位置!

          本教程中,我們將向您展示如何突出顯示和預覽集成在文章中或分布在頁面上的圖像。這是允許用戶查看與某個上下文相關的圖像的更大版本的好方法。我們將在延遲懸停的情況下突出顯示圖像,并提供預覽模式,將屏幕上放大和居中圖像的較大版本。

          開始吧!

          標記

          對于HTML結構,我們只需要考慮圖像及其類。該圖像可以放置在您的網站的任何地方:

          <img src = “images / thumbs / 1.jpg” alt = “images / 1.jpg” class = “ih_image” />

          我們使用alt屬性將引用添加到較大的圖像。

          我們還將在正文結束之前添加一個疊加元素:

          < div id = “ih_overlay” class = “ih_overlay” style = “display:none;” > </ div >

          我們將用JavaScript創建的結構如下所示:

          <div id="ih_clone" class="ih_image_clone_wrap">
          <span class="ih_close"></span>
          <img class="preview" src="images/1.jpg"></div>

          這個結構不會被放置在我們的HTML中 - 它將被動態創建。

          現在,我們來看看風格。

          CSS

          首先,我們將定義覆蓋的樣式:

          .ih_overlay{	position:fixed;	top:0px;	left:0px;	right:0px;	bottom:0px;	background:#000;	z-index:10;	opacity:0.9;	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=90);}

          filter屬性用于在IE中應用透明度。為了始終顯示,我們使覆蓋層固定,即使我們滾動頁面。

          我們想要應用我們的效果的圖像將具有以下樣式:

          img.ih_image{	margin:10px 0px;	position:relative;	-moz-box-shadow:1px 1px 4px #000;	-webkit-box-shadow:1px 1px 4px #000;	box-shadow:1px 1px 4px #000;	opacity:0.7;	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);}

          這很簡單,我們只是添加一些盒子陰影。

          在我們的JavaScript中,我們將創建一個包含我們所徘徊的圖像的克隆的包裝器。它將獲得與當前圖像相同的位置。這就是為什么我們不在這里定義頂部和左側,而是動態地在JS中。

          .ih_image_clone_wrap{	position:absolute;	z-index:11;}

          我們還將添加一些圖標,可以顯示放大鏡,加載圖像或十字的跨度。我們定義所有的共同屬性如下:

          .ih_image_clone_wrap span.ih_zoom,.ih_image_clone_wrap span.ih_loading,.ih_image_clone_wrap span.ih_close{	position:absolute;	top:10px;	right:10px;	width:24px;	height:24px;	-moz-border-radius:6px;	-webkit-border-radius:6px;	border-radius:6px;	opacity:0.8;	cursor:pointer;	-moz-box-shadow:1px 1px 2px #000;	-webkit-box-shadow:1px 1px 2px #000;	box-shadow:1px 1px 2px #000;	z-index:999;	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80);}

          每個類的具體屬性,如背景,將被定義如下:

          .ih_image_clone_wrap span.ih_zoom{	background:#000 url(../icons/zoom.png) no-repeat center center;}.ih_image_clone_wrap span.ih_loading{	background:#000 url(../icons/loader.gif) no-repeat center center;}.ih_image_clone_wrap span.ih_close{	background:#000 url(../icons/close.png) no-repeat center center;}.ih_image_clone_wrap img{	opacity:0.7;	-moz-box-shadow:1px 1px 10px #000;	-webkit-box-shadow:1px 1px 10px #000;	box-shadow:1px 1px 10px #000;	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=70);}

          我們將在縮略圖上加載的全尺寸圖像將具有以下樣式:

          .ih_image_clone_wrap img.preview{	opacity:1;	position:absolute;	top:0px;	left:0px;}

          現在,讓我們添加一些魔法!

          JavaScript

          在我們的jQuery函數中,我們將首先定義一個變量來控制高亮效果的時間。

          當我們將鼠標懸停在具有特定類的圖像上時,我們使用類ih_image_clone_wrap創建div,并通過獲取當前圖像的位置來定義其位置。

          /*** timeout to control the display of the overlay/highlight*/var highlight_timeout;/*** user hovers one image:* create a absolute div with the same image inside,* and append it to the body*/$('img.ih_image').bind('mouseenter',function () {		var $thumb = $(this);
          var $clone = $('<div />',{			'id'		: 'ih_clone',			'className'	: 'ih_image_clone_wrap',			'html' 	: '<img src="' + $thumb.attr('src') + '" alt="' + $thumb.attr('alt') + '"/><span class="ih_zoom"></span>',			'style'		: 'top:' + $thumb.offset().top + 'px;left:' + $thumb.offset().left + 'px;'
          });
          var highlight = function (){
          $('#ih_overlay').show();
          $('BODY').append($clone);
          }
          //show it after some time ...
          highlight_timeout = setTimeout(highlight,700);
          /**
          * when we click on the zoom,
          * we display the image in the center of the window,
          * and enlarge it to the size of the real image,
          * fading this one in, after the animation is over.
          */
          $clone.find('.ih_zoom').bind('click',function(){			var $zoom = $(this);
          $zoom.addClass('ih_loading').removeClass('ih_zoom');			var imgL_source = $thumb.attr('alt');
          $('<img class="ih_preview" style="display:none;"/>').load(function(){				var $imgL = $(this);
          $zoom.hide();
          var windowW = $(window).width();				var windowH = $(window).height();				var windowS = $(window).scrollTop();
          $clone.append($imgL).animate({
          'top'			: windowH/2 + windowS + 'px',					'left'			: windowW/2 + 'px',					'margin-left'	: -$thumb.width()/2 + 'px',					'margin-top'	: -$thumb.height()/2 + 'px'
          },400,function(){					var $clone = $(this);					var largeW = $imgL.width();					var largeH = $imgL.height();
          $clone.animate({
          'top'			: windowH/2 + windowS + 'px',						'left'			: windowW/2 + 'px',						'margin-left'	: -largeW/2 + 'px',						'margin-top'	: -largeH/2 + 'px',						'width'			: largeW + 'px',						'height'		: largeH + 'px'
          },400).find('img:first').animate({						'width'			: largeW + 'px',						'height'		: largeH + 'px'
          },400,function(){						var $thumb = $(this);						/**
          * fade in the large image and
          * replace the zoom with a cross,
          * so the user can close the preview mode
          */
          $imgL.fadeIn(function(){
          $zoom.addClass('ih_close')
          .removeClass('ih_loading')
          .fadeIn(function(){
          $(this).bind('click',function(){
          $clone.remove();
          clearTimeout(highlight_timeout);
          $('#ih_overlay').hide();
          });
          $(this).bind('click',function(){
          $clone.remove();
          clearTimeout(highlight_timeout);
          $('#ih_overlay').hide();
          });
          });
          $thumb.remove();
          });
          });
          });
          }).error(function(){				/**
          * error loading image
          * maybe show a message like
          * 'no preview available'?
          */
          $zoom.fadeOut();
          }).attr('src',imgL_source);
          });}).bind('mouseleave',function(){	/**
          * the user moves the mouse out of an image.
          * if there's no clone yet, clear the timeout
          * (user was probably scolling through the article, and
          * doesn't want to view the image)
          */
          if($('#ih_clone').length) return;
          clearTimeout(highlight_timeout);});/*** the user moves the mouse out of the clone.* if we don't have yet the cross option to close the preview, then* clear the timeout*/$('#ih_clone').live('mouseleave',function() {	var $clone = $('#ih_clone');	if(!$clone.find('.ih_preview').length){
          $clone.remove();
          clearTimeout(highlight_timeout);
          $('#ih_overlay').hide();
          }});

          就這樣!我們希望你喜歡這個教程,并覺得它有用!

          、HTML文本結構

          瀏覽器通常會為其文本元素添加不同的樣式,以區別于普通文本。例如 em 和 cite 元素中的文本都是斜體的。又如,code 元素專門用來格式化腳本或程序中的代碼,該元素中的文本默認使用等寬字體。內容顯示的樣子與其使用的標記沒有關系。因此不應該為了讓文字變為斜體就使用 em 或 cite,添加樣式是 css 的事情。相反,應該選擇能描述內容的 HTML 元素。

          1. 添加段落:要在網頁中開始一個新的段落,使用 p元素。(通過 css 可以為段落添加樣式,包括字體、字號、顏色等。以及控制內行間距,段落文本對齊方式等。)
          <p> HTML <small> HyperText Markup Language </small> </p> 
          1. 指定細則:small元素 表示細則一類的旁注,通常是文本中的一小塊。
          <p> HTML <small> HyperText Markup Language </small> </p> 

          3.標記重要和強調文本strong元素 表示內容的重要性,而 em元素 表示內容的著重點。

             <p> <strong> Warning:Do not approach the ... <em>
               under any... </em> </strong> just because... </p>

          瀏覽器通常將 strong 文本以粗體顯示,em 文本以斜體顯示。可以用 CSS 將任何文本變為粗體或斜體,也可以覆蓋 strong 和 em 等元素的瀏覽器默認顯示樣式。

          4.創建圖:圖可以是圖表、照片、圖形、插圖、代碼片段以及其他類似的獨立內容。通過引入 figure 和 figcaption,figcaption 是 figure 的標題。

          <figure>
          <figcaption>
           [標題內容]
          </figcaption>
           [插入內容]
          <img src = "xxx.png" width = "180" height = "143" 
           alt = "Reveue chart:Clothing 42%,Toys 36%, Food 22%" />
          </figure>

          figcaption 元素并不是必須的,但是只有包含它,就必須是 figure 元素內嵌的第一個或最后一個,且只能有一個。 5.指明引用或參考:使用 cite元素 可以指明對某內容源的引用或參考。默認以斜體顯示(不因使用 cite 引用人名)

           <p> he Listend to <cite> Abbey Road </cite> </p>

          6.引述文本:有兩個特殊的元素用以標記引述的文本。blockquote元素 表示單獨存在的引述,其默認顯示在新的一行。而 q元素 則用于短的引用,如句子里面的引述。由于q元素存在夸瀏覽器問題,應該避免使用,而是直接輸入引號。

          <blockquote>
           text...
          </blockquote>
          瀏覽器對應q元素中的文本自動加上語音的引號。
          <p> And then she said,<q lang ="" > Have you read... </q> </p>

          7.指定時間:使用 time元素 標記時間、日期或時間段。輸入 datetime="time" 指定格式日期,可以按照你希望的任何形式表示日期。

          <time> 16:20 </time>  <time > 2021-07-24 </time>
          <time datetime= "2021-07-24"> Ochtober 24,2021 </time>

          8.解釋縮寫詞:使用 abbr元素 標記縮寫詞并解釋其含義。(通常是使用括號提供縮寫詞的全稱是解釋縮寫詞最直接的方式)

          <p> The <abbr title = "Notional Football league"> NFL </abbr> </p>
          <p> But,that's ... <abbr> MLB </abbr> (Major league Baseball) ... </p>

          9.定義術語:在HTML中定義術語時,使用 dfn元素 對其作語義上的區分,首次定義術語通常會對其添加區別于其他文本格式,后續在使用術語時不再需要使用dfn對其進行標記。 (默認以斜體顯示)

            <p> The contesttant ... <dfn> pleonasm </dfn> </p>

          10.創建上標和下標:比主體文本稍高或稍低的字母或數字分別成稱為上標和下標。可以使用 sub元素 創建下標, sup元素 創建上標。上標和下標字符會輕微地擾亂行與行之間的均勻間距,但可以使用 CSS 修復這個問題。

          <p> ... <a href = "#footnote-1" title = "REad footnote 1"> 
              Text   <sub> 1 </sub> </a> </p>
          <p> ... <a href = "#footnote-1" title = "REad footnote 1">
              Text <sup> 1 </sup> </a> </p>

          11.添加作者聯系方式: address元素 用以定于與 HTML 頁面或頁面一部分有關的作者、相關人士信息或組織聯系信息,通常位于頁面底部或相關部分內。

           <footer role = "contentinfo">
            <p> <small> ? 2021 The Paper of ... </small> </p>
           <address>
            Hava a question or ... <a href = "site-feedback.html"> Contact our </a>
            </address>		
          </footer>

          12.標注編輯和不再準確的文本:有時可能需要將在前一版本之后對頁面的編輯標出來,或者對不再準確、不再相關的文本進行標記。有兩種用于標注編輯的元素:代表添加內容的 ins元素 和標記已經刪除內容的 del元素。

            <li> <del> desks </del> </li>
            <li> <ins> bicycle </ins> </li>

          通常對已刪除的文本加上刪除線,對插入的文本加入下劃線。標記不再準確或不再相關的文本

            <li> <s> 5 p.m </s> SOLD </li>

          13.標記代碼:如果你的內容包含代碼示例或文件名,使用 code元素

           <p> The <code> showPhoto() </code> ... <code> < ;ul 
           id = "thumbanil" > </code> list </p>

          14.使用預格式化的文本:通常瀏覽器會將所有額外的回車和空格壓縮,并根據窗口大小自動換行,預格式化的文本可以保持固有的換行和空格。pre元素

          <pre>
           <code>
            abbr[title] {
              border-boottom: 1px dotted #000;
            }
          </code>

          如果要顯示包含 HTML 元素內容,應將包圍元素名稱的 < 和 > 分別改為對應的字符實體<和 >否則瀏覽器就會試著顯示這些元素。大多數情況下推薦隊 div 元素使用 white-space:pre 以替代 pre,因為空格可能對這些內容的語義非常重要。

          15.突出顯示文本:類似文本中的熒光筆!HTML5 使用新的 mark元素 實現,引起讀者對特定文本片段的注意。對原生支持的瀏覽器將對該元素文字默認加上黃色背景。

          <p> GSL is <mark> YYDS! </mark>     

          16.創建換行:當我們希望在文本中手動強制文字進行換行時,可以使用 br元素 (空元素).

          <p> 123 <br />
              456 <br />
          </p>

          17.創建span:同 div 一樣,span元素 是沒有任何語義的,不同的是,span 只適合包圍字詞或短語內容,而 div 適合包含塊級內容。

           <p> Gaudi's work was essentially useful.
           <span lang ="es"> La Casa Mila </span> is an ...
           </p>

          18.其他元素

          U元素:用來為文本添加下劃線。

          wbr元素:表示可換行處。讓瀏覽器知道在哪里可以根據需要進行換行(存在跨版本問題)。

          ruby元素:旁注標記是一種慣用符號,通常用于表示生僻字的發音。

          bdi和bdo元素:如果某些頁面中混合了從左至右書寫的字符(如拉丁字符)和從右至左書寫的字符(如阿拉伯語), 就可能使用到bdi和bdo元素。

          meter元素:用 meter 元素表示分數的值或已知范圍的測量結果。

            <p> Project completion status: <meter value="0.60">80% completed </meter> </p>

          progress元素:表示某項任務完成的進度,可用它表示一個進度條。不能與 meter 混在一起使用。

          <p> Current progress: <progress max="100" value="30"> 30% saved </progress> </p>

          二、 HTML圖片

          在頁面插入圖片:輸入 <img src=image.url" />

          <img src="xxx.jpg" alt="" />      

          提供替代文本:在 img 標簽內,src 屬性及值的后面,輸入 alt=""; 輸入圖像出于某種原因沒有顯示時應該出現的文本。指定圖像的尺寸:在 img 標簽內,src 屬性后輸入width="x", heigth="y"; 以像素為單位指定 x 和 y。

          三、 HTML鏈接

          創建一個指向另一個網頁的鏈接:

          輸入 <a href="URL"> 此處輸入鏈接標簽 </a>
              
          <a href = "http://www.baidu.com"> 百度一下 </a>    

          創建錨并鏈接到錨: 通常激活一個鏈接會將用戶帶到對應網頁的頂端。如果想用戶跳至網頁特定區域,可以創建一個錨,并在鏈接中引用該錨。

          1.創建錨: 輸入 id="anchor-name",其中 name 是在內部用來標識網頁中這部分內容的文字。

          2.創建錨鏈接到特定錨鏈接:輸入 <a href="#"anchor-name>,其中 anchor-name 是目標的 id 屬性值。

          3.輸入標簽文本(默認帶下劃線藍色字體),用戶激活該字體時將用戶帶到(1)步中引用的區域文本。

          ```<!DOCTYPE html>
          <html lang="en">
          <head>
          	<meta charset="utf-8" />
          	<title>Creating and Linking to Anchors</title>
          </head>
          <body>
          
          <article>
          	<header>
          		<h1>Frequently Asked Questions (FAQ)</h1>
          		
          		<nav>
          			<ul>
          				<li><a href="#question-01">Can an id have more than one word?</a></li>
          				<li><a href="#question-02">Can visitors bookmark anchor links?</a></li>
          				<li><a href="#question-03">My anchor link isn't working. What am I doing wrong?</a></li>
          				<li><a href="#question-04">How do I link to a specific part of someone else's webpage?</a></li>
          			</ul>
          		</nav>
          	</header>
          
          	<h2 id="question-01">Can an id have more than one word?</h2>
          	<p>Yes, your ids can have more than one word as long as there are no spaces. Separate each word with a dash instead.</p>
          
          	<h2 id="question-02">Can visitors bookmark anchor links?</h2>
          	<p>Yes, they can! And when they visit that link, the browser will jump down to the anchor as expected. Visitors can share the link with others, too, so all the more reason to choose meaningful anchor names.</p>
          
          	<h2 id="question-03">My anchor link isn't working. What am I doing wrong?</h2>
          	<p>The problem could be a few things. First, double-check that you added an id (without "#") to the element your link should point to. Also, be sure that the anchor in your link <em>is</em> preceded by "#" and that it matches the anchor id.</p>
          
          	<h2 id="question-04">How do I link to a specific part of someone else's webpage?</h2>
          	<p>Although you obviously can't add anchors to other people's pages, you can take advantage of the ones that they have already created. View the source code of their webpage to see if they've included an id on the part of the page you want to link to. (For help viewing source code, consult "The Inspiration of Others" in Chapter 2.) Then create a link that includes the anchor.</p>
          </article>
          
          </body>
          </html>


          作者:excavate
          https://juejin.cn/post/6988467705909248014


          主站蜘蛛池模板: 麻豆视频一区二区三区| 无码精品一区二区三区免费视频| 久久国产一区二区| 爆乳无码AV一区二区三区| 国产一区二区三区在线看| 理论亚洲区美一区二区三区| 色妞色视频一区二区三区四区| 国产成人精品a视频一区| 毛片无码一区二区三区a片视频| 一区二区三区午夜视频| 中文字幕AV一区中文字幕天堂| 精品视频一区在线观看| 在线一区二区三区| 亚洲av色香蕉一区二区三区| 一区二区视频在线观看| 久久精品动漫一区二区三区| 国产免费播放一区二区| 合区精品久久久中文字幕一区| 国产成人高清亚洲一区91| 国产av一区最新精品| 亚洲色精品VR一区区三区| 国产精品视频分类一区| 无码少妇一区二区三区| 国产成人AV一区二区三区无码| 日本欧洲视频一区| 亚洲日本一区二区| 亚洲综合色一区二区三区小说| 色狠狠一区二区三区香蕉| 麻豆AV一区二区三区| 国产精品自拍一区| 国模大胆一区二区三区| 精品一区二区三区3d动漫| 一区二区视频免费观看| 国产免费一区二区三区免费视频| 色狠狠一区二区三区香蕉蜜桃| 国产精品一区二区久久不卡| 久久精品无码一区二区三区| 久久一区二区三区免费播放| 在线视频一区二区| 国模大胆一区二区三区| 中文字幕在线视频一区|