SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Css drop down menu adding text

    How can i add text into a category from css drop down menu ?

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,820
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    CSS does not add content. If it adding actual content you are better off hard coding the markup or using PHP ( and a database or CMS) .

    However , if all you are adding is stylistic text, such as a count# , or the like you can put a pseudo element at the end or beginning of anyn non-replaced tag.

    For example

    Code:
    .category li:after {
    content:"this text has been added";}
    
    <ul class='category'>
       <li>Item:</li>
      <li>Item:</li>
      <li>Item:</li>
    </ul>
    will output:

    • Item: this text has been added
    • Item: this text has been added
    • Item: this text has been added


Bookmarks

Posting Permissions

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