Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > vertically spaced div's

Reply
Thread Tools

vertically spaced div's

 
 
Karsten
Guest
Posts: n/a
 
      04-14-2005
Hello!

The following html file is not displayed properly on Safari:

http://userpage.fu-berlin.de/~kweinert/viki_conv.html

The divs are spaced vertically, but they should not. In IE, it looks
good. What am I doing wrong?

(Also strange is the hover effect on the headings. If you move the
mouse over a heading, it changes its color like a link. In Safari, not
in IE. Why is that?)

Can you give me an advice how to do it right? I'm not experienced with
CSS and so it would be very kind if you could help me here.

Kind Regards,
Karsten

 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      04-14-2005
"Karsten" <> wrote:

>The following html file is not displayed properly on Safari:


Or Opera or Firefox...

>http://userpage.fu-berlin.de/~kweinert/viki_conv.html
>
>The divs are spaced vertically, but they should not. In IE, it looks
>good. What am I doing wrong?


Assuming that IE is correct.
IE is in fact applying your styles incorrectly.

The margins on the <h1> will collapse with the margins on the <div>
that contains the <h1>. Hence the margins of the <h1> will appear
outside of the <div> thus creating the spacing you see.

See http://www.w3.org/TR/CSS21/box.html#x25 for the details.

How to prevent it?
Set either padding or border on the <div> to a non-zero value.
Or, set the margins of the <h1> to zero and set padding instead (not
always an option but will work in your case).

>(Also strange is the hover effect on the headings. If you move the
> mouse over a heading, it changes its color like a link. In Safari, not
>in IE. Why is that?)


<h3><a name="Wie-es-funktioniert">Wie es funktioniert</a></h3>

a:hover { background:transparent; color: Red; }

You have an <a> element and you have a style for a:hover, why
shouldn't it be applied? Again IE is showing its failings - it only
supports :hover on links.

Steve

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

Steve Pugh <> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
 
Duncan Greenhill
Guest
Posts: n/a
 
      04-14-2005

"Karsten" <> wrote in message
news: ups.com...
> Hello!

<snip>
> Can you give me an advice how to do it right? I'm not experienced with
> CSS and so it would be very kind if you could help me here.
>
> Kind Regards,
> Karsten


Karsten,
There's a few errors that need looking at. Running the page through
http://validator.w3.org/ gives a list. It's always a good starting point to
have html and css that validates. Also there's whitespace above the first
lines of code, which if I remember correctly can cause problems also.

Regards,
Duncan


 
Reply With Quote
 
Karsten
Guest
Posts: n/a
 
      04-15-2005
Hello,
thanks a lot! I think I understand the problems now...
....and I will also get a different browser

Regards,
Karsten.

 
Reply With Quote
 
Duncan Greenhill
Guest
Posts: n/a
 
      04-16-2005

"Karsten" <> wrote in message
news: oups.com...
> Hello,
> thanks a lot! I think I understand the problems now...
> ...and I will also get a different browser


Firefox would be a good choice
Duncan


 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML seems double-spaced VB Programmer ASP .Net 4 06-09-2004 05:32 PM
csv writerow creates double spaced excel csv files Michal Mikolajczyk Python 0 02-13-2004 08:38 PM
Re: JTextArea text is double-spaced? Thomas Weidenfeller Java 2 07-17-2003 03:06 PM
Re: JTextArea text is double-spaced? bad_knee Java 2 07-14-2003 05:23 PM
Re: JTextArea text is double-spaced? bad_knee Java 0 07-13-2003 10:24 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57