• support@answerspoint.com

Is it possible to use ID tag to change css content


Is there a way on taking the ID's from html ex) id="title1" so it takes whats in it to display in the content: section in the css.


<table class="layout display responsive-table">
                <th class="th" id="title1">Title12</th>
                <th class="th">Title2</th>
                <th class="th">Title3</th>
                <th class="th">Title4</th>

table.responsive-table td:nth-child(1):before {
        content: use id here;
    table.responsive-table td:nth-child(2):before {
        content: 'Title 2';




Yes using the attr() function.

table.responsive-table td:nth-child(1):before {
  content: attr(id);


  • answered 7 years ago
  • Sandy Hook


Yes you can take this via jquery. Just try

  • answered 7 years ago
  • Sandy Hook

Your Answer

    Facebook Share        
  • asked 8 years ago
  • viewed 1786 times
  • active 8 years ago

Best Rated Questions