/    Sign up×
Community /Pin to ProfileBookmark

<h1>s and display:block

hi all…

url 1:
[url]http://guey.el.net/k/tests/0905/[/url]

the <h1>s are where it says “eat out”. i don’t understand why they are not aligning all the way up to the “col”s top border if there is no margin and padding specified..

url 2:
[url]http://guey.el.net/k/tests/0905/2.html[/url]

here nav is width:600px and it’s supposed to be display: block; but the first col is not being positioned under the nav.
from the css2 reference at w3schools.com i get:
“display: block – The element will be displayed as a block-level element, with a line break before and after the element.”
but it doesn’t work here. why?

can anybody explain please….

thanks..

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@FangSep 14.2005 — 
  • 1. Hx elements have different margin properties in each browser. It is advisable to set the margin in CSS.h1 {margin:0;}

  • 2. #col has a margin set. Set the top margin to zero.


  • btw id's must be unique, use class for col.

    z-index should be unique. The browser will change the z-index if more than one element is given the same value.

    Avoid using hacks for IE, they could cause [URL=http://www.quirksmode.org/blog/archives/2005/09/css_hacks_are_s_1.html]problems[/URL] when IE7 is released. If you need to make adjustments for IE use [URL=http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp]conditional comments[/URL]

    You are mixing XHTML with HTML. The sensible option is HTML strict.
    Copy linkTweet thisAlerts:
    @toshogauthorSep 14.2005 — thanks...
    ×

    Success!

    Help @toshog spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.5,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...