Baseline Widely available
CSS object-position
ìì±ì ëì²´ ììì ì½í
ì¸ ì ë ¬ ë°©ìì ì§ì í©ëë¤. ëì²´ ììì ê°ì²´ê° ë®ì§ ìì ë¶ë¶ì ììì ë°°ê²½ì´ ë³´ì´ê² ë©ëë¤.
ëì²´ ìì ê°ì²´ì ê³ ì í¬ê¸°(ìì ì ê°íì§ ìì ìë í¬ê¸°)를 ì¡°ì í´ ìì ë°ì¤ì ë§ì¶ë ë°©ë²ì object-fit
ìì±ì¼ë¡ ì§ì í ì ììµëë¤.
object-position: 50% 50%;
object-position: right top;
object-position: left bottom;
object-position: 250px 125px;
<section id="default-example">
<img
class="transition-all"
id="example-element"
src="/shared-assets/images/examples/moon.jpg" />
</section>
#example-element {
height: 250px;
width: 250px;
object-fit: none;
border: 1px solid red;
}
구문
/* <position> ê° */
object-position: center top;
object-position: 100px 50px;
/* ì ì ê° */
object-position: inherit;
object-position: initial;
object-position: unset;
ê°
<position>
ê°ì²´ì 2D ìì¹ë¥¼ ì§ì íë í ê°ìì ë¤ ê°ì ê°. ìëì ì ë ì¤íì ì ì¬ì©í ì ììµëë¤.
ì°¸ê³ : ì½í ì¸ ê° ëì²´ ììì ë°ì¤ ë°ê¹¥ì¼ë¡ ëê°ëë¡ ì§ì í ìë ììµëë¤.
íì ì ì íì 구문object-position =ìì ì´ë¯¸ì§ ì½í ì¸ ìì¹ ì§ì HTML
<position><position> =
[ left | center | right | top | bottom | <length-percentage> ] |
[ left | center | right ] && [ top | center | bottom ] |
[ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] |
[ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ]<length-percentage> =
<length> |
<percentage>
ë ê°ì <img>
ììê° MDN ë¡ê³ 를 ê°ë¦¬í¤ë ì½ëì
ëë¤.
<img id="object-position-1" src="mdn.svg" alt="MDN Logo" />
<img id="object-position-2" src="mdn.svg" alt="MDN Logo" />
CSS
ë¤ì CSSë ë <img>
ìì 모ëì ì ì©í ì¤íì¼ê³¼ í¨ê», ê°ê° ë³ëë¡ ì ì©í object-position
ìì±ë ì§ì íê³ ììµëë¤.
img {
width: 300px;
height: 250px;
border: 1px solid black;
background-color: silver;
margin-right: 1em;
object-fit: none;
}
#object-position-1 {
object-position: 10px;
}
#object-position-2 {
object-position: 100% 10%;
}
첫 ë²ì§¸ ì´ë¯¸ì§ë ìì ë°ì¤ì ì¼ìª½ ê²½ê³ë¡ë¶í° 10í½ì ë¨ì´ì§ ê³³ì¼ë¡ ë°°ì¹ë©ëë¤. ë ë²ì§¸ ì´ë¯¸ì§ë ìì ë°ì¤ì ì¤ë¥¸ìª½ ê²½ê³ì ìì ì ì¤ë¥¸ìª½ 모ì리를 ìë¡ ê²¹ì¹ê³ , ë°ì¤ì ì쪽 ê²½ê³ë¡ë¶í° ë°ì¤ ëì´ì 10% ë¨ì´ì§ ì§ì ì¼ë¡ ë°°ì¹ë©ëë¤.
ê²°ê³¼ ëª ì¸ ë¸ë¼ì°ì í¸íì± ê°ì´ 보기RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4