HighDots Forums  

Special Color for Table Element

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Special Color for Table Element in the HTML forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Special Color for Table Element - 10-28-2009 , 10:52 AM






Swifty wrote:
Quote:
dorayme wrote:
In article <hc7rv3$7rm$1 (AT) news (DOT) eternal-september.org>,
"Beauregard T. Shagnasty" <a.nony.mous (AT) example (DOT) invalid> wrote:

CSS is easy, once you are able to wrap your neurons around the concept.

Unlike, say, Quantum Physics.

Yup, that's neutrons.

More like fermion ;-)

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Reply With Quote
  #12  
Old   
AT
 
Posts: n/a

Default Re: Special Color for Table Element - 10-28-2009 , 12:03 PM






9c0b5314494b (AT) j24g2000yqa (DOT) googlegroups.com>, dingbat (AT) codesmiths (DOT) com
says...
Quote:
I wish to apply a color change (style?) to a portion of a table
element. =A0In the following code, I want to have the line:

a href=3D"http://zazoosh.com">** Race photos can be found atwww.ZaZoosh.=
com**</a

be a different color (green) than all the other table elements. =A0

It's not clear precisely what you're after. Tables have rows, rows
have cells, one of your cells has a link in it.

If you want to make the "line" turn green, do you mean the whole row,
or just the link?
I want to make the whole line turn green, so that it stands out from
the more normal lines (which are links, too). This line/link is a new
feature that's being presented, and I wanted to draw attention to it.

Quote:
Let's assume that you mean rows. Neatly you could do this:

tr class=3D"my-highlight-thingy"

and somewhere else in the CSS stylesheet (one place, top of the page)

.my-highlight-thingy {
background-color: lightgreen;
color: black;
}

Now you might not be able to modify the CSS already in use on the
page, or to add any additional CSS stylesheet in the <head> of the
page. In that case, you can place the CSS properties inside the HTML
like this:

tr class=3D"my-highlight-thingy" style=3D"background-color: lightgreen;"

If OTOH, you want to change the link's colour but not the whole row,
then use a more specific selector in the CSS like this:

tr class=3D"my-highlight-thingy"

.my-highlight-thingy a {
background-color: lightgreen;
}

I'd still recommend placing the class on the <tr>, if that's the scope
of what the highlight selection applies to - even if you only want the
link to change colour. If you're stuck without access to the CSS (as
above), then you'd need to modify the HTML like this:
I want the special color to apply only to the 2nd "line" (that which
follows the <br> element), so that it's distinct from the physical line
above it.
Thanks for your help.

Reply With Quote
  #13  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Special Color for Table Element - 10-28-2009 , 01:05 PM



Mike Copeland wrote:

Quote:
I want the special color to apply only to the 2nd "line" (that which
follows the <br> element), so that it's distinct from the physical line
above it.
Thanks for your help.

a.i_am_special { background-color: lightgreen; color: black; }


....
<a class="i_am_special" href="http://zazoosh.com">** Race photos can be
found at www.ZaZoosh.com **</a>
....


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Reply With Quote
  #14  
Old   
Andy Dingley
 
Posts: n/a

Default Re: Special Color for Table Element - 10-28-2009 , 02:20 PM



On 28 Oct, 16:03, mrc2... (AT) cox (DOT) net (Mike Copeland) wrote:

Quote:
* *I want the special color to apply only to the 2nd "line" (that which
follows the <br> element), so that it's distinct from the physical line
above it.
Then as Jonathan has suggested, you'll need to put some class on the
relevant <a> alone (and not the 1st one).

Personally I'd suggest two changes to that:

Add class names to the relevant <tr> and also to all of the second
<a> Then use a selector in the CSS that requires both, such as
..special-row .second-link { color: puce; }

Secondly I'd lose the <br> in favour of wrapping both <a> inside the
<td> in their own <div>s These are "block elements", whilst <br> is
a linebreak in an inline (i.e. non-block) context. If you're playing
with background colours, you'll find this way a lot easier to control
the widths of things.

<td>
<div ><a href="..." >Stuff</a></div>
<div class="second-link" ><a href="..." >Stuff</a></div>
</td>

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.