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


# repr:parentStyle

### Диаграмма

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

### Описание {#desc}

Задает id родительского стиля.

С помощью `repr:parentStyle` осуществляется наследование стилей. Если тег не указан, то наследование будет происходить от стиля, определенного по умолчанию.

Наследование возможно только для тегов, непосредственно вложенных в [repr:Style](https://yandex.ru/dev/maps/ymapsml/doc/ru/ref/reference/representation-Style.md) ([repr:iconStyle](https://yandex.ru/dev/maps/ymapsml/doc/ru/ref/reference/representation-iconStyle.md), [ repr:lineStyle](https://yandex.ru/dev/maps/ymapsml/doc/ru/ref/reference/representation-lineStyle.md) и т.д.).

Тег наследуется только в том случае, если он отсутствует в дочернем стиле. Если тег присутствует, но определен не полностью (т. е. не все вложенные теги определены), то наследования происходить не будет. Частичного наследования в YMapsML нет.

### Содержится в:

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

> ### repr:parentStyle
> 
> YMapsML-документ, демонстрирующий наследование стилей.
> 
> В примере стиль `example#style2` унаследует от родительского стиля `example#style1` отображение значков меток (т. е. [repr:iconStyle](https://yandex.ru/dev/maps/ymapsml/doc/ru/ref/reference/representation-iconStyle.md)), а тег [repr:lineStyle](https://yandex.ru/dev/maps/ymapsml/doc/ru/ref/reference/representation-lineStyle.md) наследоваться не будет, так как он определен в стиле `example#style2`.
> 
> Остальные теги для описания стилей ([repr:iconContentStyle](https://yandex.ru/dev/maps/ymapsml/doc/ru/ref/reference/representation-iconContentStyle.md), [repr:hintContentStyle](https://yandex.ru/dev/maps/ymapsml/doc/ru/ref/reference/representation-hintContentStyle.md) и т. д.) не определены в родительском стиле, поэтому им будет присвоено значение по умолчанию.
> 
> ```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>
> ```

