Forum Moderators: martinibuster

Message Too Old, No Replies

HTML <table> Question ref Google's Ads

         

peterinwa

7:32 am on Jun 28, 2004 (gmt 0)

10+ Year Member



How does Google get that very fine 1 or 2 pixel border around their ads? Everything I try gets me something at least twice as wide.

Thanks, Peter

annej

12:17 am on Jun 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does border="1" make it too fat? I haven't done tables for a while.

To learn to make some really nice looking stuff including adsense like boxes go to the Webmaster World CSS forum and start learning CSS. Here is what I have in my style sheet for a nice thin border.

border-color: #CC9966; (or any color you want)
border-style: solid;
border-width: 1px;

fidibidabah

1:35 am on Jun 29, 2004 (gmt 0)

10+ Year Member



Or the slightly more correct:

border: 1px solid #CC9966;

;-)

annej

2:00 am on Jun 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



so finely concise :)

peterinwa

2:38 am on Jun 29, 2004 (gmt 0)

10+ Year Member



What's not so obvious to me is where you put that.

I use classes in <td.

I guess that would go like this?

<table class='1pxborder'>

Thanks

Daemon

7:24 am on Jun 29, 2004 (gmt 0)

10+ Year Member



What's not so obvious to me is where you put that.
I use classes in <td.

I guess that would go like this?

<table class='1pxborder'>

Thanks

Dont forget:

.1pxborder {border: 1px solid #CC9966;}

in the .css file or in the <style> tag!

SuzyUK

8:22 am on Jun 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



CSS table borders are more controllable than HTML table borders

<table class="1pxborder">....
<td class="1pxborder">...

the table border will put a border around the whole table only and the td border will put a border around each individual cell. You can put the class on either or both as required

(The HTML border="1" will do both, that's why it's thicker and you can't change it)

also in your CSS if you add
table {
border-collapse: collapse;
border: 1px solid #c96;
}

td {border: 1px solid #c96;}

this should mean that when 2 x cell borders meet they will collapse into a single pixel (note that the collapse rule should be applied to the table even if you decide only to go with a td border)

Suzy

Sunflux

10:47 pm on Jun 29, 2004 (gmt 0)

10+ Year Member



Standard HTML code can be used for most down-to-the-pixel table controls.

However, unless you specify a border color, the border will have that stupid 3D effect which makes it thicker than you specify. CELLSPACING and CELLPADDING controls are also useful for creating interesting, precise spacing effects.