". The hidden attribute is used to specify that the element is hidden and made invisible."/> ". The hidden attribute is used to specify that the element is hidden and made invisible.">

Home  >  Article  >  Web Front-end  >  How to hide the player in html

How to hide the player in html

青灯夜游
青灯夜游Original
2021-06-03 17:13:038875browse

In HTML, you can hide the video or music player by setting the hidden attribute to the video or audio tag, the syntax is "". The hidden attribute is used to specify that the element is hidden and made invisible.

How to hide the player in html

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

In HTML, you can hide the video or music player by setting the hidden attribute to the video or audio tag.

The hidden attribute specifies that the element is hidden. Hidden elements will not be displayed. If this attribute is used, the element will be hidden.

The hidden attribute can be set so that users can only see an element when certain conditions are met (such as checking a check box, etc.). You can then use JavaScript to remove the hidden attribute, making the element visible.

hidden video player

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
</head>
<body>

<video width="320" height="240" controls autoplay hidden="true">
  <source src="movie.ogg" type="video/ogg">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.webm" type="video/webm">
  <object data="movie.mp4" width="320" height="240">
    <embed width="320" height="240" src="movie.swf">
  </object>
</video>

</body>
</html>

hidden audio player

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
</head>
<body>

<audio controls hidden="true">
  <source src="horse.mp3" type="audio/mpeg">
  <source src="horse.ogg" type="audio/ogg">
  您的浏览器不支持该音频格式。
</audio>

</body>
</html>

Recommended tutorial: "html video tutorial

The above is the detailed content of How to hide the player in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn