/    Sign up×
Community /Pin to ProfileBookmark

A few questions about CSS?

Hey im not knew to CSS but just confused about certain things. Here are my questions if any are answered it is appreciated as it will help me greatly.

  • 1.

    When i validate my stylesheet all the CSS is valid apart from one thing at the top it says no error or warning found, needs correct document parse tree. What is this?

  • 2.

    When defining margins like {margin:0px 5px 0px 5px} in what order does this come for example is it right,left,top,bottom.

  • 3.When creating layers what is the point of using padding and margins like the above or not using padding and use absolute positioning for the layers with defined margins like {margin-left:120px}. Is this wrong to use absolute positioning and defining margins like this or does this make the layout render different in different browsers.

    Cheers
    Chris Sharkey

    to post a comment
    CSS

    8 Comments(s)

    Copy linkTweet thisAlerts:
    @fredmvFeb 04.2004 — [list=1]
  • [*]That's actually very good — the validator is implying that [b]your CSS is valid[/b]. It's just saying that it's best to use valid markup along with your CSS in order for best results.
  • [*]It's clockwise. For more information, see [url=http://www.w3.org/TR/REC-CSS1#margin]the offical W3C documentation[/url].
  • [*]It's not really [i]wrong[/i] to use absolute positioning when there is no other option available, I suppose; however, overusing it is usually a sign that you've done something wrong. Generally, you never need to if your CSS is written correctly.
  • [/list]
    Copy linkTweet thisAlerts:
    @johndoe190authorFeb 04.2004 — Great cheers mate you have cleared a few things up as for the last question im going to revise a check out the css from other peoples sites to try and get the just of whats happening.

    One more question when you use position:absolute will float not work as i have tryed to use the float:right attribute with postion:absolute before and it hasnt floated right.

    Cheers again mate thanks.
    Copy linkTweet thisAlerts:
    @fredmvFeb 04.2004 — No problem. Yes — since the element is absolutley positioned I don't believe using [font=courier]float[/font] will have an effect on it. Generally (or from what I've seen at least), the element cannot contain a [font=courier]position[/font] property along with [font=courier]top[/font] and [font=courier]left[/font] values if you want [font=courier]float[/font] to correctly work. Moreover, you wouldn't even need to use [font=courier]float[/font] due to the simple fact that you could position the element wherever you want by setting the [font=courier]top[/font] and [font=courier]left[/font] properties, however this is not recommended because it will not look quite right across different resolutions and because [font=courier]float[/font], alone, should be all you'd need to enable block-level elements to be able to sit next to each other.
    Copy linkTweet thisAlerts:
    @johndoe190authorFeb 04.2004 — Thanks fredmv i will start to just use the float property instead of the position sorry to be a pain again but another question popped into my head as you said about the resolutions is you use float for the box elements im assuming they stay the same throughout different resolutions but if you you the position property they wont.

    Thanks again mate.
    Copy linkTweet thisAlerts:
    @fredmvFeb 04.2004 — You're very welcome. Well, that question really depends on who you ask that. I, personally, would say this: yes, it is the same on resolutions when using absolute positoning, but to an extent. Why? Because the elements are technically in the same place, but it doesn't appear as if they are due to a larger or smaller resolution. By using elements with only a [font=courier]float[/font] property defined, you can then get block-level elements to sit next to each other and define their dimensions in percentages, thus automatically adjusting to different resolutions.
    Copy linkTweet thisAlerts:
    @johndoe190authorFeb 04.2004 — I think i understand i will try and have a a shot at trying it with the different properties on different resolutions to see what the different effects are.


    Thanks again
    Copy linkTweet thisAlerts:
    @fredmvFeb 04.2004 — You're very welcome. ?
    Copy linkTweet thisAlerts:
    @FangFeb 04.2004 — [URL=http://www.positioniseverything.net/articles/float-theory.html]Float: The Theory[/URL]
    ×

    Success!

    Help @johndoe190 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 6.2,
    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: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

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