css实现白天与夜晚天空切换效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现白天与夜晚天空切换效果代码

代码标签: 夜晚 天空 切换 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">





    <style>
        :root {
          --light_radio_button_size: 50px; 
          --dark_radio_button_size: 45px;
        /*   large: 50/45, small 20/16 */
        }
        
        body {
          margin: 0;
          background-color: #eee;
        
          transition: background 1s;
        }
        
        #light_dark_radio_button_container {
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
        /*   background-color: green; */
          width: calc(var(--light_radio_button_size)*3 );
          padding-left:1px;
        }
        
        .light_dark_radio_button {
          position: relative;
          border-radius: 100%;
          top: 2px;
          box-shadow: 0px 0px 2px 1px black;
          width: var(--light_radio_button_size); 
          height: var(--light_radio_button_size);
          display: inline-block
        }
        
        #light_radio_button {
          width: var(--light_radio_button_size); 
          background: yellow;
        }
        
        #dark_radio_button {
          background-color: #111;
          top: 0px;
          left: 0px;
          width: var(--dark_radio_button_size); 
          height: var(--dark_radio_button_size); 
          z-index: 1;
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0