老师,狗狗的鼻子为什么显示不出来呢
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | <!DOCTYPE html> < html > < head > < meta charset = "utf-8" > < title >卡通狗</ title > < style type = "text/css" > :root{ --hl:#1b2f90; --bg:#f9f9f6; } body{ background: #ffc400; } .dog{ width: 300px; height: 400px; position: relative; } .center{ position: absolute; left: 50%; transform: translate(-50%,0); } .forehead{ width: 102px; height: 48px; background: var(--bg); border-radius: 51px/ 40px 40px 8px 8px; z-index: 1; } .face{ width: 110px; height: 68px; background: var(--bg); border-radius: 50%; top: 20px; z-index: 1; } .chin{ width: 104px; height: 36px; background: var(--bg); border-radius: 50%; top: 60px; border-radius: 52px/0px 0px 36px 36px; z-index: 1; } .ear{ width: 16px; height: 70px; background: var(--hl); border-radius: 50%; position: absolute; z-index: 0; left: 50%; top: 34px; transform-origin: 50% 0; transform: translate(-42px,0) rotate(10deg) ; } .ear.right{ transform:scale(-1,1) translate(-26px,0) rotate(10deg) ; } .birthmark{ width:30px; height:36px; background: var(--hl); border-radius: 15px /17px 23px 2px 13px; position: absolute; z-index: 1; left: 50%; top: 10px; transform: translate(15px,0) rotate(-10deg); } .eye{ width:24px; height:24px; background: var(--bg); border-radius: 12px/ 13px 12px 12px 2px; position: absolute; z-index: 2; left: 50%; top: 20px; transform-origin: 50% 0; transform: translate(-44px,0) rotate(10deg) ; box-shadow: 1px 0 0 0px #000 inset,-1px 0px 5px 1px #ddd; overflow: hidden; } .eye.right{ transform:scale(-1,1) translate(-18px,0) rotate(10deg) ; box-shadow: box-shadow: 1px 0 0 0px #000 inset; } .pupil{ width: 26px; height: 26px; background:#e79101; border-radius: 50%; position: absolute; left: 3px; top: 1px; box-shadow: 0 0 8px 0 inset; } .pupil::before{ width: 18px; height:18px; background: #000; border-radius: 50%; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); content: ""; } .pupil::after{ width: 5px; height:5px; background: #fff; border-radius: 50%; position: absolute; left: 3px; top: 7px; content: ""; } .nose{ width: 62px; height: 32px; top: 42px; z-index: 1; background: #000; border-radius:31px / 10px 10px 22px 22px; } .nostril{ width: 15px; height: 4px; top: 42px; background: #000; position: absolute; left: 50%; border-radius:31px/ 10px 10px 22px 22px; transform: rotate(30deg); } </ style > </ head > < body > < div class = "dog center" > < div class = "forehead center" ></ div > < div class = "face center" ></ div > < div class = "chin center" ></ div > < div class = "ear" ></ div > < div class = "ear right" ></ div > < div class = "birthmark" ></ div > < div class = "eye" > < div class = "pupil" ></ div > </ div > < div class = "eye right" > < div class = "pupil" ></ div > </ div > < div class = "nose" > < div class = "nostril" ></ div > < div class = "nostril right" ></ div > </ div > </ div > </ body > </ html > |
5
收起
正在回答
1回答
同学你好, 老师这边用谷歌和火狐浏览器测试狗狗的鼻子是可以显示出来的。 如下图
请问同学这里是想问如何设置鼻子的位置吗? 如果是指这里的话, 可以通过定位结合transform属性实现哦。 如下图
效果图:
如果同学指的不是这里的话, 可以详细的描述一下指的是哪里, 再次提问, 我们会继续为你解答的。
如果帮助到了你, 欢迎采纳!
祝学习愉快~~~
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