Javascript-форум (https://javascript.ru/forum/)
-   Элементы интерфейса (https://javascript.ru/forum/dom-window/)
-   -   Странный размер элемента сanvas (https://javascript.ru/forum/dom-window/50976-strannyjj-razmer-ehlementa-sanvas.html)

andypop 19.10.2014 18:28

Странный размер элемента сanvas
 
<body style="background-color:red" >
<canvas style="background-color:yellow" >
    
</canvas>
</body>

Здравствуйте, коллеги! Чем обусловлен такой размер элемента canvas?

Safort 19.10.2014 18:40

Какой такой?

andypop 19.10.2014 18:44

Safort,посмотрите пожалуйста какой. Он явно меньше body:)

рони 19.10.2014 18:50

andypop,
Цитата:

По умолчанию элемент имеет ширину 300 пикселей и высоту 150 пикселей. Если не задать атрибуты width и height, то элемент получит размеры по умолчанию.

andypop 19.10.2014 18:53

Буду благодарен, если укажете живительный источник своих знаний

рони 19.10.2014 18:55

andypop,
http://www.w3.org/TR/2009/WD-html5-2...s-element.html
Цитата:

The canvas element has two attributes to control the size of the coordinate space: width and height. These attributes, when specified, must have values that are valid non-negative integers. The rules for parsing non-negative integers must be used to obtain their numeric values. If an attribute is missing, or if parsing its value returns an error, then the default value must be used instead. The width attribute defaults to 300, and the height attribute defaults to 150.

andypop 19.10.2014 18:59

Спасибо большое.


Часовой пояс GMT +3, время: 09:00.