This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14842|Reply: 2

[CSS/DIV] Newbies play some black technology in CSS

[Copy link]
Posted on 12/4/2017 8:24:39 PM | | | |
Ouch
1. Move the mouse into the web page and it is gone = =
*{    cursor: none!important; }2. Simple text blur effect
*{     color: transparent;    text-shadow: #111 0 0 5px; }
3. Multiple borders
.div {    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.2), 0 0 0 12px rgba(0, 0, 0, 0.2), 0 0 0 18px rgba(0, 0, 0, 0.2), 0 0 0 24px rgba(0, 0, 0, 0.2);    height: 200px;    margin: 50px auto;    width: 400px}
4. Edit CSS in real time
<!DOCTYPE html><html>    <body>        <style style="display:block" contentEditable>            body { color: blue }        </style>    </body></html>
5. Simple operations in CSS
.div{    width: calc(100% - 500px); }
6、border-radius
Because basically many people use it this way:
.div {     border-radius: 4px; }
A little more high-end is like this:
.div {    border-radius: 4px 6px 6px 4px; }
However, this is how the ultimate black technology is used:
.div {     border-radius: 5px 5px 3px 2px / 5px 5px 1px 3px; }
border-radius It can be assigned 8 values:
  The front of the slash affects the horizontal direction, and the back of the slash affects the vertical direction.
  Each number represents four different directions.
7、outline-offset
When writing CSS under input, you will be familiar with the following statements:
input {    outline : none; }input:focus {    outline : none; This is how to remove the default blue wireframe from the input input box.
There is also an outline-offset property in CSS where you can set the distance of the default wireframe:
input {    outline-offset: 4px ; }(Web front-end learning exchange group: 328058344 No small talk, don't enter unless you like it! Adjust the size of the attribute value and you can see the distance change of the outline.
Finally, I will present a demo of the big white before the facts
<!doctype html><html>    <head>        <meta charset="utf-8">        <title>Baymax</title>        <link rel=stylesheet href="demo2.css"/>    </head>    <style>           body {                background: #595959;            } #baymax{ /* is set to center*/ margin: 0 auto;                /*height*/ height: 600px;                /*hide overflow*/ overflow: hidden;            }            #head{                height: 64px;                width: 100px;                /*Define the shape of the rounded corner as a percentage*/border-radius: 50%;                /*background*/ background: #fff;                margin: 0 auto;                margin-bottom: -20px;                /*Set the style of the lower border*/ border-bottom: 5px solid #e0e0e0;                /*attribute sets the stacking order of elements;    Elements with a higher stack order will always be in front of the elements with a lower stack order*/ z-index: 100;                /*Generate relative positioned elements*/ position: relative;            }            #eye,            #eye2{                width: 11px;                height: 13px;                background: #282828;                border-radius: 50%;                position: relative;                top: 30px;                left: 27px;                /*rotate the element*/transform: rotate(8deg);            } #eye2{ /*Make it rotate symmetrically*/ transform: rotate(-8deg);                left: 69px;    top: 17px;            }            #mouth{                width: 38px;                height: 1.5px;                background: #282828;                position: relative;                left: 34px;                top: 10px;            } /*Torso and abdomen*/ #torso, #belly{ margin: 0 auto; }                height: 200px;                width: 180px;                background: #fff;                border-radius: 47%;                /*Set border*/ border: 5px solid #e0e0e0;                border-top: none;                z-index: 1;            }            #belly{                height: 300px;                width: 245px;                margin-top: -140px;                z-index: 5;            }            #cover{                width: 190px;                background: #fff;                height: 150px;                margin: 0 auto;                position: relative;                top: -20px;                border-radius: 50%;            } /*heart*/ #heart{ width:25px;               height:25px;               border-radius:50%;               position:relative;               /*Add shadow effects around the border*/ box-shadow:2px 5px 2px #ccc inset;               right:-115px;               top:40px;               z-index:111;               border:1px solid #ccc;            } /*arm*/ #left-arm, #right-arm{ height: 270px;                width: 120px;                border-radius: 50%;                background: #fff;                margin: 0 auto;                position: relative;                top: -350px;                left: -100px;                transform: rotate(20deg);                z-index: -1;            }            #right-arm{                transform: rotate(-20deg);                left: 100px;                top: -620px;            } /*finger*/ #l-bigfinger, #r-bigfinger{ height: 50px;                width: 20px;                border-radius: 50%;                background: #fff;                position: relative;                top: 250px;                left: 50px;                transform: rotate(-50deg);            }            #r-bigfinger{                left: 50px;                transform: rotate(50deg);            }            #l-smallfinger,            #r-smallfinger{                height: 35px;                width: 15px;                border-radius: 50%;                background: #fff;                position: relative;                top: 195px;                left: 66px;                transform: rotate(-40deg);            }            #r-smallfinger{                background: #fff;                transform: rotate(40deg);                top: 195px;                left: 37px;            } /*thigh*/ #left-leg, #right-leg{ height: 170px;                width: 90px;                border-radius: 40% 30% 10px 45%;                background: #fff;                position: relative;                top: -640px;                left: -45px;                transform: rotate(-1deg);                z-index: -2;                margin: 0 auto;            }            #right-leg{                background: #fff;                border-radius:30% 40% 45% 10px;                margin: 0 auto;                top: -810px;                left: 50px;                transform: rotate(1deg);            </style><body> } <div id="baymax"> <!-- Define the head, including two eyes, mouth --> <div id="head"> <div id="eye"></div> <div id="eye2"></div> <div id="mouth"></div> </div>        <!-- Define the trunk, including the heart --> <div id="torso"> <div id="heart"></div> </div> <!-- Define the belly, abdomen, including the cover (and the junction of the torso) --> <div id="belly"> <div id="cover"></div>        </div> <!-- Define the left arm, including two fingers, one large and one small --> <div id="left-arm"> <div id="l-bigfinger"></div> <div id="l-smallfinger"></div> </div> <!-- Define the right arm, which also includes one large and one small fingers -->        <div id="right-arm"> <div id="r-bigfinger"></div> <div id="r-smallfinger"></div> </div> <!-- define left leg --> <div id="left-leg"></div> <!-- define right leg -->        <div id="right-leg"></div>    </div></body><html>

Score

Number of participants1MB+1 contribute+1 Collapse reason
QWERTYU + 1 + 1 Support the owner to post a good post, and I will also post a good post!.

See all ratings





Previous:javascrip{filter}t performance optimization
Next:Gain an in-depth understanding of Java's garbage collection mechanism
Posted on 12/5/2017 9:10:05 AM |
The code can be edited
Posted on 12/5/2017 9:21:19 AM |
Dabai is good


Sorted out the code



Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com