PIXNET Logo登入

程式設計@筆記

跳到主文

一個常常忘記code的php工程師寫下的筆記。

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 2月 13 週二 201816:55
  • [CSS]當文字要壓在圖片上,並作RWD的自適應

當文字要壓在圖片上,可以使用 transform:translate
並配合@media screen 調整文字大小即可

例:
<div style="width:100%; background-image:url(images/bg1.jpg);background-size:cover;background-position:center;position:relative;">
<span id="person" style="position:absolute;color:#E6B800; font-weight:800; font-size:80px; top:64%;left:74%;transform: translate(-64%, -74%); z-index:1000;">文字</span>
<img src="圖片" style="display:block;max-width:100%; margin:0 auto;" >
</div>
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(9,912)

  • 個人分類:css
▲top
  • 2月 08 週四 201814:46
  • [CSS]使用純CSS將輸入的字母轉換大寫或小寫

 
輸入字母轉成大寫
<input name="first_name" type="text" style="text-transform:uppercase;" placeholder="輸入字母轉大寫" />
輸入字母轉成小寫
<input name="first_name" type="text" style="text-transform:lowercase;" placeholder="輸入字母小寫" />
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(331)

  • 個人分類:css
▲top
  • 1月 26 週五 201814:03
  • 使用.htaccess檔 關閉目錄索引

將下列這一行,存成.htaccess檔,並上傳即可。
Options All -Indexes
 
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(49)

  • 個人分類:其它
▲top
  • 1月 18 週四 201814:34
  • [CSS]讓舊網站上稿的table表格,也能自適應(編輯器適用)

 
<style>
table{
width:auto;
max-width:100%;
}
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(102)

  • 個人分類:css
▲top
  • 1月 15 週一 201815:17
  • [php]使用phpmailer發送126網易信箱範例程式(萬網虛擬主機適用)

<?php
require("class.phpmailer.php"); //這個是一個smtp的php文檔,網上可以下載得到
$mail = new PHPMailer(); //建立郵件發送類
$mail->CharSet = "UTF-8";
$address ="gio@ecotw.com.tw";
$mail->IsSMTP(); // 使用SMTP方式發送
$mail->Host = "smtp.126.com"; // 您的企業郵局域名
$mail->SMTPAuth = true; // 啟用SMTP驗證功能
$mail->Username = "startboxfuwu@126.com"; // 郵局用戶名(請填寫完整的email地址)
$mail->Password = "fuwu987654321"; // (驗證碼)
$mail->Port=25;
$mail->From = "startboxfuwu@126.com"; //郵件發送者email地址
$mail->FromName = "小游";
$mail->AddAddress("$address", "小游");//收件人地址,可以替換成任何想要接收郵件的email信箱,格式是AddAddress("收件人email","收件人姓名")
//$mail->AddReplyTo("", "");
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(68)

  • 個人分類:php實用技巧
▲top
  • 1月 03 週三 201815:36
  • 使用Jquery讓你的iframe也能RWD(嵌入youtube專用)

<script>
// Find all iframes
var $iframes = $("iframe" );
// Find &#x26; save the aspect ratio for all iframes
$iframes.each(function () {
$( this ).data( "ratio", this.height / this.width )
// Remove the hardcoded width &#x26; height attributes
.removeAttr( "width" )
.removeAttr( "height" );
});
// Resize the iframes when the window is resized
$( window ).resize( function () {
$iframes.each( function() {
// Get the parent container&#x27;s width
var width = $( this ).parent().width();
$( this ).width( width )
.height( width * $( this ).data( "ratio" ) );
});
// Resize to fix all iframes on page load.
}).resize();
</script>
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(454)

  • 個人分類:JQuery
▲top
  • 1月 02 週二 201815:55
  • 使用.htaccess 禁止目錄執行php檔案

 
<Files ~ ".php">
Order allow,deny
Deny from all
</Files>
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(111)

  • 個人分類:其它
