Materialize Media


Materialize Media Materialize provides classes for media content. Here in this tutorial we are going to explain how you can use media classes in Materialize. You can also use our online editor to edit and run the code online.


Materialize Media Example

Images

Images can be styled in following ways-

Responsive Images

To create responsive images you need to add the class responsive-img to the image tag which will make image responsive-

Materialize Media | Responsive Images Example:

<img class="responsive-img" src="myimage.jpg">

Try it »

Circular Images

To make image circular just add circle class to the image tag.

Materialize Media | Image Circle Example:

<img class="circle responsive-img" src="myimage.jpg">                                                                                                                                                                                                                                                                                                         

Try it »

If you run the above example it will produce output something like this –

Materialize Media | Image Circle Example:

Videos

You can embed the videos in page using responsive-video and video-container class.

Responsive Embed

If you want to embed videos such as youtube videos you can embed videos simply as below which will be responsive on all devices.

Materialize Media | Embed Youtube Video Example:

<div class="video-container">
        <iframe width="853" height="480" src="https://www.youtube.com/embed/0Pgup2hOpXQ" frameborder="0" allowfullscreen></iframe>
      </div>                                                                                                                                                                                                                                                                                                         

Try it »

Responsive Videos

You can make html videos responsive by simply adding the class responsive-video

Materialize Media | Responsive Video Html 5 Example:

 <video class="responsive-video" controls>
    <source src="my_movie.mp4" type="video/mp4">
  </video>                                                                                                                                                                                                                                                                                                    

User Ans/Comments

📖 Read More


Advertisements