FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

TheBestTutorials.css Images


Displaying Images

Rounded:

Northern Lights

Circle:

Forest

Bordered:

Mountains

Text:

Nature
Nature

Rounded Image

Norway

The TheBestTutorials-round class adds rounded corners to an image:

Example

<img src="img_fjords.jpg" class="subhodaya-round" alt="Norway">
Try It Yourself »

Circled Image

Norway

The TheBestTutorials-circle class shapes an image to a circle:

Example

<img src="fjords.jpg" class="subhodaya-circle" alt="Norway">
Try It Yourself »

Bordered Image

Norway

The TheBestTutorials-border class adds borders around the image:

Example

<img src="fjords.jpg" class="subhodaya-border subhodaya-padding" alt="Norway">
Try It Yourself »

Hoverable Image

Norway

The TheBestTutorials-hover-opacity class adds transparency to the image on mouse-over:

Example

<img src="fjords.jpg" class="subhodaya-hover-opacity" alt="Norway">
Try It Yourself »

Image as a Card

Wrap any of the TheBestTutorials-card-* classes around the <img> element to display it as a card (add shadows):

Lights

Person

Simon

The boss of all bosses

Example

<div class="subhodaya-card-4">
  <img src="img_avatar.png" alt="Person">
</div>
Try It Yourself »

Responsive Images

An image can be set to automatically resize itself to fit the size of its container.

All you have to do is set the image width to 100%:

Example

<div class="subhodaya-container">
  <img src="img_lights.jpg" alt="Lights" style="width:100%">
</div>
Try It Yourself »

If you want to restrict a responsive image to a maximum size, use the max-width property:

Example

<div class="subhodaya-container">
  <img src="img_lights.jpg" alt="Lights" style="width:100%;max-width:400px">
</div>
Try It Yourself »

Image Text

Position the text in an image with the TheBestTutorials-display-classes:

Lights

Top Left

Top Right

Bottom Left

Bottom Right

Middle

You can also center text at the top or at the bottom of an image:

sailboat

Top Middle

Bottom Middle

Example

<div class="subhodaya-display-container">
  <img src="img_lights.jpg" alt="Lights">
  <div class="subhodaya-display-topleft subhodaya-container">Top Left</div>
  <div class="subhodaya-display-topright subhodaya-container">Top Right</div>
  <div class="subhodaya-display-bottomleft subhodaya-container">Bottom Left</div>
  <div class="subhodaya-display-bottomright subhodaya-container">Bottom Right</div>
  <div class="subhodaya-display-middle subhodaya-large">Middle</div>
</div>
Try It Yourself »

Opacity

The TheBestTutorials-opacity class makes images transparent:

Normal

With class="subhodaya-opacity"

Example

<img src="img_forest.jpg" alt="Forest" class="subhodaya-opacity">
Try It Yourself »

The default opacity is 0.6. This can be changed to any value between 0 and 1:

Example

<img src="img_forest.jpg" alt="Forest" class="subhodaya-opacity" style="opacity:0.2">
Try It Yourself »

Opacity 0.2

class="TheBestTutorials-opacity"

Opacity 0.8


Constructing a Photo Album

In this example we use the TheBestTutorials.css Responsive Grid system to create a photo album that looks good on all devices. You will learn more about this later.

Summer 2017

5 Terre

Monterosso

Vernazza

Manarola

Corniglia

Riomaggiore


Example

<div class="subhodaya-third">
  <div class="subhodaya-card-2">
    <img src="img_monterosso.jpg" style="width:100%">
    <div class="subhodaya-container">
      <h4>Monterosso</h4>
    </div>
  </div>
</div>
Try It Yourself »