значения функции:
* {
margin
:
0
;
padding
}
.main {
height
600px
width
900px
position
absolute
top
50%
left
margin-top
-300px
margin-left
-450px
.wrapper {
25%
100%
float
#div
1
, #div
2
3
4
{
200px
relative
-100px
background
: repeating-linear-gradient(
,
#FFF
0px
20px
#0000FF
40px
);
: -moz-repeating-linear-gradient(
: -o-repeating-linear-gradient(
: -webkit-repeating-linear-gradient(
: -ms-repeating-linear-gradient(
5px
10px
50px
* { margin: 0; padding: 0; } .main { height: 600px; width: 900px; position: absolute; top: 50%; left: 50%; margin-top: -300px; margin-left: -450px; } .wrapper { width: 25%; height: 100%; float: left; } #div1, #div2, #div3, #div4 { height: 200px; width: 200px; float: left; position: relative; top: 50%; left: 50%; margin-top: -100px; margin-left: -100px; } #div1 { background: repeating-linear-gradient(left, #FFF 0px, #FFF 20px, #0000FF 20px, #0000FF 40px); background: -moz-repeating-linear-gradient(left, #FFF 0px, #FFF 20px, #0000FF 20px, #0000FF 40px); background: -o-repeating-linear-gradient(left, #FFF 0px, #FFF 20px, #0000FF 20px, #0000FF 40px); background: -webkit-repeating-linear-gradient(left, #FFF 0px, #FFF 20px, #0000FF 20px, #0000FF 40px); background: -ms-repeating-linear-gradient(left, #FFF 0px, #FFF 20px, #0000FF 20px, #0000FF 40px); } #div4 { background: repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 50px); background: -moz-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 50px); background: -o-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 50px); background: -webkit-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 50px); background: -ms-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 50px); }
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
link
href
"css/style.css"
rel
"stylesheet"
script
type
"text/javascript"
src
"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
></
</
body
div
class
"main"
"wrapper"
id
"div1"
"div2"
"div3"
"div4"
/*JavaScript*/
document.getElementById("div2").style.background="repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 10px)";
document.getElementById("div2").style.background="-moz-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 10px)";
document.getElementById("div2").style.background="-o-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 10px)";
document.getElementById("div2").style.background="-webkit-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 10px)";
document.getElementById("div2").style.background="-ms-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 10px, #0000FF 10px)";
/*jQuery*/
$(document).ready(function() {
$("#div3").css({ "background": "repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 50px, #0000FF 10px)" });
$("#div3").css({ "background": "-moz-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 50px, #0000FF 10px)" });
$("#div3").css({ "background": "-o-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 50px, #0000FF 10px)" });
$("#div3").css({ "background": "-webkit-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 50px, #0000FF 10px)" });
$("#div3").css({ "background": "-ms-repeating-linear-gradient(top left, #FFF, #FFF 5px, #0000FF 50px, #0000FF 10px)" });
});