473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Will margins look the same in other browsers?

Will the following css have the same visual result in most modern browsers
as it does in IE6? TIA

p { margin-top: 6px; margin-bottom: 6px}
ul { margin-top: 6px; margin-bottom: 6px}
Dec 7 '05 #1
6 1463
namenotgivenhere wrote:
Will the following css have the same visual result in most modern browsers
as it does in IE6? TIA

p { margin-top: 6px; margin-bottom: 6px}
ul { margin-top: 6px; margin-bottom: 6px}


Depends.

Is your doctype triggering standards or quirks mode? Should there be
any collapsing margins?

Steve

Dec 7 '05 #2
in comp.infosystems.www.authoring.stylesheets, namenotgivenhere wrote:
Will the following css have the same visual result in most modern browsers
as it does in IE6? TIA

p { margin-top: 6px; margin-bottom: 6px}
No.
ul { margin-top: 6px; margin-bottom: 6px}


No.

Both work just fine in technical sence. But different browsers and
computers have different defaults.

For example if I have 5mm high letters on high PPI screen, there seems to
be no space between paragraphs. On low PPI screen, there is noticeable
space.

Note that if you style lists, there is quite different defaults for
different list elements in different browsers.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Dec 7 '05 #3
"Steve Pugh" <st**********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
namenotgivenhere wrote:
Will the following css have the same visual result in most modern browsers as it does in IE6? TIA

p { margin-top: 6px; margin-bottom: 6px}
ul { margin-top: 6px; margin-bottom: 6px}


Depends.

Is your doctype triggering standards or quirks mode? Should there be
any collapsing margins?

Steve


The doctype: <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
I want the margins to be 6px before and after each <p> or <ul>. In IE6 this
style results (to my eyes) in a vertical gap of 12px between any adjacent
<p> or <ul>.
Dec 7 '05 #4
in comp.infosystems.www.authoring.stylesheets, namenotgivenhere wrote:
"Steve Pugh" <st**********@gmail.com> wrote in message
Is your doctype triggering standards or quirks mode? Should there be
any collapsing margins?

Steve


The doctype: <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">


Not that, but thing starting <!DOCTYPE as a first thing in your file. If
there is no such thing, you are in quirks mode, which is not good.
I want the margins to be 6px before and after each <p> or <ul>. In IE6 this
style results (to my eyes) in a vertical gap of 12px between any adjacent
<p> or <ul>.


That's wrong behaviour, margins should collapse.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Dec 8 '05 #5

namenotgivenhere wrote:
"Steve Pugh" <st**********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
namenotgivenhere wrote:
Will the following css have the same visual result in most modern browsers as it does in IE6? TIA

p { margin-top: 6px; margin-bottom: 6px}
ul { margin-top: 6px; margin-bottom: 6px}
Depends.

Is your doctype triggering standards or quirks mode? Should there be
any collapsing margins?


The doctype: <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">


That's not a doctype.
I want the margins to be 6px before and after each <p> or <ul>.
If p and ul and the only elements you use in yout HTML then the above
styles will give 6px gaps between each adjacent element in conforming
browsers (ignoring cases where users over ride your styles with their
own preferences).
In IE6 this
style results (to my eyes) in a vertical gap of 12px between any adjacent
<p> or <ul>.


IE is wrong as IE isn't collapsing adjacent vertical margins.

Steve

Dec 8 '05 #6
Steve Pugh wrote:
If p and ul and the only elements you use in yout HTML then the above
styles will give 6px gaps between each adjacent element in conforming
browsers (ignoring cases where users over ride your styles with their
own preferences).


Oh, and allowing for different browsers having different vertical
margins on <li> elements which may affect the appearance of your <ul>s.

Steve

Dec 8 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Thomas Mlynarczyk | last post by:
Hello, I noticed that IE seems to put some kind of default margins on <li> elements and the only way to get rid of them seems to be asigning negative margins. To make things worse, IE5 and IE6...
8
by: Jukka K. Korpela | last post by:
I just noticed that most browsers render <table border="1"><tr><td><p>foo</p></td></tr></table> the same way as <table border="1"><tr><td>foo</td></tr></table> That is, they ignore the p...
8
by: slim | last post by:
hi again all, i am still working on the website as mentioned in earlier threads and have hit another snag... http://awash.demon.co.uk/index.php http://awash.demon.co.uk/vd.css the php is...
33
by: Philip Herlihy | last post by:
I'm creating a common navigation bar of text "buttons" using CSS. On each page, I want the corresponding button to be "inert" (no hover, etc) as a visual clue to where you are. I thought I'd...
7
by: Kyle James Matthews | last post by:
Hello all, Please have a look at http://www.digitalovertone.com/v3/example.htm. Netscape, Mozilla, and Firefox all insert an upper margin on 1 em on the content on the left, and an upper margin...
3
by: Patient Guy | last post by:
For a long time, this page has been up and an embarrassment. http://tinyurl.com/ylcqum In Firefox, the table moves out of its parent container with the negative margin, but not in MSIE6. ...
11
by: listerofsmeg01 | last post by:
Argh! I'm going nuts trying to get a constant margin after a floated div that works cross browser. This works in IE but not Firefox: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"...
27
by: Harris Kosmidhs | last post by:
Hello. sorry if this has been answered previously. I use a main wrapper div to put the whole site in it. And I use margin: 0 auto 0 auto in order to center the page. But in IE it fails. Is...
14
by: Mark Shroyer | last post by:
I just noticed an unintuitive aspect of how nested blocks are positioned under a specific set of conditions, and although this is ostensibly correct behavior (unless Firefox, Safari, and Opera are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.