469,330 Members | 1,373 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

DIV and BGCOLOR

Am I confused ot shouldn't I be able to say something like this:
<div bgcolor="#CCCCFF">
.....
</div>
And have that section of my page/table be a light blue background?

Tried it inside the HTML as well as in a style sheet, and nothing.

Thanks ahead
Sep 22 '08 #1
10 51130
"Daniel Kaplan" <No****@NoSpam.comwrote in message
news:12***************@nntp.acecape.com...
<div bgcolor="#CCCCFF">
....
</div>
I meant to say that if the DIV is inside a table it won't work....if it's
outside the table, then it does...Surely there must be a way to use div to
change just a piece or portion of a table?
Sep 22 '08 #2
In article <12***************@nntp.acecape.com>,
"Daniel Kaplan" <No****@NoSpam.comwrote:
Am I confused ot shouldn't I be able to say something like this:
<div bgcolor="#CCCCFF">
....
</div>
And have that section of my page/table be a light blue background?

Tried it inside the HTML as well as in a style sheet, and nothing.
<http://dorayme.890m.com/alt/kaplan.html>

--
dorayme
Sep 23 '08 #3
Daniel Kaplan wrote:
Am I confused ot shouldn't I be able to say something like this:
<div bgcolor="#CCCCFF">
....
</div>
And have that section of my page/table be a light blue background?

Tried it inside the HTML as well as in a style sheet, and nothing.
Use CSS instead to style your page.
Sep 23 '08 #4

"dorayme" <do************@optusnet.com.auwrote in message
news:doraymeRidThis-
>
<http://dorayme.890m.com/alt/kaplan.html>
But how about within a part of a table? Like spanning multiple rows and or
cells, while keeping the rest of the table alone. Is that possible? Cause
I can't do that. I can move the DIV tags to the front and end of the table
and get the entire table, but not pieces.

Please tell me it's possible.

Thanks regardless...
Sep 23 '08 #5
In article <12***************@nntp.acecape.com>,
"Daniel Kaplan" <No****@NoSpam.comwrote:
"dorayme" <do************@optusnet.com.auwrote in message
news:doraymeRidThis-

<http://dorayme.890m.com/alt/kaplan.html>
But how about within a part of a table? Like spanning multiple rows and or
cells, while keeping the rest of the table alone. Is that possible? Cause
I can't do that. I can move the DIV tags to the front and end of the table
and get the entire table, but not pieces.

Please tell me it's possible.
Hand on my central CPU, yes:

<http://dorayme.890m.com/alt/kaplan2.html>

--
dorayme
Sep 23 '08 #6
"dorayme" <do************@optusnet.com.auwrote in message
news:do**********************************@web.aioe .org...
In article <12***************@nntp.acecape.com>,
"Daniel Kaplan" <No****@NoSpam.comwrote:
>"dorayme" <do************@optusnet.com.auwrote in message
news:doraymeRidThis-
>
Please tell me it's possible.

Hand on my central CPU, yes:

<http://dorayme.890m.com/alt/kaplan2.html>
I feel terrible clarifying some more...and by the way thanks for going to
the trouble of actually making samples to show me, BUT....I wanted to do it
as background color, so you wouldn't see the cell lines.....Is THAT
possible??
Sep 23 '08 #7
In article <12***************@nntp.acecape.com>,
"Daniel Kaplan" <No****@NoSpam.comwrote:
"dorayme" <do************@optusnet.com.auwrote in message
news:do**********************************@web.aioe .org...
In article <12***************@nntp.acecape.com>,
"Daniel Kaplan" <No****@NoSpam.comwrote:
"dorayme" <do************@optusnet.com.auwrote in message
news:doraymeRidThis-

Please tell me it's possible.
Hand on my central CPU, yes:

<http://dorayme.890m.com/alt/kaplan2.html>

I feel terrible clarifying some more...and by the way thanks for going to
the trouble of actually making samples to show me, BUT....I wanted to do it
as background color, so you wouldn't see the cell lines.....Is THAT
possible??
Yes, certainly. You just have to change the border from my 1px to 0.

td {border: 0;} or just leave out a border instruction altogether in
many cases.

Time to read about CSS and HTML. I suggest

http://htmldog.com/guides/htmlbeginner/

but always just use a 4.01 HTML doctype for now.

--
dorayme
Sep 23 '08 #8
"dorayme" <do************@optusnet.com.auwrote in message
news:do**********************************@web.aioe .org...
Yes, certainly. You just have to change the border from my 1px to 0.

td {border: 0;} or just leave out a border instruction altogether in
many cases.

Time to read about CSS and HTML. I suggest

http://htmldog.com/guides/htmlbeginner/

but always just use a 4.01 HTML doctype for now.

I got it now, so thanks. But strange it didn't work before. I am wondering
wether it is related to the "border-collapse" property which up till now I
was not aware of?????

Thanks for your help so much.
Sep 23 '08 #9
On 2008-09-22, Daniel Kaplan <No****@NoSpam.comwrote:
"Daniel Kaplan" <No****@NoSpam.comwrote in message
news:12***************@nntp.acecape.com...
><div bgcolor="#CCCCFF">
....
</div>

I meant to say that if the DIV is inside a table it won't work....if it's
outside the table, then it does...Surely there must be a way to use div to
change just a piece or portion of a table?
No. You can use div inside a table cell or outside the whole table. If
you want to apply styles to portions of the table, use CSS selectors.

This kind of thing:

<table>
<div>
<tr>

is invalid (and not in a way you get away with).
Sep 23 '08 #10
Daniel Kaplan wrote:
Am I confused
Yes you are. But admittedly you gave a clue of it in your forged From field.
ot shouldn't I be able to say something like this:
<div bgcolor="#CCCCFF">
Well, what prevents you from breaking HTML rules? Maybe some browser
actually implements such nonstandard constructs, and you end up with setting
background color without setting content color.
And have that section of my page/table be a light blue background?
If it's a section, you should have something like

<div class="section ads">
...
</div>

and the specific rendering suggestions should appear in CSS, not in HTML.
This means that you are more or less in a wrong group. HTMLwise, we can just
say that your markup (in your HTML snippet) is invalid and all bets are off.
Tried it inside the HTML as well as in a style sheet, and nothing.
You gave no URL of your best attempt, so yes, you are confused.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Sep 23 '08 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Tim Johnson | last post: by
15 posts views Thread by @sh | last post: by
3 posts views Thread by Peter Merwood | last post: by
6 posts views Thread by acord | last post: by
12 posts views Thread by GaryDean | last post: by
4 posts views Thread by Don Lancaster | last post: by
5 posts views Thread by Don Lancaster | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.