The Wayback Machine - https://web.archive.org/web/20240714144812/https://www.geeksforgeeks.org/how-to-place-svg-icons-on-a-round-circle-side-by-side-to-another-div-using-bootstrap/
Open In App

How to place SVG icons on a round circle side by side to another div using Bootstrap?

Last Updated : 05 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Bootstrap Icons are SVGs, so they scale quickly and easily and can be styled with CSS. Approach: We can place the SVG icons and give them the shape of a circle. This will make the SVG icons appear to be in a circular shape. This can be achieved using a Bootstrap class called “rounded-circle” 

Syntax:

<img class = "rounded-circle" src = "..." alt = "image">

Example: Let us try to place three SVG icons on a circle that appears on the same line (side by side as required). 

To make sure all the icons appear side by side, we have to include float: left; inside the CSS for <img> tag. 

Additionally (optionally), we also add the Bootstrap class “shadow-lg”, to get shadow beneath each SVG icon to make it look good.

 Example: place this <img> tag inside a <div> tag as shown below: 

HTML




<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
        content="width=device-width"/>
    <title>JS Bin</title>
    <link rel="stylesheet" href=
        integrity=
"sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
        crossorigin="anonymous"/>
    <style>
        img {
            width: 100px;
            height: 100px;
            margin-top: 50px;
            float: left;
            margin-left: 10px;
        }
    </style>
</head>
 
<body>
    <div><img class="shadow-lg rounded-circle" src=
        alt="image1" />
    </div>
    <div><img class="shadow-lg rounded-circle" src=
        alt="image2"/>
    </div>
    <div><img class="shadow-lg rounded-circle" src=
        alt="image3"/>
    </div>
</body>
</html>


Output: References:

  1. Bootstrap Documentation
  2. Smiley SVG icons
  3. Shadow in Bootstrap


Similar Reads

How to place two div side-by-side of the same height using CSS?
The two or more different div of same height can be put side-by-side using CSS. Use CSS property to set the height and width of div and use display property to place div in side-by-side format. The used display property are listed below: display:table; This property is used for elements (div) which behaves like table.display:table-cell; This proper
2 min read
How to overlay one div over another div using CSS
Creating an overlay effect simply means putting two div together at the same place but both the div appear when needed i.e while hovering or while clicking on one of the div to make the second one appear. Overlays are very clean and give the webpage a tidy look. It looks sophisticated and is simple to design. Overlays can create using two simple CS
2 min read
How to copy the content of a div into another div using jQuery ?
Given an HTML document containing some div element and the task is to copy a div content into another div as its child using jQuery. There are two approaches to solve this problem that are discussed below: Approach 1: First, select the div element which needs to be copied into another div element.Select the target element where the div element is c
2 min read
How To Place Tables Side by Side using HTML and CSS
In this article, we will learn how to place tables side by side using HTML and CSS. To place tables side by side, first, we create two tables using &lt;table&gt; tag and then apply some CSS styles to place both tables side by side. Place Tables Side by SideExample: Here, we place two Tables Side by Side using HTML and CSS. C/C++ Code &amp;lt;!DOCTY
2 min read
How to center a div within another div?
The div tag is used to construct a division or section of an HTML document in which other elements of HTML is placed and that division/section works like a container whose CSS styling can be done as a single unit or javascript can be used to perform various tasks on that container. Syntax: &lt;div&gt; &lt;h3&gt;'This is a div of the web page.&gt;/h
4 min read
How to center a div on the edge of another div in SASS ?
In this article, we will see how to centre a div on the edge of another div using SASS. SASS is an extension of CSS that stands for Syntactically Awesome Style Sheets. It helps us to create things like variables, nested rules, etc. So that we can reuse the code. Centering a div on the edge of another div is not a difficult task. We can achieve it b
4 min read
How to float three div side by side using CSS?
In this article, we are going to learn how to float three divs side by side using CSS. Three or more different divs can be put side-by-side using CSS. Use the CSS property to set the height and width of the div and use the display property to place the div in a side-by-side format. These are the following ways to solve this problem: Table of Conten
3 min read
Angular PrimeNG Speed Dial Circle, Semi-Circle and Quarter-Circle
Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will learn how to use the Speed Dial Circle, Semi-Circle, and Quarter-Circle Components in Angular PrimeNG. We will also learn abo
4 min read
Check if a Circle Lies Inside Another Circle or not in JavaScript
A circle is a closed curve where all points on the curve are equidistant from a fixed point called the center. In this problem, we are given the center points, and the radius values of two circles, we have to Check if a circle lies inside another circle or not using JavaScript. Example: Input:center points of first circle: x1 = 2, y1 = 3, radius of
3 min read
Server Side Rendering vs Client Side Rendering vs Server Side Generation
In the world of web development, there are several approaches to rendering web pages: server-side rendering, client-side rendering, and server-side generation. Each approach has its own advantages and disadvantages, and choosing the right one for your project depends on your specific needs and goals. In this blog, we’ll explore the differences betw
4 min read
three90RightbarBannerImg