Solid line - need to start 15px in

T

tshad

I have the following style that puts a solid line on the top of the cell.

style="border-right-width: 1; border-top-width: 1; border-bottom-width: 1;
border-top-style:solid"

The text is actually 15px in from the cells left border:

<p style="margin-left: 15px">

Is there a way to have the line start 15px in also?

It's not a big deal, it just kind of hangs over the edge and it would be
nice to have it line up with the text.

Thanks,

Tom
 
S

Sid Ismail

On Wed, 18 May 2005 19:15:33 GMT, "tshad"

: I have the following style that puts a solid line on the top of the cell.
:
: style="border-right-width: 1; border-top-width: 1; border-bottom-width: 1;
: border-top-style:solid"
:
: The text is actually 15px in from the cells left border:
:
: <p style="margin-left: 15px">
:
: Is there a way to have the line start 15px in also?
:
: It's not a big deal, it just kind of hangs over the edge and it would be
: nice to have it line up with the text.


Hi

1. style="border-right-width: 1; qualify the "1" px, em, ?

2. seems you want a margin then - that is easy to do.

Post a URL - much easier to understand your exact problem.

Sid
 
T

tshad

Sid Ismail said:
On Wed, 18 May 2005 19:15:33 GMT, "tshad"

: I have the following style that puts a solid line on the top of the
cell.
:
: style="border-right-width: 1; border-top-width: 1; border-bottom-width:
1;
: border-top-style:solid"
:
: The text is actually 15px in from the cells left border:
:
: <p style="margin-left: 15px">
:
: Is there a way to have the line start 15px in also?
:
: It's not a big deal, it just kind of hangs over the edge and it would be
: nice to have it line up with the text.


Hi

1. style="border-right-width: 1; qualify the "1" px, em, ?

2. seems you want a margin then - that is easy to do.

Post a URL - much easier to understand your exact problem.

Ok,

http://www.payrollworkshop.com/Samples/testborder.htm

I wanted the line to be 15px in just like the text.

Also, the cells top and bottom space in Mozilla are real large. Why not in
IE?

Tom
 
N

Noozer

tshad said:
I have the following style that puts a solid line on the top of the cell.

style="border-right-width: 1; border-top-width: 1; border-bottom-width: 1;
border-top-style:solid"

The text is actually 15px in from the cells left border:

<p style="margin-left: 15px">

Is there a way to have the line start 15px in also?

It's not a big deal, it just kind of hangs over the edge and it would be
nice to have it line up with the text.

style = "border:none; border-top: solid 1px black;margin:15px;padding 0;"

???

Of course IE and Mozilla treat padding and margins differently. Also the
above is from memory so may not work at all.
 
T

tshad

Noozer said:
style = "border:none; border-top: solid 1px black;margin:15px;padding 0;"

???

Of course IE and Mozilla treat padding and margins differently. Also the
above is from memory so may not work at all.

It didn't - in either browser.

Thanks,

Tom
 
M

Mark Parnell

Previously in alt.html said:
I have the following style that puts a solid line on the top of the cell.
<p style="margin-left: 15px">

Is there a way to have the line start 15px in also?

Put the border on the paragraph instead of the table cell.
 
T

tshad

Mark Parnell said:
Put the border on the paragraph instead of the table cell.

That worked great.

It also shows the where the extra space is coming from. Apparently,
Mozilla is putting space between the paragraph border and the cell border.
IE doesn't.

Why is that?

Thanks,

Tom
 
M

Mark Parnell

Previously in alt.html said:
It also shows the where the extra space is coming from. Apparently,
Mozilla is putting space between the paragraph border and the cell border.
IE doesn't.

Mozilla has a default margin-top and margin-bottom of 1em on paragraphs.
Apparently IE doesn't (at least, not in table cells).

Because different browsers have different defaults for margin and
padding (none are wrong, they are just different), I generally recommend
setting all margins and padding to 0: * {margin: 0; padding: 0;} - then
set it on individual elements as required.
 
T

tshad

Mark Parnell said:
Mozilla has a default margin-top and margin-bottom of 1em on paragraphs.
Apparently IE doesn't (at least, not in table cells).

Because different browsers have different defaults for margin and
padding (none are wrong, they are just different), I generally recommend
setting all margins and padding to 0: * {margin: 0; padding: 0;} - then
set it on individual elements as required.

I tried it. I put it on the <table>, the <td> and the <p> and it still has
the extra space around the words in Mozilla - as you can see in the example.

<table width="200" style="padding:0;margins:0;" border="1" cellspacing="0"
cellpadding="0">
<tr>
<td style=" padding:0;margins:0;width:100px;border-right-width: 1px;
border-top-width:5px; border-bottom-width: 1px; border-top-style:solid; ">
<p style="padding:0;margins:0;margin-left:15px;
border-top-style:solid;border-top-width:5px;
border-bottom-style:solid;border-bottom-width:5px">test line

Tom
 
T

tshad

Mark Parnell said:
It's margin, not margins. Good reason to validate. :)

You're right. As a matter a fact DW put a warning there and I didn't see
it.

Works much better now, as you can see.

I do disagree with you on one issue:
Because different browsers have different defaults for margin and
padding (none are wrong, they are just different), I generally recommend
setting all margins and padding to 0: * {margin: 0; padding: 0;} - then
set it on individual elements as required.

I think it is wrong. This is the kind of thing that makes it more difficult
that it has to be. This is why there are standards. I would think that
defaults should be standard or what is the point in having them. That means
you cannot use them, as we just demonstrated. This would have looked
completely different in Mozilla had I used paragraphs all over the place and
used the defaults. If I used IE and spend days putting together a nice page
and then tested it on Mozilla, I would be spending a ton of time trying to
find out what was different on Mozilla. This isn't the only thing. And
with the next release I'm sure there would be other things.

Thanks,

Tom
 
M

Mark Parnell

Previously in alt.html said:
I think it is wrong. This is the kind of thing that makes it more difficult
that it has to be.

I'm assuming you're disagreeing with my comment about them not being
wrong, rather than my suggestion how to overcome those differences.
This is why there are standards. I would think that
defaults should be standard or what is the point in having them.

The specifications do define default values for some properties, but
only ones that apply globally - not how they apply to specific elements,
because CSS and HTML are completely separate. And CSS doesn't have to be
used with HTML - in theory it could be used with any markup language. In
the case of margin/padding, it would be unrealistic to set a default
value, as it would look stupid if every element had the same margin and
padding.
That means
you cannot use them, as we just demonstrated.

You can, you just need to be aware of the issues involved. It really
isn't that much more work to set up a default stylesheet with the
margins and padding you want on each element. Use that as your base for
each site you do, and you only have to set it up once.
If I used IE and spend days putting together a nice page
and then tested it on Mozilla, I would be spending a ton of time trying to
find out what was different on Mozilla.

Do that the other way around and you'll be much better off anyway. :)
 
T

tshad

Mark Parnell said:
I'm assuming you're disagreeing with my comment about them not being
wrong, rather than my suggestion how to overcome those differences.

Yes.

We always have to find a way to overcome their differences.
The specifications do define default values for some properties, but
only ones that apply globally - not how they apply to specific elements,
because CSS and HTML are completely separate. And CSS doesn't have to be
used with HTML - in theory it could be used with any markup language. In
the case of margin/padding, it would be unrealistic to set a default
value, as it would look stupid if every element had the same margin and
padding.

I don't agree there.

As you said, IE and Mozilla have different defaults. The problem is not
whether you set defaults for different objects the same or not. But if
there are defaults, they must be the same from browser to browser or they
are worthless (in other words never use defaults, ever).

This problem was a good example.

Obviously, IE has a different default (as you say) then Mozilla. There is
no reason that the default shouldn't be the same for both browsers. As you
say, set the margins and padding to 0. So you are saying what I just said.
The defaults are worthless. If you can't depend on them, you can't use
them.

My problem is with the Browser manufacturers. They must know what the
others are doing, so why do they do it differently. NIH.
You can, you just need to be aware of the issues involved. It really
isn't that much more work to set up a default stylesheet with the
margins and padding you want on each element. Use that as your base for
each site you do, and you only have to set it up once.

As I said, you can't unless you don't care that one browser will show it
differently than the next one.

I agree you can set up your own defaults. My statement was that you can't
use the browsers default.
Do that the other way around and you'll be much better off anyway. :)

