Page 1 of 2
problems migrating to better use of CSS
Posted: Fri Sep 26, 2003 11:01 am
by m3rajk
i had 10 ways i started a table tag. on example:
Code: Select all
$tsw750='<table frame="void" bgcolor="#878787" border="0" cellpadding="0" cellspacing="0" text="#ffffff" width="750">';
it now looks like...
Code: Select all
$tsw750='<table frame="void" border="0" cellpadding="0" cellspacing="0" class="reg" width="750">';
with this CSS:
Code: Select all
/* tables */
table.reg {
background-color:#878787;
color:#ffffff;
}
table.req {
background-color:#FF0000;
color:#ffffff;
}
when i added cell padding (padding:0) it didn't work.
i've looked at w3cschools.com's CSS stuff, but am not sure how to get cell spacing and cell padding into CSS if that's possible. I made the site to conform to html 4.0 since i don't have extensive CSS experience. i'm now trying to move anything that can be moved to CSS to gain experience with that, and to make this more forward compatible since i noticed things like <s></s> and <u></u> are deprecated in html4.01 and unsupported in xhtml 1.0.. i figure by 2.0 <i></i><b></b><sup></sup><sub></sub> aill go the way of align and <center></center> and join the rest in deprecation if not outright removal from valid tag/options. i'm currently moving bolding, italics, etc to <span class="whatever"></span> in the pages.
Posted: Fri Sep 26, 2003 11:10 am
by Nay
btw, nice number of posts, 777
On the other hand, I'm not sure of what you mean. I've used CSS for well over a year now and I think I'm quite experianced.
Anyhow, you're trying to have cell-padding in cells? With CSS, you have to individually add padding:1px or so. td { padding:0px }, is that what you mean? From what I know, you can't set cellspacing with CSS.
But then I could be wrong,
-Nay
Posted: Fri Sep 26, 2003 11:55 am
by Vincent Puglia
Hi,
From what I've gathered, you need to pad the cells rather than the table as a whole.
td.req {
padding: 14px;
}
http://www.allmyfaqs.com/faq.pl?Border_for_table_cells
Vinny
Posted: Fri Sep 26, 2003 12:06 pm
by microthick
And you could probably change cellspacing by using td.reg { margin: 0; }.
Posted: Fri Sep 26, 2003 12:08 pm
by m3rajk
darn. that's one thing i like about html then., the fact you can set it in the table.
if that's not deprecated then i think i'll keep it as is for now...
Posted: Fri Sep 26, 2003 12:30 pm
by Unipus
It's no harder to do it with CSS.
Here's an example of setting the padding for one specific table, named 'table4'.
Code: Select all
<table id="table4">
<tr> ....
</tr>
</table>
<style>
#table4 {
whatever styles
}
#table4 td {
padding: 0px;
}
How hard is that? All cells of table4 will now have 0px padding. It accomplishes the exact same thing with about the same amount of effort and greatly improved scalability.
Posted: Sat Sep 27, 2003 4:17 pm
by m3rajk
true. and the option wont be deprecated...
i know that
Code: Select all
<b></b>
<i></i>
<s></s>
<strike></strike>
<u></u>
are all deprecated in html 4.01 and some are unsupported in xhml 1.0, but since these are basically the same as one or more of those, does anyone have an idea if they are going to be deprecated soon?
Code: Select all
<strong></strong>
<em></em>
<del></del>
Posted: Sat Sep 27, 2003 8:05 pm
by Cruzado_Mainfrm
u can also set a different padding to any side:
padding-top: ?px
padding-bottom: ?px
padding-left: ?px
padding-right: ?px
Posted: Mon Sep 29, 2003 2:51 pm
by Unipus
I believe that ALL code-side markup will be deprecated in future revisions of XHTML.
Posted: Wed Oct 01, 2003 12:32 pm
by m3rajk
Unipus: i asked the same elsewhere and was givent he response that <em> and <strong> are sgml and not html and wont be. but that brings into question, "will xhtml capable browsers allow sgml to be used in xhtml in te future?"
personally it seems logical to me to deprecate those tags i asked about.
Posted: Wed Oct 01, 2003 4:49 pm
by Unipus
Well, I'm not the expert on these things, you might go look in the W3C recs and see what they're saying. My guess is that either way there should continue to be a Transitional doctype that will accept them if you feel the need to use them.
Posted: Thu Oct 02, 2003 5:45 am
by twigletmac
IIRC, all of (X)HTML is SGML, it's just a sub-set of a larger markup language.
http://www.washington.edu/computing/tra ... /tree.html
Tags deprecated in XHTML:
http://webdesign.about.com/library/tags ... edtags.htm
Tags such as <strong> and <em> are more useful than <b> and <i> because they provide information to alternative browsers about the importance of the text instead of just being visual markup tags. I would imagine that they, being structural markup rather that formatting markup, will be around for a bit yet.
Mac
Posted: Thu Oct 02, 2003 1:34 pm
by m3rajk
i've been using the charts from
http://www.w3cschools.com/
less pop ups than about.com
i wanted to get the site up, don't have a great deal of css experience, so decided i'd do it for html 4.0 then once i have the demop site up, while embellisihing it, move to xhtml and take the time to get to know css better since it would be needed. right now i'm going for html 4.01 since i haven't looked much at the id tag yet and still use name quite a bit
Posted: Thu Oct 02, 2003 2:27 pm
by m3rajk
GAH!!!
one problem with that.... tables done seemt o be affected by the rules of the div they are in!
Posted: Thu Oct 02, 2003 2:28 pm
by Unipus
I'm in the same boat you are... about to launch this site, but over the coming months I'll probably migrate it to XHTML transitional (I doubt it could ever make Strict).
I'm not sure what you mean about ID and NAME, though. ID is just a text identifier for any distinct object on your page. Don't start them with numbers and don't put in spaces... other than that, it's pretty obvious. The only time I find NAME useful is, obviously, for forms. Are you using it for something else?