Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 23rd, 2007, 10:25 AM
Axel Siebenwirth
Guest
 
Posts: n/a
Default margin above of <p>

Hi,

I've just got a small question considering the margin above a <pelement.

http://www.mooselook.de/myweb/p.html

With IE there's about no space between the grey box and the word
"Benutzername".
With Firefox there's just the right spacing inbetween these two.

What's causing thing and how can I workaround this in IE?

Thanks,
Axel
  #2  
Old August 23rd, 2007, 10:45 AM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: margin above of <p>

Scripsit Axel Siebenwirth:
Quote:
I've just got a small question considering the margin above a <p>
element.
http://www.mooselook.de/myweb/p.html
I have many big questions concerning the markup. It's a complicated mess of
table layout with embedded CSS.
Quote:
With IE there's about no space between the grey box and the word
"Benutzername".
What in your code makes you think there should be? And spacing is generally
a matter of styling (CSS), not HTML.
Quote:
With Firefox there's just the right spacing inbetween these two.
Consider that as a coincidence: the browser behaves as if it read your mind.

Technically, it might have something to do with default margins for p
elements when they appear inside a td element, or something like that. But
the page contains no _paragraph_, so why are you using p markup?

Adequate markup for the content would consist of something like the
following:

<form action="..." method="post">
<h2>Anmelden</h2>
<div><label for="id">Benutzername:</label>
<input id="id" name="user_id" type="text" size="15" maxlength="30"></div>
<div><label for="pwd">Passwort:</label>
<input id="pwd" name="password" type="password" size="15"
maxlength="40"></div>
<div><input type="submit" value="Anmelden"></div>
</form>

It might be argued that a table, with labels in one column and corresponding
input fields in another, would be better markup for some purposes.

Anyway, the _rest_ is a matter of styling, not CSS. And the simple, logical
markup is a much better starting point for styling than a confusing layout
table.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles