background-image: repeating-linear-gradient(
-45deg,
transparent,
transparent 29px,
rgba(255, 255, 255, .5) 29px,
rgba(255, 255, 255, .5) 30px
);
background-image: repeating-linear-gradient(
-45deg,
transparent,
transparent 29px,
rgba(255, 255, 255, .5) 29px,
rgba(255, 255, 255, .5) 30px
);
background-size: 42px 42px;
background-image: repeating-linear-gradient(
-45deg,
transparent,
transparent 25%,
rgba(255, 255, 255, .5) 25%,
rgba(255, 255, 255, .5) calc(25% + 1px),
transparent calc(25% + 1px),
transparent 75%, rgba(255, 255, 255, .5) 75%,
rgba(255, 255, 255, .5) calc(75% + 1px),
transparent calc(75% + 1px),
transparent
);
background-size: 40px 40px;
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 240 240">
<defs>
<style>
.line,
.circle {
fill: #333;
fill-rule: evenodd;
}
.c2 {
transform: translate(240px, 0) rotateZ(90deg);
}
.c3 {
transform: translate(240px, 150px) rotateZ(180deg);
}
.c4 {
transform: translate(0, 150px) rotateZ(-90deg);
}
</style>
<symbol id="corner">
<path d="m 0,0 l 50,0 0,10 -40,0 0,40 -10,0 z"/>
</symbol>
</defs>
<g class="line">
<use class="c1" xlink:href="#corner"/>
<use class="c2" xlink:href="#corner"/>
<use class="c3" xlink:href="#corner"/>
<use class="c4" xlink:href="#corner"/>
</g>
<g class="circle">
<path d="m 60,75 a 60 60 0 0 1 120 0 a 60 60 0 0 1 -120 0 m 30,-10 a 10 10 0 0 1 20 0 a 10 10 0 0 1 -20 0 m 40,0 a 10 10 0 0 1 20 0 a 10 10 0 0 1 -20 0 m -40,35 a 40 40 0 0 0 60 0 a 70 70 0 0 1 -60 0"/>
<path d="m 30,240 a 110 200 0 0 1 180 0 z"/>
</g>
</svg>
Можно ли использовать rem для отступов блока друг от друга
К примеру, задать тегу html размер шрифта в один пиксель и использовать rem - так можно или не нужно и почему?
$(document).on('keydown', '[contenteditable]', function (e) {
if (e.keyCode == 13) {
var node = document.createElement('br');
e.preventDefault();
try {
var selection = window.getSelection(),
range = selection.getRangeAt(0);
range.deleteContents();
range.collapse(false);
range.insertNode(node);
range.selectNode(node);
range.collapse(false);
selection.removeAllRanges();
selection.addRange(range);
} catch (z) {
var range = document.selection.createRange();
range.pasteHTML(node.outerHTML);
range.select();
}
}
});
<input type="date" min="2015-04-20" max="2015-04-24">
#main-navigation li:not(:last-child) a {
border-right: 1px dashed #39f;
}
#main-navigation li + li a {
border-right: 1px dashed #39f;
}
<div class="container">
<div class="header"></div>
<div class="main">
<div class="content">
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
</div>
<div class="sidebar"></div>
</div>
<div class="footer"></div>
</div>
html {
background: #f6f6f6;
}
body {
margin: 0;
}
html,
body,
.container {
height: 100%;
}
.container {
position: relative;
min-width: 600px;
}
.header {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 80px;
background: #9c6;
}
.main {
display: flex;
box-sizing: border-box;
min-height: 100%;
margin: 0 0 -120px;
padding: 80px 0 120px;
}
.content {
flex-grow: 1;
background: #ccf;
}
.sidebar {
flex-basis: 200px;
background: #f99;
}
.footer {
height: 120px;
background: #69c;
}
.content:before,
.content:after {
content: "";
display: table;
}
.block {
width: 150px;
height: 100px;
margin: 10px;
background: #f96;
}
<div class="container">
<div class="header"></div>
<div class="main">
<div class="content">
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
<div class="block"></div>
</div>
<div class="sidebar"></div>
</div>
<div class="footer"></div>
</div>
html {
background: #f6f6f6;
}
body {
margin: 0;
}
html,
body,
.container {
height: 100%;
}
.container {
position: relative;
min-width: 600px;
}
.header {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 80px;
background: #9c6;
}
.main {
position: relative;
box-sizing: border-box;
min-height: 100%;
margin: 0 0 -120px;
padding: 80px 0 120px;
}
.main:after {
content: "";
display: block;
clear: both;
}
.content {
float: left;
width: 100%;
margin-right: -200px;
}
.sidebar {
float: right;
width: 200px;
}
.content:before,
.sidebar:before {
content: "";
position: absolute;
z-index: -1;
top: 80px;
bottom: 120px;
}
.content:before {
left: 0;
right: 200px;
background: #ccf;
}
.sidebar:before {
right: 0;
width: 200px;
background: #f99;
}
.footer {
clear: both;
position: relative;
height: 120px;
background: #69c;
}
.block {
width: 150px;
height: 100px;
margin: 10px;
background: #f96;
}
h1:hover ~ img {
transform: scale(1.1, 1.1);
}
$(function () {
$('.cena').each(function () {
$(this).text($(this).text().replace(/^\s*(\d+)(\d{3})\s*([а-я\.]+)?\s*$/, '$1 $2 $3'));
});
});
body:after {
content: "";
position: fixed;
z-index: 1; /*Раззудись, молодецкое плечо*/
top: 0;
right: 0;
bottom: 0;
left: 0;
}