Open In App

Semantic-UI Card Centered Variation

Improve
Improve
Like Article
Like
Save
Share
Report

Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use to make your website look more amazing.

Semantic UI provides us with a very easy way to display content in the form of cards in a very easy way instead of using CSS. Semantic UI provides us a way to display cards in different variations and with different content involved like links, buttons, approval, etc. In this article, let us learn about Semantic UI Card Centered Variation and learn the implementation of it with the help of example code.

Semantic UI Card Centered Variation: The Card Centered Variation in Semantic UI helps us to align the entire card to the center of the container. The card will automatically center itself in the container in card-centered variation.

Semantic UI Card Centered Variation Content Classes:

  • .centered: The entire card should be enclosed in .centered class to center the card.
  • .image: Enclose the image with this class.
  • .content: The content should be included within this class.

Syntax :

<div class="ui centered card">
  <div class="image">
    ...
  </div>
  <div class="content">
    ...
  </div>
</div>

Example:

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0">
  
    <link rel="stylesheet" href=
</head>
  
<body>
    <center>
        <h1 class="header ui green">GeeksforGeeks</h1>
        <strong>Semantic UI Card Centered Variation</strong>
    </center>
  
    <div class="ui centered card">
        <div class="image">
            <img src=
        </div>
        <div class="content">
            <a class="header">GeeksforGeeks</a>
        </div>
    </div>
</body>
  
</html>


Output :

Reference Link: https://semantic-ui.com/views/card.html#centered-card



Last Updated : 11 Feb, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads