new way 1:
.picWrap { position: relative; }
.picWrap img { position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; }
======================================================================
new way 2:
.picWrap { position: relative; display: block; }
.picWrap img {
position: absolute; top: 50%; left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%); /* IE 9 */
-webkit-transform: translate(-50%, -50%); /* Chrome, Safari, Opera */
}
Web Notes Reshipment
SEARCH !!
2015/01/16
2014/08/04
CSS SHAPE
- cross -
<div id="cross"></div>
#cross { width: 100px; height: 100px; position: relative; }
#cross:before,
#cross:after { content: ""; position: absolute; /*z-index: -1;*/ background: #d00; }
#cross:before { left: 50%; width: 30%; margin-left: -15%; height: 100%; }
#cross:after { top: 50%; height: 30%; margin-top: -15%; width: 100%;}
*****************************************************************************************
<div id="cross"></div>
#cross { width: 100px; height: 100px; position: relative; }
#cross:before,
#cross:after { content: ""; position: absolute; /*z-index: -1;*/ background: #d00; }
#cross:before { left: 50%; width: 30%; margin-left: -15%; height: 100%; }
#cross:after { top: 50%; height: 30%; margin-top: -15%; width: 100%;}
*****************************************************************************************
2014/03/28
何謂CPC、CPM、CTR、CPS、CPA
from: http://kbmarc.pixnet.net/blog/post/10986014-%5B%E7%B6%B2%E8%B7%AF%E4%BC%81%E5%8A%83%5D-%E4%BD%95%E8%AC%82cpc%E3%80%81cpm%E3%80%81ctr%E3%80%81cps%E3%80%81cpa
CPC:「每次點擊成本 」(Cost Per Click),每次點擊的費用,廣告成本依點擊次數來計算奇摩3元起跳,GOOGLE$0.01 - $100 美元之間CPM:「每千次展示成本廣告」(Cost Per 1000 impressions),是指廣告每千次曝光(impressions)所需的成本。
台灣一般多在300到450元台幣間
CTR:「點閱率」(Click Though Rate),簡稱CTR,CTR的字義是:在廣告曝光的期間內有多少人次點閱這個廣告圖檔,進而收看預先準備好的廣告內容。
CPS :用戶產生消費行為次數收費,例如各種商城廣告。
CPA (Cost-per-Action) :每次行動的費用,即根據每個訪問者對網路廣告所採取的行動收費的定價模式。例如:成功註冊一個用戶成功返回短信驗證等,對於用戶行動有特別的定義,包括形成一次交易、獲得一個註冊用戶、或者對網路廣告的一次點擊等。
計算方式如下:
CPC = 廣告成本 / 點擊次數
CPM = 廣告成本 / 展示次數 * 1,000
CPC/CPM 的值, 須看那個廣告商所定的價格與網站流量而定.
以及你所刊登的廣告種類、期間。
而所謂的流量, 僅是過去流量統計,
不保證你廣告刊登期間一定會有這麼多人來看.
另一個是, 這些數字是各廣告商 (Yahoo/Google .. etc)
他們內部才有辦法算出, 整體各分類廣告的 CPC/CPM.
而各廣告商本身有提供一些機制, 來防止灌水的瀏覽數、點閱數
但是到最後, CPC/CPM 都只能算是參考數據,
提供想刊登廣告的人做為參考
看大家願不願意花錢在上面刊登囉!!
維克多摘自
http://blog.yam.com/il_forum/article/12067608
PS:
CPS...Cost per Sale
CPR...Cost per Register
這兩個原本都屬於CPA, 但因為Final Action的定義很廣
後來又會把CPA拆成很多動作, 來區別
CPP(page), CPD(download)...喜歡的話就可以隨意亂掰一堆, 用專有名詞假裝高級.
CTR...若不是買過雅虎(MSN)廣告的人, 會很難懂...
因為這是從Impressions(banner 播放次數) 和 Clicks 去算出來的,
CTR的基本數字大概是0.1%-0.2%起跳, 很難有超過1%的廣告版位.
2014/03/18
youtube 影片 responsive
<div class="video-container">
<iframe src="http://www.youtube.com/embed/dFVxGRekRSg" frameborder="0" width="560" height="315"></iframe>
</div>
==========================================================
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
- See more at: http://avexdesigns.com/responsive-youtube-embed/#sthash.JbxIKmLI.dpuf
- See more at: http://avexdesigns.com/responsive-youtube-embed/#sthash.JbxIKmLI.dpuf
- See more at: http://avexdesigns.com/responsive-youtube-embed/#sthash.JbxIKmLI.dpuf
- See more at: http://avexdesigns.com/responsive-youtube-embed/#sthash.JbxIKmLI.dpuf
- See more at: http://avexdesigns.com/responsive-youtube-embed/#sthash.JbxIKmLI.dpuf
- See more at: http://avexdesigns.com/responsive-youtube-embed/#sthash.JbxIKmLI.dpuf
- See more at: http://avexdesigns.com/responsive-youtube-embed/#sthash.JbxIKmLI.dpuf
<iframe src="http://www.youtube.com/embed/dFVxGRekRSg" frameborder="0" width="560" height="315"></iframe>
</div>
==========================================================
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.video-container {
position
:
relative
;
padding-bottom
:
56.25%
;
padding-top
:
30px
;
height
:
0
;
overflow
:
hidden
;
}
.video-container iframe,
.video-container object,
.video-container
embed
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
.video-container {
position
:
relative
;
padding-bottom
:
56.25%
;
padding-top
:
30px
;
height
:
0
;
overflow
:
hidden
;
}
.video-container iframe,
.video-container object,
.video-container
embed
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
.video-container {
position
:
relative
;
padding-bottom
:
56.25%
;
padding-top
:
30px
;
height
:
0
;
overflow
:
hidden
;
}
.video-container iframe,
.video-container object,
.video-container
embed
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
.video-container {
position
:
relative
;
padding-bottom
:
56.25%
;
padding-top
:
30px
;
height
:
0
;
overflow
:
hidden
;
}
.video-container iframe,
.video-container object,
.video-container
embed
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
.video-container {
position
:
relative
;
padding-bottom
:
56.25%
;
padding-top
:
30px
;
height
:
0
;
overflow
:
hidden
;
}
.video-container iframe,
.video-container object,
.video-container
embed
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
.video-container {
position
:
relative
;
padding-bottom
:
56.25%
;
padding-top
:
30px
;
height
:
0
;
overflow
:
hidden
;
}
.video-container iframe,
.video-container object,
.video-container
embed
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
.video-container {
position
:
relative
;
padding-bottom
:
56.25%
;
padding-top
:
30px
;
height
:
0
;
overflow
:
hidden
;
}
.video-container iframe,
.video-container object,
.video-container
embed
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
}
2014/01/27
關於文字爆出去
-- text-overflow --
文字超出邊界時的處理方法,須配合 overflow: hidden; 和 white-space: nowrap; 使用。可設為:
--> overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
clip:切去超出的部分不顯示,此為預設值。
ellipsis:用 "..." 表示後面還有文字未顯示出來。
ellipsis-word:使用 "a€|" 表示後面還有文字未顯示出來。主要瀏覽器都沒支援此項。
inherit:繼承父元素的特徵值。
***************************************************************************************************
-- white-space --
文字中的空白的處理方法。空白字包括:空白,TAB,跳行字(line feed, carriage return, form feed)。可設為:
normal:連續的空白字都縮減為一個空白,長行遇到右邊界會跳行分為兩行,此為預設值。
pre:不縮減空白字,維持原狀。
pre-line:Firefox, Safari, Chrome 的定義是,連續的空白字會縮減為一個空白;跳行字(newline)保留,會跳行;長行也會跳行。IE 的定義是,連續的跳行會保留。
pre-wrap:Firefox, Safari, Chrome 的定義是,不縮減空白字;跳行字會跳行;長行也會跳行。IE 的定義是,連續的跳行字會縮減為一個跳行。
nowrap:連續的空白字會縮減為一個空白,不跳行。
inherit:繼承父元素的特徵值。
***************************************************************************************************
-- word-wrap --
指定是否可以將完整的長字分為二,以免長字超出邊界。適用於英文,通常英文用音節規則來斷字。可設為:
break-word:可以任意斷字,不依循音節規則。
normal:長字會維持原狀,超出邊界,此為預設值。
inherit:繼承父元素特徵。
使用此項,必須先將 text-wrap 特徵設為 normal 或 suppress。例外的是 IE 沒有 text-wrap,一律可以用此項。
***************************************************************************************************
-- word-break --
word-break 屬性主要是用來設定亞洲語言(Chinese, Japan, Korea)及非亞洲語言文字的斷行規則。
normal Break words according to their usual rules
break-all Lines may break between any two letters
keep-all Breaks are prohibited between pairs of letters
2014/01/21
How To Take Care of Your Smartphone Battery the Right Way
Your smartphone is a minor miracle, a pocket-sized computer that can fulfill almost every whim. But none of its superpowers matter a bit if it runs out of juice. With removable batteries becoming more and more rare, you've got to take good care of the one you got. Fortunately, it's not to hard keep the lithium-ion powering your everything machine happy if you follow a few simple rules.
Obviously, the first rule for extending your battery life is not using up all your battery life playing candy crush and walking around with Wi-Fi and GPS enabled when you're not using either and really, really need your phone to last that extra hour. But aside from that, there are some basic rules for care and charging, and they're the simplest baseline for a healthy battery.
Top it off
You may vaguely recall hearing something about rechargeable batteries and the "memory effect." You know, that if you don't "teach" your rechargeable batteries their full potential by taking them from totally full to totally empty, they'll "forget" part of their capacity. Well forget all that. Right now. It's wrong.
Battery memory is a real thing, but it applies to nickel-based batteries; your trusty sidekick (literal Sidekick or otherwise) doubtlessly has a lithium-ion battery, and it needs to be treated a little differently. Specifically, it should be topped off whenever you get the chance.
To get the most out of a lithium-ion battery, you should try to keep it north of 50 percent as much as possible. For the most part going from all the way full to all the way empty won't help; in fact, it'll do a little damage if you do it too often. That said, it's smart to do one full discharge about once a month for "calibration," but don't do it all the time. Running the whole gamut on a regular basis won't make your battery explode or anything, but it will shorten its lifespan.
But! You don't want to have it charging all the time either; lithium-ion batteries can get overheated. Luckily for you, your charger is smart enough to help with this, and will cut your phone off for a spell once it's full. And to complicate matters a little further your battery doesn't particularly like being all the way full either. In fact, your battery will behave the best if you take it off the charge before it hits 100 percent, and leaving it plugged when it's already full is going to cause a little degradation.
So if you're really particular about optimizing your battery's life, you should try to go from around 40 percent to around 80 percent in one go, and then back down whenever possible. A bunch of tiny charges isn't as bad as going from 100 down to zero all the time, but it's not optimal either.
Keep it cool
It's easy to worry about bad charging habits thanks to the training we've had from old rechargeable batteries, but lithium-ion batteries have a worse enemy: heat. Your smartphone's battery will degrade much much faster when it's hot, regardless of whether it's being used or just sitting around doing nothing.
At an average temperature of 32 degrees fahrenheit, a lithium-ion battery will lose six percent of its maximum capacity per year. At 77 degrees, that number jumps to 20 percent, and at 104 degrees it's a whopping 35. Sure, it's not exactly practical (or sane) to keep your phone in the fridge, but it's worth going out of your way to prevent long stays in hot cars and the like.
Avoid wireless charging
Wireless charging is can be incredibly convenient if your phone can do it, but it's not without its disadvantages. The inductive, wireless chargers out there today have this nasty habit of generating a fair bit of waste heat. And while wasted energy is just a bummer in general, that heat will also toast your battery in the process. That's no bueno. It's a little less convenient, but standard plug-in charging is going to keep your battery in better shape, especially if you're some place warm to begin with.
Never go to zero
Obviously, using your battery is going to make it degrade. But it's going to slowly die even if you just leave that iPad in the closet for a bit. There's a trick to minimizing that inevitable aging though: leave it a little bit of juice.
If you're going to be shelving any lithium-ion battery for a long time, try to leave it with at least 40 percent battery power to tide it over. Lithium-ion batteries don't hemmorage power at 30 percent a month like nickel-metal-hydride batteries do; they'll lose maybe five to ten percent of their charge each month.
And when lithium-ion batteries get too low—like, literally zero percent—they get seriously unstable, and dangerous to charge. To prevent explosion-type disasters if you do try to charge one, lithium-ion batteries have built-in self-destruct circuits that will disable (read: destroy) the battery for good, if it reaches rock bottom. And sure, that'll save you from a face full of battery-acid, but it'll also leave you short one battery.
Don't sweat it too much
It's easy to get protective of your battery, but it's also easy to get lazy. And that's fine, because as long as you're not a complete idiot, you'll be OK. Typically, a lithium-ion battery lasts for three to five years, and chances are you're going to want to swap out your gadgets sometime in that window anyway. The slight damage of a technically bad idea like leaving your phone plugged in all night every night, or using wireless charging, might be worth the convenience.
Still, it's pretty easy to keep your battery reasonably healthy just by avoiding particularly egregious torture like letting your phone discharge from full to zero every single day, or leaving it in a hot car all the time. And the next time you make it back home with power to spare, you'll thank yourself for it.
originally from: http://gizmodo.com/how-to-take-care-of-your-smartphone-battery-the-right-w-513217256
2014/01/02
如何讓 div 維持正方形
如何讓 div維持正方形
利用padding可以吃 width % 的值去推開
這樣寬高就會有相同的依據
EX:
width: 50%;
height: 0;
padding-bottom: 50%; <-- 會以width為基準的20%延伸:
padding-bottom: 75%; /* 4:3 aspect ratio */
也可用 :before 或 :after 去塞一個 padding-bottom: 50%; 的東西
利用padding可以吃 width % 的值去推開
這樣寬高就會有相同的依據
EX:
width: 50%;
height: 0;
padding-bottom: 50%; <-- 會以width為基準的20%延伸:
padding-bottom: 75%; /* 4:3 aspect ratio */
也可用 :before 或 :after 去塞一個 padding-bottom: 50%; 的東西
2013/08/06
訂閱:
文章 (Atom)