Home  >  Article  >  Web Front-end  >  How to set font three-dimensional in css

How to set font three-dimensional in css

anonymity
anonymityOriginal
2019-05-28 13:49:225397browse

html code:

<div contenteditable="true" class="text effect01">前端开发</div>

How to set font three-dimensional in css

How to set the font three-dimensional in css?

In css, let’s first look at the global settings. In order to avoid visual fatigue, we modified the background color and text color.

body{  
  background-color: #666;  
}  
@import url(http://fonts.googleapis.com/css?family=Dosis:500,800);  
.text {  
    font-family:"微软雅黑", "Dosis", sans-serif;  
    font-size: 80px;  
    text-align: center;  
    font-weight: bold;  
    line-height:200px;  
    text-transform:uppercase;  
    position: relative;  
}

Then the core code of the simple effect

/*Simple effect*/

.effect01{
    background-color: #7ABCFF;
    color:#FFD300;
    text-shadow:
        0px 0px 0 #b89800, 
        1px -1px 0 #b39400, 
        2px -2px 0 #ad8f00, 
        3px -3px 0 #a88b00, 
        4px -4px 0 #a38700, 
        5px -5px 0 #9e8300, 
        6px -6px 0 #997f00, 
        7px -7px 0 #947a00, 
        8px -8px 0 #8f7600, 
        9px -9px 0 #8a7200, 
        10px -10px 0 #856e00, 
        11px -11px 0 #806a00, 
        12px -12px 0 #7a6500, 
        13px -13px 12px rgba(0, 0, 0, 0.55), 
        13px -13px 1px rgba(0, 0, 0, 0.5);
}

From this we can see the elements of using text-shadow to achieve a three-dimensional effect There are three:

Set multiple shadows to achieve a sense of depth,

The horizontal and vertical offset changes of the shadows achieve a sense of direction, and

The color gradient of the shadows achieves a sense of staggeredness.

The above is the detailed content of How to set font three-dimensional in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn