CSS Combinators 1005
A combinator is something that explains the relationship between the selectors.
A CSS selector can contain more than one simple selector. Between the simple selectors, we can include a combinator.
There are four different combinators in CSS:
- descendant selector (space)
- child selector (>)
- adjacent sibling selector (+)
- general sibling selector (~)
The position
property specifies the type of positioning method used for an element (static, relative, fixed, absolute or sticky).
The position Property
The position
property specifies the type of positioning method used for an element.
There are five different position values:
static
relative
<-fixed
absolute
<-sticky
Elements are then positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position
property is set first. They also work differently depending on the position value.
The float Property
The float
property is used for positioning and formatting content e.g. let an image float left to the text in a container.
The float
property can have one of the following values:
left
– The element floats to the left of its containerright
– The element floats to the right of its containernone
– The element does not float (will be displayed just where it occurs in the text). This is defaultinherit
– The element inherits the float value of its parent <- 상속받음
In its simplest use, the float
property can be used to wrap text around images.
display:inline; <-폭의개념이 없음/ 안에 든 텍스트 넓이에 따라 자동조절?