07-01-2003, 05:15 PM
|
#1
|
|
Member
FatJoe2 is
Offline:
Join Date: Jun 2003
Posts: 67
|
background img
How can I have background image for all table cell, but I want to create it CSS, so i dont' have to hard code very time
Thanks in advance
|
|
|
|
07-09-2003, 08:06 AM
|
#2
|
|
Moderator
Parano.ID is
Offline:
Join Date: Jul 2003
Location: Slovenia
Posts: 33
|
Not so hard to do.
If you want ALL the table cells in your page with same backround, you can do it in this way, for example:
td
{
background: url(images/picture.gif);
background-repeat: repeat-y; ----> repeating of image verticaly or hotizontaly, if not defined, picture will not repeat
background-color: #ffffff;
}
And, if you want just some specific table cell to have some other image, you use ID or CLASS selector, like this:
td.specialcell
{
width: 140px;
background: url(images/special.gif);
background-repeat: repeat-y;
background-color: #ffffff;
}
Hope this helps
BGUD
|
|
|
|
07-09-2003, 09:46 AM
|
#3
|
|
Member
FatJoe2 is
Offline:
Join Date: Jun 2003
Posts: 67
|
Hi Parano.ID,
Thank you for your tips
I have a question thou.
If I have .td, then I don't actually call .td class everytime I use td, correct?
But if you have td.specialcell class, then how can I specify a cell that I want to use this class.
Ex. If I have .main class in CSS, so whenever I want to use it, I use class=main, right? I'm not sure how to call td.specialcell
Thanks for your help
|
|
|
|
07-10-2003, 02:05 AM
|
#4
|
|
Moderator
Parano.ID is
Offline:
Join Date: Jul 2003
Location: Slovenia
Posts: 33
|
Hey Joe!
I understand what you think. It is like this.
When you write your (x)html page you use tags, such as BODY, TD, FORM, A, BR, and so on.
So when you are writing a css file, you have to declare to which tag you want to define a display settings.
When you want to declare it for standard html tags ( for example the TD tag ) you just use TD{} ( with no dot in front of it ), if you declare a CLASS to your TD than you use .TD{} and when you declar ID to your tag you use #TD{} in your css.
I have attached a sample.html file in this post for example, it is in xhtml format. File is txt because this board doesn't allow to upload html files, so you just need to change its ending to html.
All you have to know is that if you define style for TD class, all table cells will have same style except you define them a ID or CLASS with different style.
So, in my example we have 3 TD tags, two of them with defined class or id. Well, when I styled a TD class I styled all of the cells in my page ( notice that the blue cell still has red border as I have defined it for all TDs ), then I styled a cell with CLASS="red" with red color and dotted black border, lastly I styled cell with with blue background but didn't defined any border, so it stays red as I defined it for all TD tags.
I know this can be a little confusing as I am not very good teacher
Hope it helps,
BGUD
|
|
|
|
07-10-2003, 04:33 PM
|
#5
|
|
Registered User
NancyS is
Offline:
Join Date: Jun 2003
Location: New York, NY
Posts: 82
|
i probably try that too, you're a CSS guru, Parano.ID!
__________________
NancyS
The Good, The Hot, The Sexy
|
|
|
|
07-11-2003, 02:23 AM
|
#6
|
|
Moderator
Parano.ID is
Offline:
Join Date: Jul 2003
Location: Slovenia
Posts: 33
|
i am still learning all this stuff and i realized that it is best for me and for the web itself if i use xhtml and css from my day one of designing and developing web sites + xml in which i am in love
And yes, i am CSS guru, there is no thing you can't do with it.
And designs created with css+div alone are just much better and good looking than those with inline styles and tables.
if you need any help regarding any of these technologyes ( and other ) feel free to ask, i like to help
BGUD
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
All times are GMT -5. The time now is 12:56 PM. |
|
|
|
Sponsored By: Music Shopping,
Ink Refills, Cruets Gifts,Viagra
Proudly Hosted By: iValueHost, LLC
|