{"id":533,"date":"2010-05-25T20:18:44","date_gmt":"2010-05-26T03:18:44","guid":{"rendered":"http:\/\/www.bryanhadaway.com\/?p=533"},"modified":"2025-05-22T15:31:46","modified_gmt":"2025-05-22T22:31:46","slug":"how-to-create-circles-with-css","status":"publish","type":"post","link":"https:\/\/webguy.io\/blog\/how-to-create-circles-with-css\/","title":{"rendered":"How to Create Circles with CSS"},"content":{"rendered":"<p><a href=\"https:\/\/webguy.io\/blog\/images\/posts\/color-scale-2.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/webguy.io\/blog\/images\/posts\/color-scale-2.jpg\" alt=\"Circles\" width=\"1920\" height=\"1245\" class=\"alignnone size-full wp-image-4902\" srcset=\"https:\/\/webguy.io\/blog\/images\/posts\/color-scale-2.jpg 1920w, https:\/\/webguy.io\/blog\/images\/posts\/color-scale-2-320x208.jpg 320w, https:\/\/webguy.io\/blog\/images\/posts\/color-scale-2-768x498.jpg 768w, https:\/\/webguy.io\/blog\/images\/posts\/color-scale-2-640x415.jpg 640w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/p>\n<p><em><strong>Last Updated:<\/strong> April 6th, 2018<\/em><\/p>\n<p>Making circles with CSS is very simple. Just make the radius half of the width and height of the element to make a perfect circle, or simply use:<\/p>\n<pre><code>border-radius:50%<\/code><\/pre>\n<h2>Responsive Circle With or Without Text Inside<\/h2>\n<p><em>Narrow your browser window horizontally to test the circle&#8217;s responsiveness.<\/em><\/p>\n<div style=\"width:50%;height:0;font-size:20px;color:#fff;text-align:center;line-height:0;padding:25% 0;border-radius:50%;background:#09f\">Hello<\/div>\n<h3>CSS<\/h3>\n<pre><code>.circle{width:50%;height:0;font-size:20px;color:#fff;text-align:center;line-height:0;padding:25% 0;border-radius:50%;background:#09f}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;div class=&quot;circle&quot;&gt;Hello&lt;\/div&gt;<\/code><\/pre>\n<h2>Plain Circle With or Without Text Inside<\/h2>\n<div style=\"width:100px;height:100px;border-radius:50px;font-size:20px;color:#fff;line-height:100px;text-align:center;background:#000\">Hello<\/div>\n<h3>CSS<\/h3>\n<pre><code>.circle{width:100px;height:100px;border-radius:50px;font-size:20px;color:#fff;line-height:100px;text-align:center;background:#000}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;div class=&quot;circle&quot;&gt;Hello&lt;\/div&gt;<\/code><\/pre>\n<h2>Clickable Link Circle Button<\/h2>\n<p><a href=\"#\" style=\"display:block;width:100px;height:100px;border-radius:50px;font-size:20px;color:#fff;line-height:100px;text-align:center;background:#000\">Hello<\/a><\/p>\n<h3>CSS<\/h3>\n<pre><code>.button{display:block;width:100px;height:100px;border-radius:50px;font-size:20px;color:#fff;line-height:100px;text-align:center;background:#000}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;a href=&quot;#&quot; class=&quot;button&quot;&gt;Hello&lt;\/a&gt;<\/code><\/pre>\n<h2>Menu Hover Effect Circle Button<\/h2>\n<p><a href=\"#\" class=\"cmenu\">Hello<\/a><\/p>\n<h3>CSS<\/h3>\n<pre><code>.menu{display:block;width:100px;height:100px;border-radius:50px;font-size:20px;color:#fff;line-height:100px;text-align:center;text-decoration:none;background:#000}.menu:hover{color:#ccc;text-decoration:none;background:#333}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;a href=&quot;#&quot; class=&quot;menu&quot;&gt;Hello&lt;\/a&gt;<\/code><\/pre>\n<h2>Stylish Menu Hover Effect Circle Button<\/h2>\n<p><a href=\"#\" class=\"stylish\">Hello<\/a><\/p>\n<h3>CSS<\/h3>\n<pre><code>.stylish{display:block;width:100px;height:100px;border-radius:66px;border:4px double #ccc;font-size:20px;color:#666;line-height:100px;text-align:center;text-decoration:none;text-shadow:0 1px 0 #fff;background:#ddd}.stylish:hover{border:4px double #bbb;color:#aaa;text-decoration:none;background:#e6e6e6}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;a href=&quot;#&quot; class=&quot;stylish&quot;&gt;Hello&lt;\/a&gt;<\/code><\/pre>\n<h2>Outset\/Inset Button Circle<\/h2>\n<p><a href=\"#\" class=\"inset\">Hello<\/a><\/p>\n<h3>CSS<\/h3>\n<pre><code>.inset{display:block;width:100px;height:100px;border-radius:50px;font-size:20px;font-weight:bold;color:#fff;line-height:100px;text-shadow:0 1px 0 #666;text-align:center;text-decoration:none;box-shadow:1px 1px 2px #000;background:#cccbbb;opacity:0.95}.inset:hover{color:#eee;text-shadow:0 0 1px #666;text-decoration:none;box-shadow:0 0 4px #222 inset;opacity:1}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;a href=&quot;#&quot; class=&quot;inset&quot;&gt;Hello&lt;\/a&gt;<\/code><\/pre>\n<h2>Multicolored Circle<\/h2>\n<div id=\"circle-container\">\n<div class=\"quarter top-left\"><\/div>\n<div class=\"quarter top-right\"><\/div>\n<div class=\"quarter bottom-left\"><\/div>\n<div class=\"quarter bottom-right\"><\/div>\n<\/div>\n<h3>CSS<\/h3>\n<pre><code>#circle-container{width:100px;height:100px}.quarter{width:50px;height:50px}.top-left{border-top-left-radius:50px;background:#09f;float:left}.top-right{border-top-right-radius:50px;background:#666;float:right}.bottom-left{border-bottom-left-radius:50px;background:#aaa;float:left}.bottom-right{border-bottom-right-radius:50px;background:#333;float:right}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;div id=&quot;circle-container&quot;&gt;&lt;div class=&quot;quarter top-left&quot;&gt;&lt;\/div&gt;&lt;div class=&quot;quarter top-right&quot;&gt;&lt;\/div&gt;&lt;div class=&quot;quarter bottom-left&quot;&gt;&lt;\/div&gt;&lt;div class=&quot;quarter bottom-right&quot;&gt;&lt;\/div&gt;&lt;\/div&gt;<\/code><\/pre>\n<h2>Gradient Circle<\/h2>\n<div style=\"width:100px;height:100px;border-radius:50px;background:linear-gradient(to bottom, #40b3ff, #09f)\"><\/div>\n<h3>CSS<\/h3>\n<pre><code>.grad{width:100px;height:100px;border-radius:50px;background:linear-gradient(to bottom, #40b3ff, #09f)}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;div class=&quot;grad&quot;&gt;&lt;\/div&gt;<\/code><\/pre>\n<h2>Change Text Upon Hover<\/h2>\n<p><a href=\"#\" class=\"change\"><span class=\"one\">Hello<\/span><span class=\"two\">Bye :(<\/span><\/a><\/p>\n<h3>CSS<\/h3>\n<pre><code>.change .two{display:none}.change:hover .one{display:none}.change:hover .two{display:inline}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;a href=&quot;#&quot; class=&quot;change&quot;&gt;&lt;span class=&quot;one&quot;&gt;Hello&lt;\/span&gt;&lt;span class=&quot;two&quot;&gt;Bye :(&lt;\/span&gt;&lt;\/a&gt;<\/code><\/pre>\n<h2>Call-to-Action with Adjacent Info<\/h2>\n<div style=\"width:100px;height:100px;border-radius:50%;font-size:20px;color:#fff;line-height:100px;text-align:center;background:#000\">Call Us!<span style=\"position:absolute;color:#777;margin-left:20px\">123.456.7890<\/span><\/div>\n<h3>CSS<\/h3>\n<pre><code>.circle{width:100px;height:100px;border-radius:50px;font-size:20px;color:#fff;line-height:100px;text-align:center;background:#000}.info{position:absolute;color:#777;margin-left:20px}<\/code><\/pre>\n<h3>HTML<\/h3>\n<pre><code>&lt;div class=&quot;circle&quot;&gt;Call Us!&lt;span class=&quot;info&quot;&gt;123.456.7890&lt;\/span&gt;&lt;\/div&gt;<\/code><\/pre>\n<p><em>If you need any help, don&#8217;t hesitate to ask in the comments below.<\/em><\/p>\n<style>.entry-content h2{margin-bottom:30px}.cmenu, .change{display:block;width:100px;height:100px;border-radius:50px;font-size:20px;color:#fff;line-height:100px;text-align:center;text-decoration:none;background:#000;}.cmenu:hover{color:#ccc;text-decoration:none;background:#333}.change .two{display:none}.change:hover .one{display:none}.change:hover .two{display:inline}.stylish{display:block;width:100px;height:100px;border-radius:66px;border:4px double #ccc;font-size:20px;color:#666;line-height:100px;text-shadow:0 1px 0 #fff;text-align:center;text-decoration:none;background:#ddd}.stylish:hover{border:4px double #bbb;color:#aaa;text-decoration:none;background:#e6e6e6}#circle-container{width:100px;height:100px}.quarter{width:50px;height:50px}.top-left{border-top-left-radius:50px;background:#09f;float:left}.top-right{border-top-right-radius:50px;background:#666;float:right}.bottom-left{border-bottom-left-radius:50px;background:#aaa;float:left}.bottom-right{border-bottom-right-radius:50px;background:#333;float:right}.inset{display:block;width:100px;height:100px;border-radius:50px;font-size:20px;font-weight:bold;color:#fff;line-height:100px;text-shadow:0 1px 0 #666;text-align:center;text-decoration:none;box-shadow:1px 1px 2px #000;background:#cccbbb;opacity:0.95}.inset:hover{color:#eee;text-shadow:0 0 1px #666;text-decoration:none;box-shadow:0 0 4px #222 inset;opacity:1}<\/style>\n","protected":false},"excerpt":{"rendered":"<p>Last Updated: April 6th, 2018 Making circles with CSS is very simple. Just make the radius half of the width and height of the element to make a perfect circle, or simply use: border-radius:50% Responsive Circle With or Without Text Inside Narrow your browser window horizontally to test the circle&#8217;s responsiveness. Hello CSS .circle{width:50%;height:0;font-size:20px;color:#fff;text-align:center;line-height:0;padding:25% 0;border-radius:50%;background:#09f} <a href=\"https:\/\/webguy.io\/blog\/how-to-create-circles-with-css\/\" class=\"more-link\">&#8230;<span class=\"screen-reader-text\">  How to Create Circles with CSS<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,17,5],"tags":[374,239,254,278,218,281,206,255],"class_list":["post-533","post","type-post","status-publish","format-standard","hentry","category-code","category-how-to","category-web-design","tag-circles","tag-code","tag-css","tag-css3","tag-how-to","tag-html","tag-web-design","tag-xhtml"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/posts\/533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/comments?post=533"}],"version-history":[{"count":0,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/posts\/533\/revisions"}],"wp:attachment":[{"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/media?parent=533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/categories?post=533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/tags?post=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}