www.webdeveloper.com
Results 1 to 4 of 4

Thread: Graphics - before: or after:

  1. #1
    Join Date
    Dec 2003
    Location
    Ottawa, Ontario, Canada
    Posts
    134

    Graphics - before: or after:

    Isn't there a way that I could add graphics in CSS using the before and after attributes? I've been looking for it all morning - I saw this somewhere online before. Plus, is this approach a valid one?

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Testing :before and :after using
    Code:
    ...
    <style type="text/css">
    p:before { content: "Paragraph: "; }
    p:after	 { content: " :End of paragraph"; }
    </style>
    </head>
    <body>
    <p>Now is the time</p>
    </body>
    ...
    I found that IE doesn't understand them yet although Mozilla does. So in general you'll need to find another way to do what you want.

  3. #3
    Join Date
    Dec 2003
    Location
    Ottawa, Ontario, Canada
    Posts
    134
    I wanted to play around with graphics... it has nothing to do with text. So, I guess I'll have to check for another way .

    I was looking to do rounded corners / edges for the page. I'll have to include image tags of some kind to have them display. Thought by doing the :before and :after properties that I could have had added graphics at the top and bottom of my main DIV using CSS.
    Last edited by DanDigiMan; 01-07-2004 at 09:38 AM.

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    That is doable using background images but you typically have to apply them to multiple elements. http://www.alistapart.com has a number of articles that relate to similar situations.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles