You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-round-display/Overview.bs
+97Lines changed: 97 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -394,3 +394,100 @@ One of the profits of polar coordinate system is performance improvement. The si
394
394
<p class="issue">
395
395
By 'polar-distance' property, a position of an element is specified based on the containing block's center. In other way, is the method of positioning elements by the distance based on the edge of the containing block needed?
The ‘polar-anchor’ property sets an anchor point of the element. The anchor point specifies a position which is a representative point of the element. The anchor point could be set as any point within a content area of the element rather than being positioned to the upper left corner of the element by CSS box model.
400
+
401
+
With position: polar, the value of polar-distance is given to the distance between an anchor point and a center point of a containing block.
402
+
</p>
403
+
<pre class='propdef'>
404
+
Name: polar-anchor
405
+
Applies to: all elements
406
+
Value: <<position>>
407
+
Initial: center
408
+
Media: visual
409
+
Inherited: no
410
+
Percentages: relative to width and height of an element
411
+
Animatable: as <<position>>
412
+
</pre>
413
+
<p>
414
+
The property's value is given as <position> specified in ‘background-position’ property, but meanings of some keywords in value type are different in ‘polar-anchor’ property.
[ left | center | right | top | bottom | <var><percentage></var> | <var><length></var> ]
423
+
|
424
+
[ left | center | right | <var><percentage></var> | <var><length></var> ]
425
+
[ top | center | bottom | <var><percentage></var> | <var><length></var> ]
426
+
|
427
+
[ center | [ left | right ] [ <var><percentage></var> | <var><length></var> ]? ] &&
428
+
[ center | [ top | bottom ] [ <var><percentage></var> | <var><length></var> ]? ]
429
+
]
430
+
</pre>
431
+
<p>
432
+
<dt><var><percentage></var></dt>
433
+
<dd>
434
+
A percentage for the horizontal offset is relative to width of content box area of the element. A percentage for the vertical offset is relative to height of content box area of the element. For example, with a value pair of ‘100%, 0%’, an anchor point is on the upper right corner of the element.
435
+
</dd>
436
+
437
+
<dt><var><length></var></dt>
438
+
<dd>
439
+
A length value gives a length offset from the upper left corner of the element’s content area.
440
+
</dd>
441
+
</p>
442
+
<p>
443
+
Only with 'polar-angle' and 'polar-distance' to position elements, adjusting values of those properties for avoiding elements sticking out of the containing block is required. When the appropriate anchor point is given, there is no need to adjust polar-distance value to avoid overflowing when positioning elements in the containing block.
444
+
</p>
445
+
446
+
<div class='example'>
447
+
This example shows an alignment of four elements with different anchor points positioned in a containing block.
448
+
449
+
<pre><style>
450
+
#item1 {
451
+
position: polar;
452
+
polar-angle: 45deg;
453
+
polar-distance: 100%;
454
+
polar-anchor: right top;
455
+
456
+
}
457
+
#item2 {
458
+
position: polar;
459
+
polar-angle: 135deg;
460
+
polar-distance: 100%;
461
+
polar-anchor: right bottom;
462
+
}
463
+
#item3 {
464
+
position: polar;
465
+
polar-angle: 225deg;
466
+
polar-distance: 100%;
467
+
polar-anchor: left bottom;
468
+
}
469
+
#item4 {
470
+
position: polar;
471
+
polar-angle: 315deg;
472
+
polar-distance: 100%;
473
+
polar-anchor: left top;
474
+
}
475
+
</style>
476
+
<body>
477
+
<div id="item1"></div>
478
+
<div id="item2"></div>
479
+
<div id="item3"></div>
480
+
<div id="item4"></div>
481
+
</body>
482
+
</pre>
483
+
<div style="width: 400px; text-align: center">
484
+
<img alt="An image of four elements with different anchor points positioned in a containing block" src="images/polar_anchor.png" style="width: 200px; border: 1px #AAA solid; text-align: center"/>
485
+
<p class="caption">An example of 'polar-anchor'</p>
486
+
</div>
487
+
</div>
488
+
<p class="issue">
489
+
Is ‘auto’ needed for value of ‘polar-anchor’?
490
+
</p>
491
+
<p class="issue">
492
+
How to solve overflowing when an anchor point is set to ‘top’, polar-angle value is 0deg and polar-distance is equal to the distance from center to edge of containing block?
0 commit comments