Jump to content

The :before and :after Pseudo-elements


Recommended Posts

I´m reading the CSS tutorial and I just read about the :before and :after Pseudo-elements. Can somebody tell me when I could need these elements?Because I can´t guess for what I´d want to add some sound or something after or before a i.e. h1 ocurrs.Thanks!

Link to post
Share on other sites

Well let's say you wanted your headings to be in bracket [like this]. You could do:h1:before { content: "["; }h1:after { content: "]"; }Also you can decide to disable or enable quotation marks around quotes like this:q:before { content: open-quote; }q:after { content: close-quote; }You can also use p:after { content: url(image.gif); } to place some signature image at the end of a paragraph, and so on.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...