Not the case. I do use Mozilla for my main testing. Then I find that IE
doesn't handle it the same and I need to go in and figure out what is
causing the differences and find a way to deal with the problem. Something
the Doctype has to be changed, other times it's something else.

Tom
 
T

Toby Inkster

tshad said:
Obviously, IE has a different default (as you say) then Mozilla. There is
no reason that the default shouldn't be the same for both browsers.

Different defaults is a Good Thing.

IE, for example, has a default background colour for the BODY element of
white. In Netscape 4.x and below, the default is #999 (grey). In Dillo,
it's #D6D6C0 (greyish brown).

Default background colour is just another feature that browsers can and
should compete over.
 
T

tshad

Toby Inkster said:
Different defaults is a Good Thing.

IE, for example, has a default background colour for the BODY element of
white. In Netscape 4.x and below, the default is #999 (grey). In Dillo,
it's #D6D6C0 (greyish brown).

Default background colour is just another feature that browsers can and
should compete over.

And why is that a good thing???

If I have elements that are close a grey, because it looks good in IE, then
it may be washed out in Netscape.

I think there are things you should be able to depend on, and if defaults
can be anything - then they are useless as defaults.

IMHO.

I don't want to spend my time trying to memorize all the possible defaults
for each browser and each version. Much of the time I spend trying to find
problems, is because this browser handles this or that object differently
than another browser or their defaults are different - as was the current
case.

Years ago they tried to standardize Unix and never could because none of the
makers of the different versions wanted to give up their extensions. "We
will not deal with anything this is NIH" ! One of the reasons many people
liked Windows over Mac.

One of the nice things about the GUI interface is it gave you a consistant
look and feel. What was nice about the Mac was that you could go from
program to problem and the GUI was the same no matter what the program was.
And Windows has done the same, for the most part.

Then we get into this neat new interface that allows you to be OS free and
allows you to build access to your data and programs without having to worry
about the GUI. But to change basic functionalities and defaults, just to be
different, defeats that whole advantage.

Everyone is trying to get applications off the desktop and onto an
interface. That is fine. But it isn't if you can't depend on the
interface. If I build an application that has to be moved from machine to
machine, that is a hassle, but at least I know what the Screen (interface)
is going to look like.

Again IMHO.
 
J

Joel Shepherd

Hmm. :) Boy, in all the "Which is the Better Browser" discussions I've
seen, that particular feature has never come up. But anyway ...
And why is that a good thing???

If I have elements that are close a grey, because it looks good in IE, then
it may be washed out in Netscape.

Well, it sounds like you're assuming that all browsers will use the same
background color, which simply isn't a safe assumption. Not just because
different browsers have different out-of-the-box defaults, but also
because users can change those defaults.

In general, if you're planning on setting the color of some element that
is going to be sitting on a background, it's wise to specify a
background color as well, to avoid problems just like the one you
mention.
I think there are things you should be able to depend on, and if defaults
can be anything - then they are useless as defaults.

Well, it would be nice to be able to depend on browsers sticking to the
specs. But A) Specific default colors aren't part of any spec that I'm
familiar with, and B) Since users can usually change the defaults in
their own installation, they can't be depended on anyway.
Everyone is trying to get applications off the desktop and onto an
interface. That is fine. But it isn't if you can't depend on the
interface. If I build an application that has to be moved from machine to
machine, that is a hassle, but at least I know what the Screen (interface)
is going to look like.

Are you sure about that? Most operating system's GUIs -- including
Windows -- give the user a lot of flexibility to specify the color of
various elements, change font size, change thickness of borders, etc.
You're liable to run into the same problem if you don't take care to
specify foreground _and_ background colors when the defaults -- whatever
they are -- aren't being used.
 
T

Toby Inkster

tshad said:
And why is that a good thing???

Because through experimentation *within* the standards, browsers are able
to evolve. If it weren't through experimentation and browsers trying to
offer different things, we'd still be using browsers very much like Mosaic
1.0.
One of the nice things about the GUI interface is it gave you a
consistant look and feel.

If you like consistant look and feels so much, what are you doing writing
CSS at all? Just use plain, semantic HTML and let the browser's default
style shine through.
If I have elements that are close a grey, because it looks good in IE,
then it may be washed out in Netscape.

