Write inside a DIV using CSS

Asked

Viewed 4,551 times

1

Like I write inside a DIV using CSS. Below I have the CSS and in this same code I would like to write a sentence to appear in this DIV.

.gerenciar-coluna-exibicao-vismodelo{    
        position:relative;
        height:60px;
        width:250px;      
        float:left;
        text-align:left;
        line-height:70px;
        border: 0px double #cccccc;
        text-indent:25px;
        background-color:#FF3F42;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 20px;
        color:#1085A9;
    }

Without that I need to go in the DIV TAG and write what I need.

  • You want to change the text content of div via css?

1 answer

1


Do it like this

.gerenciar-coluna-exibicao-vismodelo:before {
  content: "Boschini was here!";
}

However the recommended would be you to do by jquery.

  • Why? may be incompatible with some browsers?

  • 1

    IE8+ supports, but it’s kind of gambiarra this saw, I believe that by JS would be ideal. but it works

  • Qlq browser with CSS2 support

Browser other questions tagged

You are not signed in. Login or sign up in order to post.