Welcome visitor
* Login
* Register
It is currently March 23rd, 2019, 8:23 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  Apply style to a single object
PostPosted: March 31st, 2009, 10:29 pm 

Posts: 17
Hi,

I'm learnig how to use css styles and I know how to apply style to tables, for example, using
table {
  border: 1px solid;
  }

What I'm looking for right now is to add style but only to one table, so to speak. If that makes sense enough, can you help me, please?


Top
 Profile  
 
  Re: Apply style to a single object
PostPosted: March 31st, 2009, 10:36 pm 

Posts: 117
If the object has an ID, lets say mainTable, you can edit that table only by using
<style>
#mainTable {
  border: 1px solid;
  }
</style>
Or if you want the same style for more than one table you can create a class, and call for that class in each element you want to inherit the style
<style>
.tabless{
  border: 5px solid;
  }
</style>
<table id="table1" class="tabless"></table>
<table id="mainTable"></table>
<table id="table2" class="tabless"></table>

Thus table1 and table2 have a different border than mainTable.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron