BEE bee
BEE bee

Reputation: 31

Is there any way to make a div by using pure css?

I'm editing a wordpress site that I dont have access to any of the HTML and only css. I need to input just two lines of text sort of like a "div". Is there any way to do this by only using CSS?

Upvotes: 1

Views: 44

Answers (2)

dshamis317
dshamis317

Reputation: 91

Could you do it with :before or :after pseudo elements?

div.class-name:after {
    content: 'text goes here';
    display: block;
    [style further as necessary]
}

Upvotes: 0

recursive
recursive

Reputation: 86094

You can use :before or :after pseudo elements like this.

p:before {
  color: red;
  display: block;
  content: 'this is from css';
}
<p>hello there</p>

Upvotes: 2

Related Questions