Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would greatly recommend against this. </p> <p>This limits you, and doesn't protect your images. I can inspect your css, copy the path on your site, and still access the image anyways. If you did this with IMG tags (my recommended way), you can turn off right-click on your website with javascript and that would help protect your images. You can do that like this:</p> <p><a href="https://stackoverflow.com/questions/737022/how-do-i-disable-right-click-on-my-web-page">How do I disable right click on my web page?</a></p> <p>If you insist doing it this way (the wrong way), here it goes.</p> <p>With a gallery, you don't want cover. At a screen size like on iPhone, half the image will be getting cut off because, by default, cover makes sure the image is covering the ENTIRE viewport, and it keeps the image proportions.</p> <p>I would think what you want is this: </p> <pre><code>.red { background: red url(images/background.png) no-repeat; background-size: 100% center; } </code></pre> <p>This is still going to cut off some of the image if the image is too tall and will leave the background color (red) showing through is the image is not tall enough to fill the screen at whatever width your browser is. </p> <p>The only way to fully ensure your image will never expand past the height or width of the browser viewport is to do it like this: </p> <pre><code>&lt;ul class="bxslider"&gt; &lt;li class="photo"&gt;&lt;img src="image1.png"/&gt;&lt;/li&gt; &lt;li class="photo"&gt;&lt;img src="image2.png"/&gt;&lt;/li&gt; &lt;li class="photo"&gt;&lt;img src="image3.png"/&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>And the css would be: </p> <pre><code>.photo { height: 100%; width: 100%; max-height: 100%; max-width: 100%; } .photo img { width: 100%; } </code></pre> <p>Do whatever you want, but you can't have a max-width or a max-height on a background image so the only way to ensure you dont cut off your image, is to do it the second way I recommended, and then just disable right click or protect your images in some other way. </p> <p><strong>DISCLAIMER: NEITHER WAY WILL PROTECT YOUR IMAGE</strong> - Throw a watermark on them if you want them protected that bad. </p> <p>Just placing the images there as background images is TERRIBLE semantics.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload