---
keywords: repr:parentStyle
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/maps/ymapsml/doc/en/llms.txt


# repr:parentStyle

### Diagram

![](../_images/parentStyle.png)

### Description {#desc}

Sets the parent style ID.

Styles are inherited via `repr:parentStyle`. If a tag is not specified, style inheritance is from the default style.

Inheritance is only possible for tags that are directly nested in [repr: Style](https://yandex.ru/dev/maps/ymapsml/doc/en/ref/reference/representation-Style.md) ([repr: iconStyle](https://yandex.ru/dev/maps/ymapsml/doc/en/ref/reference/representation-iconStyle.md), [repr: lineStyle](https://yandex.ru/dev/maps/ymapsml/doc/en/ref/reference/representation-lineStyle.md), and so on).

A tag is inherited only if it is not present in the child style. If a tag is present but not fully defined (i.e., not all nested tags are defined), there will be no inheritance. YMapsML supports no partial inheritance.

### Contained by:

[repr:Style](https://yandex.ru/dev/maps/ymapsml/doc/en/ref/reference/representation-Style.md)

> ### repr:parentStyle
> 
> A YMapsML document demonstrating style inheritance.
> 
> In this example, style `example#style2` uses styles inherited from the parent style `example#style1` for displaying placemark icons (i.e., [repr:iconStyle](https://yandex.ru/dev/maps/ymapsml/doc/en/ref/reference/representation-iconStyle.md)), while the [repr:lineStyle](https://yandex.ru/dev/maps/ymapsml/doc/en/ref/reference/representation-lineStyle.md) tag will not be inherited, because it is defined in the `example#style2` style.
> 
> Other style tags ([repr: iconContentStyle](https://yandex.ru/dev/maps/ymapsml/doc/en/ref/reference/representation-iconContentStyle.md), [repr:hintContentStyle](https://yandex.ru/dev/maps/ymapsml/doc/en/ref/reference/representation-hintContentStyle.md), and so on) are not defined in the parent style, so they will be assigned the default value.
> 
> ```xml
> <?xml version="1.0" encoding="utf-8"?>
> <ymaps:ymaps xmlns:ymaps="http://maps.yandex.ru/ymaps/1.x"
>              xmlns:gml="http://www.opengis.net/gml" 
>              xmlns:repr="http://maps.yandex.ru/representation/1.x"
>              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>              xsi:schemaLocation="http://maps.yandex.ru/schemas/ymaps/1.x/ymaps.xsd">
>     <repr:Representation>
>         <repr:Style gml:id="example#style1">
>             <repr:iconStyle>
>                 <repr:href>http://info.maps.yandex.net/api/i/steelblue/dot.png</repr:href>
>                 <repr:size x="26" y="46"/>
>                 <repr:offset x="-22" y="-46"/>
>             </repr:iconStyle>
> 
>             <repr:lineStyle>
>                 <repr:strokeColor>12345688</repr:strokeColor>
>                 <repr:strokeWidth>2</repr:strokeWidth>
>             </repr:lineStyle>
>         </repr:Style>
>       
>         <repr:Style gml:id="example#style2">
>             <repr:parentStyle>example#style1</repr:parentStyle>
>             <repr:lineStyle>
>                 <repr:strokeColor>77382250</repr:strokeColor>
>                 <repr:strokeWidth>4</repr:strokeWidth>
>             </repr:lineStyle>
>         </repr:Style>
>     </repr:Representation>
> </ymaps:ymaps>
> ```

