css - Please explain: content:''; -


here code have question about

.store {   display: block;   position: relative; } .store:before, .store:after {   display: block;   position:absolute;   content:''; } .store:before {   background: url(store-before.png);   height: 23px;   width: 54px;   top:-3px;   left:-3px;  } .store:after {   background: url(store-after.png);   height: 20px;   width: 41px;   bottom:-3px;   right:-3px; } 

i noticed when "content" besides 2 apostrophes, before , after images don't show up. can explain meaning of 2 apostrophes? thanks.

the 2 apostrophes denote string. 2 double quotes denote string well, delimiter use depends on preference , escaping needs; see here details.

if there's nothing between 2 string delimiters, either '' or "", have empty string. if have besides string, it's other value may or may not valid. see here possible values content. if pass invalid value, other style declaration browser ignore it, , without valid value content default normal, none :before , :after pseudo-elements. prevent pseudo-element displaying.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -