Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the css pseudo-elements such as :before

I'm confused about the pseudo-elements behaviour. I learn from w3c The :before and :after pseudo-elements

So, my question is as follows:

html :

<div id="breadcrumbs">this is a old content.</div>

css:

#breadcrumbs:before {
    content:"this is a new content."
}

I want to know whether the new content insert inside the div tag or outside.

  1. <div id="breadcrumbs">this is a new content.this is a old content.</div>

  2. this is a new content<div id="breadcrumbs">this is a old content.</div>

Which one is the right? Thanks a lot in advance!

like image 691
Jason Avatar asked Nov 29 '25 22:11

Jason


1 Answers

This slideshow mentions this very question and is a very good bit of information in any case.

According to Chris Coyier it would be the first

<div id="breadcrumbs"><span>this is a new content.</span>this is a old content.</div>

and here's the official documentation

like image 192
Joseph Marikle Avatar answered Dec 01 '25 13:12

Joseph Marikle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!