當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


CSS cue-before屬性用法及代碼示例

CSS cue-before屬性用於定義在元素之前播放的聽覺圖標,以區分和設置元素。

用法:

cue-before:url|none;

參數:該屬性接受上述和以下所述的兩個值:

  • url:此參數保存聽覺圖標資源。如果用戶無法渲染提到的聽覺圖標,則它將產生其他提示,例如鈴聲。
  • none:此參數定義不使用聽覺圖標。

範例1:

HTML

<!DOCTYPE html>  
<html>  
  
<head>  
    <style>  
        .gfg {  
            cue-before:none;  
        }  
    </style>  
</head>  
  
<body style="text-align:center;">  
    <h1 style="color:green;">GeeksforGeeks</h1>  
    <p class="gfg">CSS cue-before Property</p> 
   
  
    <audio controls>  
        <source src=  
"https://media.geeksforgeeks.org/wp-content/uploads/20190625153922/frog.mp3"
        type="audio/mp3">  
    </audio>  
</body>  
  
</html> 

輸出:



範例2:

HTML

<!DOCTYPE html>  
<html>  
  
<head>  
    <style>  
        .gfg {  
            cue-before:url("bell.wav");   
        }  
    </style>  
</head>  
  
<body style="text-align:center;">  
    <h1 style="color:green;">GeeksforGeeks</h1>  
    <p class="gfg">CSS cue-before Property</p> 
   
  
    <audio controls>  
        <source src=  
"https://media.geeksforgeeks.org/wp-content/uploads/20190625153922/frog.mp3"
        type="audio/mp3">  
    </audio>  
</body>  
  
</html> 

輸出

支持的瀏覽器:CSS3中不推薦使用此屬性,因此該屬性不支持主要的瀏覽器。




相關用法


注:本文由純淨天空篩選整理自ManasChhabra2大神的英文原創作品 CSS cue-before Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。