Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-28-2011, 12:15 AM   PM User | #1
SuperSriver
New to the CF scene

 
Join Date: Jun 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
SuperSriver is an unknown quantity at this point
Site should start at top but doesn't

Hi there,
in the very early stage of designing a site I have tested the existing code in several browser to avoid late and nasty surprises, but there is already one:

The top element should start at the very top of the page (No border, padding, margin or whatever kind of space). In IE it does, which is fine, in ALL other browsers i t doesn't :there is a black space on top of the top element which I can't get rid of.
I am used to the situation that all broesers work fine and IE is messing up, but here it seems to be the other way round.

What have I coded incorrectly? Can anybody help to stick the page to to top edge of the browser? I am grateful for any comments.

It looks like this:

http://www.learn-german-thoroughly.de/newsite.php

The css is attached. It is very simple; nearly naked, but already causing problems. Please help if you can.

Thanks a lot!
Attached Files
File Type: css newsite.css (896 Bytes, 25 views)
SuperSriver is offline   Reply With Quote
Old 07-28-2011, 12:19 AM   PM User | #2
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
take display: inline-block out from * on line 4 of css
Sammy12 is offline   Reply With Quote
Old 07-28-2011, 12:31 AM   PM User | #3
SuperSriver
New to the CF scene

 
Join Date: Jun 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
SuperSriver is an unknown quantity at this point
Wow, that was not only a quick response - it was also a very good one!
Thanks!
Have just tried it, and now it looks as it should in all browsers. Brilliant.

Could you also give me a quick hint why this is the case; I (being beginner) don't fully understand it. That would be splendid!

Anyway, thanks a lot for the help
SuperSriver is offline   Reply With Quote
Old 07-28-2011, 12:38 AM   PM User | #4
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
because * is setting to all elements, including the <head>, therefore you set the <head> to display: inline-block. Now it has a height on your page. You don't need inline-block to all elements and I would actually advice you to not use it in the future, since I believe the browser support is not safe to use it freely
Sammy12 is offline   Reply With Quote
Old 07-28-2011, 12:45 AM   PM User | #5
SuperSriver
New to the CF scene

 
Join Date: Jun 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
SuperSriver is an unknown quantity at this point
Very good point; I wasn't aware that * includes the header as well and was therefore stupidly wondering what this 'something' at the top might be.... now I know.
Thanks again; I'll see if I can proceed without display: inline block.
Good night.
SuperSriver is offline   Reply With Quote
Old 07-28-2011, 12:57 AM   PM User | #6
Sammy12
Registered User

 
Join Date: Jun 2011
Posts: 1,063
Thanks: 12
Thanked 241 Times in 240 Posts
Sammy12 is on a distinguished road
forgot to post this in my previous post

<head> is by default display: none;, changing it to inline-block gives it a space on the page

Sammy12 is offline   Reply With Quote
Old 07-28-2011, 01:11 AM   PM User | #7
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
Quote:
Originally Posted by SuperSriver View Post
Very good point; I wasn't aware that * includes the header as well and was therefore stupidly wondering what this 'something' at the top might be.... now I know.
Thanks again; I'll see if I can proceed without display: inline block.
Good night.
you could do:
Code:
body * {display:inline-block;}
Lerura is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:09 AM.


Advertisement
Log in to turn off these ads.