html網頁語法教學

所有文章

如何安全地移除 Laravel Debugbar

現在開始很多人使用Laravel框架製作網站了,但有些人會發現,Laravel網站做好後,卻發現下方一直出現Laravel Debugbar

1639829096805

那要怎麼關閉

在網站根目錄開啟 .env

在最底部加入


  1. DEBUGBAR_ENABLED=false  

 就可以關閉這個功能了

HTML 的轉址 方法

HTML 的轉址 方法

正常你只要在 HTML 裡面的 </head>內加入下方 轉址語法,您的這個頁面就會自動轉址,非常的方便

HTML 的轉址 代碼

  1. <meta http-equiv="refresh" content="0;url=https://你的網址" />    


.htaccess 強制 https

.htaccess 強制 https

很多情況,我們會需要透過

.htaccess 強制 https

這個設定也非常重要。


  1. RewriteEngine On      
  2. RewriteCond %{HTTPS} off   
  3. RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]   


如何簡單在內的網頁連結,可以另開新視窗的方法

如何簡單在內的網頁連結,可以另開新視窗的方法

申請和啟用 Gmail API 的 OAuth 2.0 憑證方法

申請和啟用 Gmail API 的 OAuth 2.0 憑證方法

當我們想要使用免費又好用的寄信伺服器,很多人會使用gmail來操作。

那網站要如何和gmail做結合,那就申請gmail API

申請網址

到主頁https://console.cloud.google.com/

建立專案

messageImage 1593051744453

messageImage 1593051762521

messageImage 1593051858033

搜尋gmail API

gmail 1

gmail 2

gmail 3gmail 4

建立憑證

網頁要如何 rwd 語法Responsive Web Design 自適應網站

網頁要如何 rwd 語法Responsive Web Design 自適應網站

很簡單,需要在網頁的<head></head>

裡面增加,這段語法

rwd-html代碼語法


  1. <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">  

 告訴不同裝置、不同尺寸,有不同的語法

在增加這段代碼,讓圖片適應網頁尺寸

圖片自動適應寬度代碼


  1. img {   
  2. heightauto;   
  3. max-width: 100%;   
  4. }  
PHP按下連結時單擊計數器,保存到txt

PHP按下連結時單擊計數器,保存到txt

如果你想增加一個計數器,該計數器在每次點擊連結時進行計數。 而不想使用資料庫,計數會保存到txt,只有一個連結說“單擊此處”,並且在連結旁邊顯示一個計數器,該計數器從0開始,每次單擊該連結時都會計數。並且其他用戶點擊的時候可以累計,就像youtube的點觀看計數懶功能。

建立php,譬如test.php,放入以下代碼執行,謝謝。

 
  1. <?php   
  2. if(!file_exists('counter.txt')){   
  3.   file_put_contents('counter.txt', '0');   
  4. }   
  5. if($_GET['click'] == 'yes'){   
  6.   file_put_contents('counter.txt', ((int) file_get_contents('counter.txt')) + 1);   
  7.   header('Location: ' . $_SERVER['SCRIPT_NAME']);   
  8.   die;   
  9. }   
  10. ?>   
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
  12.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
  13. <html xmlns="http://www.w3.org/1999/xhtml">   
  14. <head>   
  15.   <title>counter example</title>   
  16. </head>   
  17. <body>   
  18.   <h1><?php echo file_get_contents('counter.txt'); ?></h1>   
  19.   <a href="?click=yes">clickMe</a>   
  20. </body>   
  21. </html>  

html頁面自動刷新代碼9(親測有效)

頁面自動刷新代碼大全,基本上所有要求自動刷新頁面的代碼都有,大家可以自由發揮做出完美的頁面。

專業Google 關鍵字廣告文案寫作,專人Google廣告代操服務,展現出流量轉金流的最大化關鍵字廣告,台北Google廣告,台北Google代理商,關鍵字廣告, 台北 Google 關鍵字廣告,協助企業開通Google Ads帳戶在Google上做廣告。了解有關如何充分利用Google Ads的更多信息 台北基隆GOOGLE關鍵字廣告基隆台北網頁設計費用台北網頁設計價格基隆網頁設計費用

客製化網頁設計,基隆網頁設計,台北網路行銷網站設計,關鍵字廣告,基隆電商電子商務網站,台北電商電子商務網站 ,基隆網頁設計,台北網站設計,google關鍵字廣告,網頁設計課程

代碼一、js方法

 
  1. <script language="JavaScript">   
  2. function myrefresh()   
  3. {   
  4. window.location.reload();   
  5. }   
  6. setTimeout('myrefresh()',3000); //指定3秒更新一次   
  7. </script>  

代碼二、純HTML

下方20指每隔20秒刷新一次頁面.
 
  1. <meta http-equiv="refresh" content="20">   

iframe自動適應高度

我覺得這個代碼方便好用

 

 
  1. <script type="text/javascript">   
  2. function SetCwinHeight()   
  3. {   
  4. var iframeid=document.getElementById("mainframe"); //iframe id   
  5.   if (document.getElementById)   
  6.   {     
  7.    if (iframeid && !window.opera)   
  8.    {     
  9.     if (iframeid.contentDocument && iframeid.contentDocument.body.offsetHeight)   
  10.      {     
  11.        iframeid.height = iframeid.contentDocument.body.offsetHeight;     
  12.      }else if(iframeid.Document && iframeid.Document.body.scrollHeight)   
  13.      {     
  14.        iframeid.height = iframeid.Document.body.scrollHeight;     
  15.       }     
  16.     }   
  17.    }   
  18. }   
  19. </script>   
  20.   
  21. <iframe src="https://adanaa.com/url/" name="mainframe" width="100%" marginwidth="0" marginheight="0" onload="Javascript:SetCwinHeight()"  scrolling="No" frameborder="0" id="mainframe"  ></iframe>   
  22.   
  23.   

xampp或php啟用Zend Optimizer-windows版本

有些人會使用xampp架設網站,或者想要php加速優化,可以啟動php這個Zend Optimizer模組,又稱opcache優化的意思。

通堂在php\ext目錄裡面,有這幾個檔案php_opcache.dll, php\php.ini-production.ini

那就打開php.ini

貼入以下語法

 

 
  1. [opcache]   
  2. zend_extension = "D:\xampp\php\ext\php_opcache.dll"  
  3. opcache.memory_consumption=1024   
  4. opcache.optimization_level=1   
  5. opcache.interned_strings_buffer=8   
  6. opcache.max_accelerated_files=4096   
  7. opcache.revalidate_freq=60   
  8. opcache.fast_shutdown=1   
  9. opcache.enable=1   
  10. opcache.enable_cli=1  

plesk增加gzip壓縮

plesk增加gzip壓縮

進入plesk後台,碘網站與域名,選Apache 與 nginx 設定 到最下面

用css讓wordpress的留言評論大頭貼旋轉起來

方法非常的簡單。
將這段css代碼放在你主題的css裡面就可以囉