HighDots Forums  

Margin and Padding Properties

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Margin and Padding Properties in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Toronto Web Designer
 
Posts: n/a

Default Margin and Padding Properties - 07-16-2004 , 01:49 PM






I'm having trouble with the padding and margin properties. IE tends to be
happier with the padding and Netscape with the margin property.

So I tried this:

<link href="netscape-styles.css" rel="stylesheet" type="text/css">

<style type="text/css">
@import url(ie-styles.css);
</style>

But it doesn't work. It actually makes both browsers display things the
same but it's still wrong. Any thoughts?



Reply With Quote
  #2  
Old   
Roderik
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-16-2004 , 10:01 PM






Toronto Web Designer wrote:
Quote:
I'm having trouble with the padding and margin properties. IE tends to be
happier with the padding and Netscape with the margin property.

So I tried this:

link href="netscape-styles.css" rel="stylesheet" type="text/css"

style type="text/css"
@import url(ie-styles.css);
/style

But it doesn't work. It actually makes both browsers display things the
same but it's still wrong. Any thoughts?


@import works in both browsers. Only NN4 (but that is an old one, won't
import this). You'd better post your page with the question concerning
the padding/margin in case of using such a work around.

--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica


Reply With Quote
  #3  
Old   
Steve Pugh
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-17-2004 , 08:10 AM



"Toronto Web Designer" <torontowebdesigner (AT) yahoo (DOT) ca.invalid> wrote:

Quote:
I'm having trouble with the padding and margin properties. IE tends to be
happier with the padding and Netscape with the margin property.
Which versions of IE and Netscape? What are your exact problems?

Quote:
So I tried this:

link href="netscape-styles.css" rel="stylesheet" type="text/css"

style type="text/css"
@import url(ie-styles.css);
/style

But it doesn't work.
You mean the browsers don't use _both_ stylesheets?
That's the only definition of 'works' that can be given to the above
code snippet.

Some older browsers (Netscape 4.x for example) don't understand
@import so using the above syntax hides the second style sheet from
those browsers. But all modern browsers will apply both stylesheets.
So if you want to over ride the first one you need to include explicit
styles in the second that over ride styles in the first.

Quote:
It actually makes both browsers display things the
same but it's still wrong. Any thoughts?
Explain what the actual problem is and post a URL.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #4  
Old   
Toronto Web Designer
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-19-2004 , 10:14 PM



Alo,

"Roderik" <mail (AT) roderik (DOT) net> wrote

(snip)
Quote:
You'd better post your page with the question concerning the
padding/margin in case of using such a work around.

Sample 2 is the intended presentation format but doesn't look good in
Netscape.
http://www.geocities.com/torontowebdesigner/sample2.htm without @import

This page is not as intended in both Netscape of IE
http://www.geocities.com/torontowebdesigner/ with @import

The main problem is indents: the ol element and the third end note is
indented to the right.

The CSS validates. The HTML doesn't. If it has to do with the HTML then I
want to know about it but if it doesn't, I already know that the HTML isn't
valid on these pages.




Reply With Quote
  #5  
Old   
Toronto Web Designer
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-19-2004 , 10:18 PM



Hi Steve,

"Steve Pugh" <steve (AT) pugh (DOT) net> wrote

Quote:
"Toronto Web Designer" <torontowebdesigner (AT) yahoo (DOT) ca.invalid> wrote:

I'm having trouble with the padding and margin properties. IE tends to be
happier with the padding and Netscape with the margin property.

Which versions of IE and Netscape? What are your exact problems?
IE 6 and Netscape 7. The URL and problems are listed under Roderik's
query... within the thread.




Reply With Quote
  #6  
Old   
Roderik
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-20-2004 , 01:33 AM



Toronto Web Designer wrote:
Quote:
Alo,

"Roderik" <mail (AT) roderik (DOT) net> wrote in message
news:40f89713$0$62387$5fc3050 (AT) dreader2 (DOT) news.tiscali.nl...
(snip)

You'd better post your page with the question concerning the

padding/margin in case of using such a work around.

Sample 2 is the intended presentation format but doesn't look good in
Netscape.
http://www.geocities.com/torontowebdesigner/sample2.htm without @import

This page is not as intended in both Netscape of IE
http://www.geocities.com/torontowebdesigner/ with @import

The main problem is indents: the ol element and the third end note is
indented to the right.

