📜 ⬆️ ⬇️

Yandex.Internet, as the layout is designed

Looking into the code of the internet.yandex.ru page, I saw an interesting thing:
<- NOTE: Do not connect to production ->

The javascript itself in the file was as follows
/ *
* For internal use only!
*
* Adds a virtual 14-column grid overlaid to the document.
* total (2% left / right indent, 12 columns at 8%).
*
* Convenient to verify compliance with the result layout. The grid is shown
* only if columns parameter is added to query (eg index.html? columns)
*
* DANGER: Connect at the end of the page (at least on the studio layout), otherwise the header shifts by 1px
* /

function _columns (a) {
if (window.location.search.indexOf ("columns") == -1) {
return;
}

document.write ('');
')
for (var i = 0, l = a.length; i <l; i ++) {
document.write ('');
}
}

_columns ([2, 10, 18, 26, 34, 42, 50, 58, 66, 74, 82, 90, 98]);


The result of the work can be viewed on the internet.yandex.ru/?columns

And what a really good idea. Add a line with javascript to the layout, we get markup over the page. You can easily and conveniently check the “compliance of the result with the layout”.

Source: https://habr.com/ru/post/28113/


All Articles