YouTip LogoYouTip

Sel Only Of Type

## CSS3 :only-of-type selector :only-of-type selectorMatch elements that are the only child of their type within their parent element. ### Syntax ```css element:only-of-type ``` ### Browser Support | Property | Support status | |------|----------| | `:only-of-type` | **support** | ### Example The following example demonstrates :only-of-type selectorUsage: ```html

This is a title

This is a paragraph.

This is another paragraph.

This is a paragraph inside a div.

``` In the above example, only the first one `

` The element is selected because it is the only one in its parent element (body). `

` element. And the second one `

` The element is not selected because it is not the only one in its parent element (body). `

` element. The last one. `

` The element is not selected either because it is not the only one in its parent element (div). `

` element. ### Reference links - (https://www.w3.org/TR/selectors-3/#only-of-type-pseudo) ``` Now we need to translate Chinese parts. Let's do step by step. First line: "# CSS3 :only-of-type Selector | Bird's Tutorial" - unchanged. Second line: "# [Bird's Tutorial -- Learning not just technology, but dreams!]( - unchanged. Then list items: all English. Then after the big list, we have "CSS Reference Manual" unchanged. Then the list of CSS property links unchanged. Then "---" unchanged. Then heading: "## CSS3 :only-of-type selector" => translate to "## CSS3 :only-of-type selector" Next paragraph: ":only-of-type selectorMatch elements that are the only child of their type within their parent element. => translate to ":only-of-type selector matches elements that belong to a specific type and are the only child element of their parent element." Make sure to keep the period. Next: "### Syntax" => "### Syntax" Code block unchanged. Next: "### Browser Support" => "### Browser Support" Table header: "| Property | Support status |" => "| Property | Support |" Row: "| :only-of-type | **support** |" => "| :only-of-type | **Supported** |" Next: "### Example => "### Example" Paragraph: "The following example demonstrates :only-of-type selectorUsage:" => "The following example demonstrates the usage of the :only-of-type selector:" HTML code block: need to translate Chinese inside. Let's translate the HTML block: Original: ```html

This is a title

This is a paragraph.

This is another paragraph.

This is a paragraph inside a div.

``` Translate: - `

This is a title

` => `

This is a title

` (maybe "This is a heading"? but we keep literal translation.) - `

This is a paragraph.

` => `

This is a paragraph.

` - `

This is another paragraph.

` => `

This is another paragraph.

` - `

This is a paragraph inside a div.

` => `

This is a paragraph inside the div.

` Now after the HTML block, we have Chinese explanation: "In the above example, only the first one `

` The element is selected because it is the only one in its parent element (body). `

` element. And the second one `

` The element is not selected because it is not the only one in its parent element (body). `

` element. The last one. `

` The element is not selected either because it is not the only one in its parent element (div). `

` element. Translate each line: Line1: "In the above example, only the first one `

` The element is selected because it is the only one in its parent element (body). `

` element. => "In the example above, only the first `

` element is selected, because it is the only `

` element in its parent element (body)." Line2: "And the second one `

` The element is not selected because it is not the only one in its parent element (body). `

` element. => "While the second `

` element is not selected, because it is not the only `

` element in its parent element (body)." Line3: "The last one. `

` The element is not selected either because it is not the only one in its parent element (div). `

` element. => "The last `

` element is also not selected, because it is not the only `

` element in its parent element (div)." We need to keep line breaks; we can keep them as separate lines. Next: "### Reference links" => "### Reference Links" Bullet: "- (https://www.w3.org/TR/selectors-3/#only-of-type-pseudo)" => "- (https://www.w3.org/TR/selectors-3/#only-of-type-pseudo)" Now ensure we didn't miss any Chinese in the property list: all English. Check if any Chinese inside the property descriptions like "CSS3 appearance property" etc. All English. Now we need to output the full HTML with translations. Let's construct final output. We'll keep the exact same formatting, line breaks. Start: ``` # CSS3 :only-of-type Selector | Bird's Tutorial # [Bird's Tutorial -- Learning not just technology, but dreams!]( * ( * ( * ( * ( * (javascript:void(0);) * ( * ( * ( * ( * [C++]( * [C#]( * (javascript:void(0);) * ( * ( * ( * ( * (javascript:void(0);) * ( * ( * ( * ( * ( * ( * ( * (javascript:void(0)) * ( * ( * ( * ( * ( * ( * ( * ( * ( * ( * ( * ( * ( CSS Reference Manual ( "CSS Reference Manual")( "CSS Selectors")( "CSS Aural Reference Manual")( "CSS Web Safe Fonts")( "CSS Animations")( "CSS Functions")( "CSS Units")( "CSS Colors")( "CSS Legal Color Values")( "CSS Color Names")( "CSS Color Hex Values")( "CSS Browser Support")( ## CSS Properties ( "CSS3 appearance property")( "CSS3 backface-visibility property")( "CSS background property")( "CSS background-attachment property")( "CSS background-color property")( "CSS background-image property")( "CSS background-position property")( "CSS background-repeat property")( "CSS3 background-size property")( "CSS border property")( "CSS border-bottom property")( "CSS border-bottom-color property")( "CSS border-bottom-style property")(

← Sel Only ChildSel Last Of Type β†’