Solved

How to add background color to a specific area

Posted on 2008-10-06
10
170 Views
Last Modified: 2012-05-05
Greetings,

I am new to html and I need to add background color (lime green) to the box below.  I believe this would be the code as it stands now:

      <tr>
        <td colspan="2" style="border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid; border-bottom: gray thin solid; padding-bottom: 15px; padding-top: 15px;">
           $TEXT</td>
      </tr>
      <tr style="background-color:#BBBBBB; height:1px;">

Would I replace the  :#BBBBBB  with  #00FF00  or does this color apply to something else?

Thanks


text-box.JPG
0
Comment
Question by:John500
  • 5
  • 4
10 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 22650864
>>Would I replace the  :#BBBBBB  with  #00FF00  or does this color apply to something else?
Yes.

It applies to the background of the row.
0
 
LVL 82

Expert Comment

by:hielo
ID: 22650881
BTW:
#00FF00 is green.

limegreen is more like:
#32cd32
0
 

Author Comment

by:John500
ID: 22650888
I just tried it and the only thing that gets colored is the bottom line.  The line is still grey but behind the line is green.

How would the whole box get the color?

Thanks
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

Author Comment

by:John500
ID: 22650910
Actually I'd like to try two ways:

1)  change the $TEXT color to lime green
2)  change background color of the box lime green
0
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
ID: 22650913
you need to apply:
style="background-color:#BBBBBB; height:1px;"

to the  that contains the text you want colored:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd"> 
<html>
<head>
<title></title>
</head>
<body>
<table summary=""> 
 <tr style="background-color:#32cd32;">
        <td colspan="2" style="border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid; border-bottom: gray thin solid; padding-bottom: 15px; padding-top: 15px;">
           $TEXT
	   </td>
  </tr>
</table>
</body>
</html>

Open in new window

0
 
LVL 82

Expert Comment

by:hielo
ID: 22650928
change the background => style="background-color:#32cd32;"

change the text color => style="color:#32cd32;"
0
 

Expert Comment

by:TunaMaxx
ID: 22650943
The way you have it, the green background would start in the NEXT table row (<TR>) element, and then that row would only be 1 pixel tall.

Just replace your FIRST <TR> in your provided code with your LAST <TR> statement, and ditch the 'height: 1px;' like this:

 
<tr style="background-color:#BBBBBB;>
    <td colspan="2" style="border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid; border-bottom: gray thin solid; padding-bottom: 15px; padding-top: 15px;">$TEXT</td>
</tr>
<tr style="background-color:#BBBBBB; height:1px;">

Open in new window

0
 

Author Comment

by:John500
ID: 22651049
Ok, and finally - if I were to test these options statically would I just remove the $TEXT and replace it with something within quotes - or what?

Thanks!
0
 
LVL 82

Expert Comment

by:hielo
ID: 22651079
just replace $TEXT with the content. Quotes are not necessary:

 <tr style="background-color:#32cd32;">
        <td colspan="2" style="border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid; border-bottom: gray thin solid; padding-bottom: 15px; padding-top: 15px;">
           Hello there
         </td>
  </tr>

Open in new window

0
 

Author Closing Comment

by:John500
ID: 31503453
Thank you sir ....
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question