Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

bgcolor not working for a table in Netscape and Firefox but ok in IE and Safari -

Hi there
not sure if this is an HTML issue or CSS but some browsers are showing the bgcolor and others not
 http://www.mariafalconer.co.uk/index.html

cheers
Maria
0
abraxar
Asked:
abraxar
  • 3
  • 2
1 Solution
 
Mark StegglesWeb DeveloperCommented:
Greetings Maria,

My first guess is that it is because bgcolor is deprecated... you should be using background-color

Regards
0
 
abraxarAuthor Commented:
thanks that sounds good, I've had a quick look but am not sure of the best way to use that for a table and on some of the pages just for a table row. If I use the stylesheet to define the table then all the tables will change color, but I only want one to change.
sorry if my questions are very basic!
Maria
0
 
Mark StegglesWeb DeveloperCommented:
You need to use style,

either inline
<table style="background-color:#336699"> or in your row <tr style="background-color:#336699">

or in the <head> of each page
<head>
<style type="text/css">
#myTable {
background-color:#336699
}
</style>
</head>
<body>
<table id="myTable">etc</table>
</body>

or in your stylesheet

#myTable {
background-color:#336699
}

where you give id="myTable" to the table in question. You can use the same method for a row or any element on the page. ID's are unique though. If you want to target more than one tag on the same page, you should use class. <table class="myTable"> and .myTable {style} in the stylesheet or head.

Hope this helps
Mark
0
 
Mark StegglesWeb DeveloperCommented:
oops i forgot to close the styles:

 {
background-color:#336699;
}                                        ^     always close with ;  
0
 
abraxarAuthor Commented:
that's great- all done! Many thanks
Maria
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now