How to use before and after CSS

Forums CSSHow to use before and after CSS
Staff asked 1 month ago

how to use before and after CSS

Answers (1)

Add Answer
Staff answered 1 month ago

For before

#yourClass:before
{
   content: "";
    width: 40px;
    height: 3px;
    background-color: #529600;
    left: 0;
    position: relative;
    display: block;
    top: 10px;
}

For After:

#yourClass:after
{
   content: "";
    width: 40px;
    height: 3px;
    background-color: #529600;
    left: 0;
    position: relative;
    display: block;
    top: 10px;
}

 

Subscribe

Select Categories