Questions tagged [css-shapes]

CSS-Shapes are made by the use of Cascade Styling Sheets to make HTML elements into shapes and images. The most basic shapes include triangles, squares, and circles but can be made into more advance shapes such as hearts, octagons, and stars.

CSS Shapes pertain to questions about the rendering, bugs, and technical problems of HTML/CSS made shapes. These can be used on any tag but needs to be displayed as a block or inline-block elements. CSS Shapes can be used to direct viewers attention to certain elements on the page, make graphics, page structure, and objects.

Here is a simple CSS triangle,

.left-tri {
    width: 0; 
    height: 0; 
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent; 
    border-right: 10px solid brown; 
}

Here is the most common CSS shape,

.square {
    width: 100px;
    height: 100px;
    background: brown;
}

One benefit of using a CSS Shape is the ability to render to any monitor's display without becoming pixelated. CSS Shapes are very similar to an SVG(Scalable Vector Graphic) but remove the use of an image file. They also can allow the developer to rely more on CSS to style the page.


CSS-Shapes (CSS Exclusion) is a new tool Adobe has been working on. Currently the browser support is very poor. With CSS Exclusion you can add paths for text to wrap around or inside of that object to get flush text structure without an image. (Example, must enable CSS Exclusion on your browser to view)

Not all CSS Shapes have back browser support, for CSS Exclusions refer to the Browser Support tab.


References

Browser Support

Shape Generator Tools

1859 questions
2017
votes
23 answers

How do CSS triangles work?

There're plenty of different CSS shapes over at CSS Tricks - Shapes of CSS and I'm particularly puzzled with a triangle: #triangle-up { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; …
Stanislav Shabalin
  • 19,028
  • 3
  • 18
  • 18
324
votes
3 answers

How to create a radial menu in CSS?

How do I create a menu which looks like so: Link to PSD I don't want to use the PSD images. I would prefer using icons from some package like FontAwesome and have the backgrounds/css generated in CSS. A version of the menu that is using the PSD to…
ssb
  • 7,422
  • 10
  • 36
  • 61
317
votes
20 answers

How to use CSS to surround a number with a circle?

I would like to surround a number in a circle like in this image: Is this possible and how is it achieved?
Pentium10
  • 204,586
  • 122
  • 423
  • 502
235
votes
4 answers

How can I animate the drawing of text on a web page?

I want to have a web page which has one centered word. I want this word to be drawn with an animation, such that the page "writes" the word out the same way that we would, i.e. it starts at one point and draws lines and curves over time such that…
strugee
  • 2,752
  • 4
  • 19
  • 30
229
votes
11 answers

How do I create a teardrop in HTML?

How do I create a shape like this to display on a webpage? I don't want to use images since they would get blurry on scaling I tried with CSS: .tear { display: inline-block; transform: rotate(-30deg); border: 5px solid green; …
Persijn
  • 14,624
  • 3
  • 43
  • 72
210
votes
5 answers

How does this CSS produce a circle?

This is the CSS: div { width: 0; height: 0; border: 180px solid red; border-radius: 180px; } How does it produce the circle below? Suppose, if a rectangle width is 180 pixels and height is 180 pixels then it would appear like this:…
Navin Rauniyar
  • 10,127
  • 14
  • 45
  • 68
206
votes
11 answers

Control the dashed border stroke length and distance between strokes

Is it possible to control the length and distance between dashed border strokes in CSS? This example below displays differently between browsers: div { border: dashed 4px #000; padding: 20px; display: inline-block; }
I have a dashed…
AntonAL
  • 16,692
  • 21
  • 80
  • 114
204
votes
15 answers

Easier way to create circle div than using an image?

I'm wondering if there's an easier way to create circular divs than what I'm doing now. Currently, I am just making an image for each different size, but it's annoying to do this. Is there anyway using CSS to make divs which are circular and I can…
bmaster
  • 2,293
  • 2
  • 16
  • 12
201
votes
19 answers

How to draw a circle with text in the middle?

I found this example on stackoverflow: Draw Circle using css alone Which is great. But I'd like to know how to modify that example so that I can include text in the middle of the circle? I also found this: Vertically and horizontally centering…
dot
  • 14,928
  • 41
  • 110
  • 218
185
votes
4 answers

Border-radius in percentage (%) and pixels (px) or em

If I use a pixel or em value for border-radius, the edge radius is always a circular arc or a pill shape even if the value is greater than the largest side of the element. When I use percentages, the edge radius is elliptic and starts at the…
web-tiki
  • 99,765
  • 32
  • 217
  • 249
148
votes
8 answers

CSS Progress Circle

I have searched this website to find progress bars, but the ones I have been able to found show animated circles that go to the full 100%. I would like it to stop at certain percentages like in the screenshot below. Is there any way I can do that…
Adam GunShy Said
  • 1,497
  • 2
  • 10
  • 3
146
votes
6 answers

Draw Circle using css alone

Is it possible to draw circle using css only which can work on most of the browsers (IE,Mozilla,Safari) ?
Hector Barbossa
  • 5,506
  • 13
  • 48
  • 70
140
votes
19 answers

How to draw circle in html page?

How do you draw a circle using HTML5 and CSS3? Is it also possible to put text inside?
Sergey Metlov
  • 25,747
  • 28
  • 93
  • 153
126
votes
5 answers

CSS triangle custom border color

Attempting to use a custom hex color for my css triangle (border). However since it uses border properties I am unsure how to go about doing this. I would like to steer clear of javascript and css3 simply because of compatibility. I am trying to…
Ed R
  • 2,129
  • 6
  • 24
  • 32
113
votes
8 answers

Wavy shape with CSS

I'm trying to recreate this image with CSS: I would not need it to repeat. This is what I started but it just has a straight line: #wave { position: absolute; height: 70px; width: 600px; background: #e0efe3; }
stevenspiel
  • 5,775
  • 13
  • 60
  • 89
1
2 3
99 100