由於Materialize內建的響應式設計,使用它製作的網站可以自動調整大小以適應不同的裝置類型。 Materialize類別是為了使網站適應任何螢幕尺寸而開發的。所有的個人電腦、平板電腦和行動裝置都可以存取使用Materialize建立的網站。
Materialize的設計是扁平且極為簡單的。它是根據這樣的理解而製作的:新增新的CSS規則比更改已經存在的規則簡單得多。它支援陰影和鮮豔的色調。在所有平台和設備上,色調和色調都是一致的。可能最重要的是,使用它完全免費。
在本文中,我們將討論Materialize CSS中的對話方塊。
什麼是Materialize CSS?
Materialize CSS是一個使用CSS、JavaScript和HTML開發的使用者介面元件庫。谷歌是設計它的公司。 Material Design是CSS的另一個名稱。它是一種將創新和技術與良好設計的經典原則融合在一起的設計語言。谷歌希望創建一個設計框架,以實現在任何平台上所有產品上的一致用戶體驗。
It is a set of UI components created by Google. It is used to build online pages and web apps that are aesthetically pleasing, consistent, and useful while adhering to contemporary websign congraence webssign congraence, lethhering to contemporary websign congraation demol 完成, letheld, lesignal websm. . It is a conventional CSS with a small footprint.
It is open source and needs the jQuery JavaScript library to work correctly. It may be used to build reusable web components and is cross-browser comcrossible. Cards, tabs, navigation bars, to navigation and patible. Cards, upgraded and customized features are included. It offers updated variations of typical user interface elements like buttons, checkboxes, and text fields that have been modified to adhere to Material Design priprincles.
##什麼是對話框?對話方塊是一種圖形控制元素,以小視窗的形式出現,並向使用者傳達訊息,同時要求使用者做出反應。
Depending on whether they prevent communication with the software that opened the dialog, dialog boxes are categorized as "
modal" or "modeless." The desired user interaction determines the type of dialogue box that will be displayed.
HTML元素"dialog"表示對話方塊或其他互動元素,如子視窗、檢查器或可關閉的警告。
Dialogs in Materialize CSSDialogs in
Materialize CSS give users access to more information as needed. These are not immediately displayed on the website. The information needed at that particular time is related to the log trans partic , Materialize offers several options. Dialogs are pieces of material that are normally hidden on a page but pop up with more information when required. The user shouldn't feel startled by the erials, Matichcan user shouldn the mdia feel startled by erials, Matichccys, Matlogs syetchanges wherappy's, Matsretics erials, Matlog; give you a simple way to give your users discreet alerts. You may test out how responsively these toasts are put and sized by clicking the button below on various device sizes.
Use JavaScript code to programmatically invoke theMaterialize.toast() function to accomplish this. An HTML String may also be supplied as the first argument. Once the toast has been dismissed, you can it back a certain function. You can easily customize the CSS style classes and add it to the toasts as as optional parameter.
文法
Materialize.toast(content, timeDuration, class, callback);
ParameterContent- It is used to specify the content to be displayed on the user’s screen.
-
#timeDuration- 用於指定螢幕上顯示訊息的時間持續時間。
-
Class- 用於指定要套用於提示框的樣式類別的類型。
Callback- It is used to specify the callback method which is to be called after the toast is dismissed.
<link rel = “stylesheet” href = “https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css”> <script type = “text/javascript” src = “https://code.jquery.com/jquery2.1.1.min.js”> </script> <script src = “https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js”> </script>Example
的中文翻譯為:
範例The given below example exemplifies how to add different types of dialog boxes in a web page using Materialize CSS.
<!DOCTYPE html> <html> <head> <title> Dialogs in Materialize CSS </title> <meta name= "viewport" content= "width = device-width, initial-scale = 1"> <link rel= "stylesheet" href= "https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel= "stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <script type= "text/javascript" src= "https://code.jquery.com/jquery-2.1.1.min.js"> </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script> function Box1(content, timeDuration) { Materialize.toast( '<b>' + content + '</b>', timeDuration, 'rounded' ); } function Box2(content, timeDuration) { Materialize.toast('<em>' + content + '</em>', timeDuration ); } function Box3(content, timeDuration) { Materialize.toast( '<u>' + content + '<u>', timeDuration ); } </script> </head> <body class= "container"> <h2 id="Materialize-CSS"> Materialize CSS </h2> <h4 id="Different-Dialog-boxes"> Different Dialog boxes </h4> <a class= "btn" onclick= "Box1('Bold N rounded Alert!', 2000)"> Bold And rounded Alert box!! </a> <br> <br> <a class= "btn" onclick= "Box2('Emphasized Alert!', 2000)"> Emphasized Alert box!! </a> <br> <br> <a class= "btn" onclick= "Box3('Underlined Alert!', 2000)"> Underlined Alert box!! </a> <br> <br> </body> </html>On clicking bold and rounded alert box button, a rounded shaped alert box with bold text will be displayed on the screen. On clicking the emphasized alert box button, a rectangular alert combox with hasized 反對 3bed alert box, rectangular alert box with underlined text will be displayed.
Conclusion
在本文中,我們使用Materialize CSS來建立對話方塊。我們學習了Materialize toast()函數,它使我們能夠建立自訂的提示框。我們也學習了一些JavaScript概念,像是onclick()函數。
以上是解釋 Materialise CSS 中的對話框的詳細內容。更多資訊請關注PHP中文網其他相關文章!

在這篇文章中,布萊克·莫里(Blackle Mori)向您展示了一些駭客,同時試圖推動同位HTML支持的極限。如果您敢於使用這些,以免您也被標記為CSS罪犯。

具有CSS的自定義光標很棒,但是我們可以將JavaScript提升到一個新的水平。使用JavaScript,我們可以在光標狀態之間過渡,將動態文本放置在光標中,應用複雜的動畫並應用過濾器。

互動CSS動畫和元素相互啟動的元素在2025年似乎更合理。雖然不需要在CSS中實施乒乓球,但CSS的靈活性和力量的增加,可以懷疑Lee&Aver Lee有一天會成為一種

有關利用CSS背景濾波器屬性來樣式用戶界面的提示和技巧。您將學習如何在多個元素之間進行背景過濾器,並將它們與其他CSS圖形效果集成在一起以創建精心設計的設計。

好吧,事實證明,SVG的內置動畫功能從未按計劃進行棄用。當然,CSS和JavaScript具有承載負載的能力,但是很高興知道Smil並沒有像以前那樣死在水中

是的,讓#039;跳上文字包裝:Safari Technology Preview In Pretty Landing!但是請注意,它與在鉻瀏覽器中的工作方式不同。

此CSS-tricks更新了,重點介紹了年鑑,最近的播客出現,新的CSS計數器指南以及增加了幾位新作者,這些新作者貢獻了有價值的內容。

在大多數情況下,人們展示了@Apply的@Apply功能,其中包括Tailwind的單個property實用程序之一(會改變單個CSS聲明)。當以這種方式展示時,@Apply聽起來似乎很有希望。如此明顯


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

WebStorm Mac版
好用的JavaScript開發工具

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

DVWA
Damn Vulnerable Web App (DVWA) 是一個PHP/MySQL的Web應用程序,非常容易受到攻擊。它的主要目標是成為安全專業人員在合法環境中測試自己的技能和工具的輔助工具,幫助Web開發人員更好地理解保護網路應用程式的過程,並幫助教師/學生在課堂環境中教授/學習Web應用程式安全性。 DVWA的目標是透過簡單直接的介面練習一些最常見的Web漏洞,難度各不相同。請注意,該軟體中

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!