So whenever you set a colour, set the background too. It's a simple rule
to remember. Whenever the amount of gap between two elements is important,
remember to set the margin, border and padding on both. Easy.
 
T

tshad

Joel Shepherd said:
Hmm. :) Boy, in all the "Which is the Better Browser" discussions I've
seen, that particular feature has never come up. But anyway ...


Well, it sounds like you're assuming that all browsers will use the same
background color, which simply isn't a safe assumption. Not just because
different browsers have different out-of-the-box defaults, but also
because users can change those defaults.

You are missing my point.

I never said not to give users flexibility, but not everything and not every
default. Even Windows, which does let you change themes and color styles,
controls what you are allowed to change. You can have all the wierd color
combinations you want, but they are only going to affect certain objects,
not everything.

If a user changes defaults such as color, that is his business and if it
makes the pages look strange that's fine and his choice.

But the out of the box defaults for things such as how tables are handled,
how objects are placed in relation to each other, how much margin or
padding, etc - should be something you can rely on. Otherwise, they are
worthless. What is the point of making paragraph margin defaults different.
There are certain aspects of any object or style that you have to depend on.
Even in CSS styles - you have to depend on the behavior of the styles or
they are worthless. What is the point of saying "vertical-align:top" and
have one browser say that they will align it on the bottom. That makes no
sense.
In general, if you're planning on setting the color of some element that
is going to be sitting on a background, it's wise to specify a
background color as well, to avoid problems just like the one you
mention.

Agreed.


Well, it would be nice to be able to depend on browsers sticking to the
specs. But A) Specific default colors aren't part of any spec that I'm
familiar with, and B) Since users can usually change the defaults in
their own installation, they can't be depended on anyway.

But they can't change the default of everything.

And I wasn't the one that mentioned background color which is not the type
of behavior I was talking about. I am not trying to say that we should not
have flexibility and creativity. But you can't have it in everything or you
have chaos.
Are you sure about that? Most operating system's GUIs -- including
Windows -- give the user a lot of flexibility to specify the color of
various elements, change font size, change thickness of borders, etc.
You're liable to run into the same problem if you don't take care to
specify foreground _and_ background colors when the defaults -- whatever
they are -- aren't being used.

Again, I am not talking about not giving users flexibility. But look at
what MS allows you to change. You can change the appearance of your screen
(color tints, Font size) and even styles of windows - but then everything
will work the same under those conditions. You can't make your own windows
styles (only the 2 that Windows gives you) or affect how the "Save As" menu
item works, for example.

Tom
 
T

tshad

Toby Inkster said:
Because through experimentation *within* the standards, browsers are able
to evolve. If it weren't through experimentation and browsers trying to
offer different things, we'd still be using browsers very much like Mosaic
1.0.

Right, but as you say, "within standards".
If you like consistant look and feels so much, what are you doing writing
CSS at all? Just use plain, semantic HTML and let the browser's default
style shine through.


So whenever you set a colour, set the background too. It's a simple rule
to remember. Whenever the amount of gap between two elements is important,
remember to set the margin, border and padding on both. Easy.

Missing my point. I agree that you should set these.

My point was that defaults are worthless (and I am not talking about user
defaults - but basic standards - how tables, blocks, text, paragraphs
behave - which you can override by setting the attributes.) if there is no
standards for the defaults.

The great thing about standards is that there are so many of them :)

Tom
 
K

kchayka

tshad said:
But the out of the box defaults for things such as how tables are handled,
how objects are placed in relation to each other, how much margin or
padding, etc - should be something you can rely on. Otherwise, they are
worthless. What is the point of making paragraph margin defaults different.

So are defaults for these kinds of things all handled the same between
different word processors or other applications? I would guess not.
What is the point of saying "vertical-align:top" and
have one browser say that they will align it on the bottom. That makes no
sense.

That's also not something up to browser interpretation, but a spec that
is either followed correctly, or not. If the browser does align at
bottom, then it is badly broken.

Under normal circumstances, the default margin and padding values on
different elements is insignificant. Who cares whether something is 3px
in one browser and 5px in another? Usually, just control freaks. ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top