css3高級和低級樣式屬性先后順序

寫css hack 時,由于hack主要針對的是個別瀏覽器,hack的書寫順序應當是從一般到特殊的寫法。

如:

.box { width:200px; height:200px; position:fixed; left:0; top:0; _position:absolute; }

如果顛倒順序,從特殊到一般,就失效了。

但是,對于高級瀏覽器支持的一些屬性,低級版本和升級版本支持的可能不一樣,為了都支持,該怎么寫?

看如下代碼:

div { height:30px; width:60px; border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px; border:2px solid orange; margin-bottom:20px; }
p { height:30px; width:60px; -webkit-border-radius:3px; -moz-border-radius:3px; border-radius:3px; border:2px solid orange; }

運行結果則是一致的。demo:http://jsfiddle.net/xmlovecss/XRrcK/

再對比ff和chrome的樣式截圖:

從瀏覽器渲染出的結果可以看出,火狐無所謂,chrome瀏覽器則分出了先后次序。

考慮到大多數人有升級高級瀏覽器的需要,所以建議寫法是,從高級到低級

?

轉載于:https://www.cnblogs.com/my_front_research/archive/2013/01/18/2866361.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/274383.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/274383.shtml
英文地址,請注明出處:http://en.pswp.cn/news/274383.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

sans serif_Sans和Serif相遇可愛

sans serifI first noticed it in this tweet. Exciting upcoming product and snazzy motion work aside, “What a fascinating logotype!”, I exclaimed!我在此推文中首先注意到了它。 我驚呼即將推出的激動人心的產品和令人眼花,亂的動作,“多么迷人…

[ckeditor系列]ckeditor 自己寫的一個簡單的image上傳js 運用iframe的ajax上傳

ckeditor最近修改一個上傳的,原來的Image的上傳插件功能很多,但是自己用,沒有必要,就進行了修改,后來就改成了目前的樣子,根據_samples/api_dialog.html 進行了修改,把頁面里面的調用都進行了修…

sql 避免除0錯誤_設計簡歷時避免這3個常見的UX錯誤

sql 避免除0錯誤重點 (Top highlight)Having a great looking resume on hand is very important when you’re looking for a job. It is your ticket to land the interview that will get you one step closer to that one job you’ve been dreaming of.在找工作時&#xf…

一個網站自動化測試程序的設計與實現

CSDN博客不再經常更新,更多優質文章請來 粉絲聯盟網 FansUnion.cn! (FansUnion) 代碼 下載地址:http://download.csdn.net/detail/fansunion/5018357(免積分) 代碼亮點:可讀性很好,注釋詳盡 背景 工作中,在維護一…

如何編寫數據庫可視化界面_編寫用于數據可視化的替代文本

如何編寫數據庫可視化界面什么是替代文字 (What is Alt Text) Alt text (sometimes called Alt tags or alternative text) are written descriptions added to images that convey the meaning of the visual. Good alt text helps more people understand the content. Assis…

(轉)swc與swf的區別

在Flash Builder中用Actionscript寫的類可以打包成swc或swf, 在Flash CS中制作的元件也可以打包成swc或swf文件, 一個swc或swf文件中可以包含多個類或元件, 每個元件會映射成一個類, 因此,在Flash Builder中的類和在Fl…

js 驗證各種格式類型的正則表達式

