CodeRunBox
Compiler
Glossary
Example
Course
HTML
CSS
JavaScript
Python
Swift
TypeScript
SQL
React
What is CSS?!importantAnimationBackground imageBlur() functionBorder colorBorder radiusBorder widthBordersBox modelBox shadowClass attributeClip pathColorCommentCursorDisplay propertyFirst-child selectorFlexboxFont familyFont sizeFont styleFont weightGapGradientGrid layoutHeightID selectorLetter spacingLinking a style sheetMarginMedia queryMinmax() functionN-th-child selectorObject fitOpacityOutlineOverflow propertyPaddingPixelsPointer eventsPosition propertyPseudo-classesPseudo-elementsRotateRounding an imageScale()SelectorsSpecificityText alignText shadowText wrapTransition propertyTranslate() propertyUnitsVariablewhite-spaceWidthZ-index

Rounding an image in CSS

To make an image a circle, we set border-radius to half the width of an image. It only works if the image is a square though!

css
<head> <link rel="stylesheet" href="style.css"> </head> <body> <img src="https://mimo.app/r/lighthouse.png"> </body>
css
img { height: 100px; width: 100px; border-radius: 50px; border: solid 5px; }