The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Border where no border should be, Cells have borders where CSS indicates should not.
Brian Read
post Aug 7 2012, 08:37 AM
Post #1





Group: Members
Posts: 7
Joined: 23-February 12
Member No.: 16,556



If you look at:

http://www.safety-lifting.co.uk/InspectDB/index.php

You can see that the 2 cells on the blue area across the bottom of the page have left and right black borders, the border seems to be associated with the:

<table id="BG_1330950890478_19083" width="100%" >

according to firebug,

however the CSS associated with it has:

#BG_1330950890478_19083 {
background-color: #14114e;
margin:0;
table,tr,td {
border:0;
}
}

Any ideas?


Cheers Brian

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Aug 7 2012, 09:02 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



You have set a border for th, td in your CSS.

BTW, did you notice that the "HLS leigh logo.png" (don't use spaces in file names) spills out of the table? Caused by the height="45%" in the IMG tag. Change that to "auto" and it fits and looks better (not stretched).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Read
post Aug 7 2012, 10:30 AM
Post #3





Group: Members
Posts: 7
Joined: 23-February 12
Member No.: 16,556



QUOTE(Frederiek @ Aug 7 2012, 03:02 PM) *

You have set a border for th, td in your CSS.


yes, I sort of guessed that, but I can't see where it is...and why the CSS I quoted you does not override it.

QUOTE

BTW, did you notice that the "HLS leigh logo.png" (don't use spaces in file names) spills out of the table? Caused by the height="45%" in the IMG tag. Change that to "auto" and it fits and looks better (not stretched).


aha - yes, many thanks. As the two logo's images are not the same size, I have to reduce one of them, however I have now used the same size on the height ahd width (I'd changed one, but not the other). I'e also renamed the files with spaces in - I presume there are some browsers that do not like that?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 7 2012, 01:20 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



QUOTE(Brian Read @ Aug 7 2012, 03:37 PM) *



CODE
#BG_1330950890478_19083 {
  background-color: #14114e;
  margin:0;
  table,tr,td {
  border:0;
  }
}




You can't nest CSS rules. I don't know if you mean.

CODE
#BG_1330950890478_19083 {
  background-color: #14114e;
  margin:0; }

  table,tr,td {  border:0; }



or



CODE
#BG_1330950890478_19083 {
  background-color: #14114e;
  margin:0; }

#BG_1330950890478_19083 table,
#BG_1330950890478_19083 tr,
#BG_1330950890478_19083 td
  {  border:0; }


They mean very different things. Or they should. In this case both examples would remove borders from all cells and tables, if the second version works at all, that is. You use the id 'BG_1330950890478_19083' twice. You also use it with BODY, so everything on the page is contained in an element with that id. As said above, you have done this with other IDs too. You need to clean that up. An id is supposed to be unique for a page, you can use it once and once only on the same page.

This is one of the reasons why meaningful id and class names are a good idea. Makes easer to spot mistakes with your bare eyes. wink.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Read
post Aug 7 2012, 01:28 PM
Post #5





Group: Members
Posts: 7
Joined: 23-February 12
Member No.: 16,556



QUOTE(pandy @ Aug 7 2012, 07:20 PM) *


CODE
#BG_1330950890478_19083 {
  background-color: #14114e;
  margin:0; }

#BG_1330950890478_19083 table,
#BG_1330950890478_19083 tr,
#BG_1330950890478_19083 td
  {  border:0; }




That's what I wanted, I'd misunderstood the CSS syntax. Tried it and it works. I take your points about the names etc, in my (slight) defense, the php includes an amalgamation of at least 2 other "packages" each of which uses CSS to format its own html, plus the fact that I generated the initial html from a template which overloaded a lot of CSS that subsequently is not used.

I appreciate your comments, many thanks.

Cheers

Brian
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 7 2012, 02:15 PM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Remove that id from BODY or it may not work in all browsers or work in a way you don't expect.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 30th March 2024 - 02:01 AM