Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to style images in reveal.js?

Tags:

reveal.js

I am now trying to put transparent png image in reveal.js as:

<div class="slides">     <section>         <img src="sample.png">         <p>sample image</p>     </section> </div> 

where figure "sample.png" is follows.

enter image description here

However, there are:

  • white lines appear at the boundary of the figure
  • and the figure is not prefect transparent. (contains some white color?)

How can we remove it?

enter image description here

like image 324
eng27 Avatar asked Apr 15 '14 11:04

eng27


2 Answers

The actual problem is that reveal.js has a style which adds a white background at low opacity, a box-shadow, and a border to images as seen below:

.reveal section img {      background: rgba(255, 255, 255, 0.12);      border: 4px solid #eeeeee;     box-shadow: 0 0 10px rgba(0, 0, 0, 0.15)  } 

So the fix is to override that style with:

.reveal section img { background:none; border:none; box-shadow:none; } 
like image 163
cmorrow Avatar answered Sep 22 '22 13:09

cmorrow


In version 3.3.0 there is a class Plain which removes border, shadow and background

<img class="plain"  src="myimages.png"/> 
like image 39
ulrich Avatar answered Sep 24 '22 13:09

ulrich