▲top
  • 12月 27 週三 201717:45
  • [CSS]讓CKeditor編輯器上傳圖片自動適應RWD頁面

<style>
#content img
{
max-width:100% !important;
height:auto !important;
}
</style>
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(729)

  • 個人分類:css
▲top
  • 12月 22 週五 201711:40
  • [JQuery][屬性] 使用removeAttr() 方法從被選元素中移除屬性

 
用法
$("#元素").removeAttr('屬性值');

例:
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").removeAttr("style");
});
});
</script>
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(124)

  • 個人分類:JQuery
▲top
  • 12月 22 週五 201711:12
  • [JQuery][屬性] 使用.prop() 取得或設置 checked 、selected、readonly 、disabled 屬性

例:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>prop demo</title>
<style>
p {
margin: 20px 0 0;
}
b {
color: blue;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<input id="check1" type="checkbox" checked="checked">
<label for="check1">Check me</label>
<p></p>
<script>
$( "input" ).change(function() {
var $input = $( this );
$( "p" ).html(
".attr( \"checked\" ): <b>" + $input.attr( "checked" ) + "</b><br>" +
".prop( \"checked\" ): <b>" + $input.prop( "checked" ) + "</b><br>" +
".is( \":checked\" ): <b>" + $input.is( ":checked" ) + "</b>" );
}).change();
</script>
</body>
</html>
(繼續閱讀...)
文章標籤

stockwfj3 發表在 痞客邦 留言(0) 人氣(275)

  • 個人分類:JQuery
▲top
«123...92»

ad

文章搜尋

熱門文章

  • (12,391)[php] array_push 一個或多個單元加入陣列末尾
  • (1,859)[php]session_save_path 讀取與設置當前會話的保存路徑
  • (1,820)[php]file_put_contents() 函數把一個字符串寫入文件中
  • (1,783)[php]取得使用者IP位置
  • (705)[php]flock() 函數鎖定或釋放文件。
  • (460)[php]str_split — 將字符串轉換為數組
  • (381)[php] PHP將網址字串轉換成URL
  • (237)php模擬String.TrimEnd函數,移除最後一個逗號或符號
  • (225)[php] array_walk — 對陣列中的每個成員應用用戶函數
  • (97)[php]session_abort 丟棄session陣列的變化和完成session

文章分類

toggle 其它分類 (8)
  • JQuery (16)
  • Android (20)
  • html (7)
  • 其它 (5)
  • codeigniter (13)
  • Mysql (6)
  • javascript (12)
  • css (26)
  • php實用技巧 (17)
  • php常用函數 (44)
  • PDO函數 (36)
  • GD函數 (106)
  • php字符串函數 (70)
  • php陣列 (62)
  • php日期函數 (38)
  • Directory函數 (8)
  • Filesystem函數 (58)
  • Math 函數 (44)
  • json函數 (2)
  • Session 函数 (14)
  • Cookies操作 (7)
  • ftp函數 (20)
  • ctype函數 (8)
  • Misc 雜項函數 (19)
  • cURL 函数 (25)
  • MySQLi函數 (53)
  • SimpleXML函數 (23)
  • Calendar 日曆函數 (17)
  • URL 函數 (10)
  • iconv 函數 (11)
  • Network函數 (24)
  • Multibyte String (45)
  • Zip壓縮函數 (22)
  • Variable handling (28)
  • 未分類文章 (1)

最新文章

  • 解決CKEditor中img標籤自動添加style樣式的問題-禁止自動設置width和height
  • [css]強迫匯出excel的欄位格式轉為純文字
  • [html]使用frame無框轉址
  • [css]解決英文字穿過text-decoration-line底線問題
  • [Jquery]停止所有youtube播放(iframe embed)
  • [Mysql]將字串欄位轉成數字排序或加總金額(使用CAST)
  • [Jquery]讓html檔也能使用include方法
  • [html]textarea預設文字並換行
  • [html5]使用正則 pattern 判斷日期格式
  • [CSS]當文字要壓在圖片上,並作RWD的自適應

文章精選