<script src"scripts/jquery-1.4.1.js" type"text/javascript"></script> <script language"javascript" type"text/javascript"> /** * 定義驗證各種格式類型的正則表達式對象 */ var Regexs { email: …

reloaddata 跳動_紙跳動像素

reloaddata 跳動I would like to open with a problem.我想開一個問題。 Why are so many designer going straight to pixels?為什么這么多設計師直接使用像素&#xff1f; Over the past few years i’ve witnessed this in my team, my clients and others throughout th…

使用自定義RadioButton和ViewPager實現TabHost效果和帶滑動的頁卡效果。

參考自http://www.apkbus.com/android-86125-1-1.html 這篇文章技術含量一般&#xff0c;大家別見笑。源碼我以測試&#xff0c;在底部可下載。 好了先上效果圖&#xff1a; 以下是實現步驟&#xff1a; 1、準備自定義RadioButton控件的樣式圖片等&#xff0c;就是準…

利益相關者軟件工程_改善開發人員團隊與非技術利益相關者之間交流的方法

利益相關者軟件工程Whether you’re working on a startup or a big company, keeping your stakeholders and non-technical partners engaged and up to date on what the tech team has been building can be hard.無論您是在初創公司還是大公司中工作&#xff0c;都要讓您的…

Hibernate的檢索策略

Hibernate的Session在加載一個Java對象時&#xff0c;可以將與這個對象相關聯的其他Java對象都加載到緩存中&#xff0c;以便程序及時調用。但有些情況下&#xff0c;我們不需要加載太多無用的對象到緩存中&#xff0c;一來這樣會撐爆內存&#xff0c;二來增加了訪問數據庫的次…

響應式網格項目動畫布局_響應式網格及其實際使用方式:常見的UI布局

響應式網格項目動畫布局重點 (Top highlight)第二部分 (Part II) Now that you have a basic understanding of how to use grids, you might be wondering how to apply them to layouts you see on the web. Responsive grids are a method to systematically align your des…

SQL函數大全

SQL函數大全 --聚合函數use pubsgoselect avg(distinct price) --算平均數from titleswhere typebusinessgo use pubsgoselect max(ytd_sales) --最大數from titlesgo use pubsgoselect min(ytd_sales) --最小數from titlesgo use pubsgoselect type,sum(price),sum(advanc…

時間軸ui設計_我應該在UI設計上花更多時間嗎?

時間軸ui設計Let’s start with an example of communication skills: they are important for any profession, and you expect any professional to have a decent level. However, excellent communication skills won’t make up for the lack of core expertise. Imagine …

一、Oracle介紹

Oracle學習筆記 一、 Oracle介紹 選擇數據庫的標準 項目的規模 負載量多大&#xff0c;用戶量多少 成本 安全性 Oracle 認證 初級&#xff1a;OCA&#xff1a;Oracle Certificated Associate 中級&#xff1a;OCP&#xff1a;Oracle Certificated Professional 高級&#xff…

移動端分步注冊_移動應用程序的可用性測試:分步指南

移動端分步注冊Written by Justin Mifsud由賈斯汀米夫蘇德 ( Justin Mifsud)撰寫 The mobile market is huge and growing at a very fast rate. With an estimated 4.5 billion subscribers worldwide, it is forecasted that the number of mobile phones will surpass the …

ldd隨筆(1)-linux設備模型

一下只是個人學習后的理解&#xff0c;可能有很多不對的地方。 要學習linux的設備驅動模型&#xff0c;首先必須要知道kobject和kset的概念&#xff0c;下面是kobject在2.6.38的源碼中的實現。 struct kobject {const char *name; //名稱&#xff0c;可能在sysfs中創…

插圖 引用 同一行兩個插圖_提出食物主題中的插圖

插圖 引用 同一行兩個插圖I have a page in my portfolio, which is about search functionality. I wanted that page to feel fun and engaging, to convey a positive vibe, so I decided to add illustrations to it.我的投資組合中有一個頁面與搜索功能有關。 我希望該頁面…

Hadoop的SequenceFile讀寫實例

1 SequenceFile可以處理hdfs上大量小文件&#xff0c;它可以作為大量小文件的容器。HDFS和MapReduce是針對大文件優化的&#xff0c;所以通過SequenceFile類型將小文件包裝起來可以獲得更高效的存儲和處理。存儲2 在SequenceFile中的鍵和值并不一定是Writable類型&#xff…

臉部細微表情識別_您可以僅使用面部表情來控制字體嗎?

臉部細微表情識別原型 (The prototype) Facetype is the name of Adam’s interactive project, in which the emotions detected from a person’s facial gestures control a variable font. To each detected emotion corresponds a specific typeface, which keeps transfo…