The CSS validates. The HTML doesn't. If it has to do with the HTML then I
want to know about it but if it doesn't, I already know that the HTML isn't
valid on these pages.


Well, the geocities generated html is crap, but when I put it without
geocities stuff on my host it gives the same result. At least the second
listitem on the bottom is really weird. Maybe you should try to apply
the padding of the ol to the listitems. The @import statement is only
invisible for nn4 so most netscape users will get the same styles served
as ie users.

--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica


Reply With Quote
  #7  
Old   
Steve Pugh
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-20-2004 , 02:16 AM



"Toronto Web Designer" <torontowebdesigner (AT) yahoo (DOT) ca.invalid> wrote:
Quote:
"Steve Pugh" <steve (AT) pugh (DOT) net> wrote:
"Toronto Web Designer" <torontowebdesigner (AT) yahoo (DOT) ca.invalid> wrote:

I'm having trouble with the padding and margin properties. IE tends to be
happier with the padding and Netscape with the margin property.

Which versions of IE and Netscape? What are your exact problems?

IE 6 and Netscape 7. The URL and problems are listed under Roderik's
query... within the thread.
Are you and Roderik the same person? I'm very confused, which one of
you is having the problem? As far as I could see your post was
starting a new thread - no In-Reply-To header on your post.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #8  
Old   
Steve Pugh
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-20-2004 , 02:35 AM



"Toronto Web Designer" <torontowebdesigner (AT) yahoo (DOT) ca.invalid> wrote:
Quote:
"Steve Pugh" <steve (AT) pugh (DOT) net> wrote:
"Toronto Web Designer" <torontowebdesigner (AT) yahoo (DOT) ca.invalid> wrote:

I'm having trouble with the padding and margin properties. IE tends to be
happier with the padding and Netscape with the margin property.

Which versions of IE and Netscape? What are your exact problems?

IE 6 and Netscape 7. The URL and problems are listed under Roderik's
query... within the thread.
I hope my other message got cencelled quickly enough - my brain's not
quite working yet.

Your problem is with lists - different browsers set the margins and
padding on lists in different ways. So you need to set all four
properties explicitly. In youe case you want the numbers to align with
the edge of the paragraphs.
ol {margin-left: 10%; padding-left: 0;}
li {margin-left: 1.3em; padding-left: 0;}
That should get the same alignment (within a few pixels) in all modern
browsrs.

No need to muck about trying to feed different stylesheets to
different browsers.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #9  
Old   
Roderik
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-20-2004 , 12:56 PM



Brian wrote:
Quote:
Toronto Web Designer wrote:


padding/margin in case of using such a work around.

Sample 2 is the intended presentation format but doesn't look good
in Netscape.


http://www.geocities.com/torontowebdesigner/sample2.htm without
@import

The CSS validates. The HTML doesn't. If it has to do with the
HTML then I want to know about it


There's no way to know if the HTML is causing the problem or not until
you fix it. That is always the first step. CSS is optional. HTML is
the core of your page.

I already know that the HTML isn't valid on these pages.


If you knew that, you should have fixed it before asking here.
Validate, then come back if you're still having problems.

I fixed the HTML for him. He can't do it himself at geocities because
geocities servers add invalid html to your pages when serving them.
You can find it here: http://www.top100nederland.net/test/geocities.htm
But strange things happen to the listitems on his page when styling them
(for example see the bottom of the page in Mozilla).

--
http://www.archytas.nl/
webdesign, internet applicaties, internetgestuurde elektronica


Reply With Quote
  #10  
Old   
Andrew Thompson
 
Posts: n/a

Default Re: Margin and Padding Properties - 07-20-2004 , 02:13 PM



On Tue, 20 Jul 2004 19:56:16 +0200, Roderik wrote:
<T.W.D.>
<Brian>
Quote:
There's no way to know if the HTML is causing the problem or not until
you fix it.
...
I fixed the HTML for him. He can't do it himself at geocities because
geocities servers add invalid html to your pages when serving them.
Yes, Grrr.. I used to recommend that folks put
their pages up at GeoCities to test and debug,
but this mangling of valid HTML by GeoCities
makes *that* all but useless! :-(

Does anyone know of a free host who can manage
to insert their ads *without* destroying the HTML,
or a way of inserting the ads in GC pages that *is*
valid? [ When I used to have a GeoCities site
you could put the ads in your page yourself, so
planning the entire HTML, but that seems not the
case these days.. ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.