When to use CSS positioning?

前端 未结 4 1323
伪装坚强ぢ
伪装坚强ぢ 2020-12-03 11:47

I am new to the world of coding, XHTML, CSS as well as PHP. I have come across numerous tutorials regarding positioning i.e. relative, absolute and fixed however have no ide

相关标签:
4条回答
  • 2020-12-03 12:17

    ALA has a nice tutorial (there're lots of examples) CSS positioning can be especially useful when you need to position something that cannot be positioned within normal flow.

    0 讨论(0)
  • 2020-12-03 12:17

    To use CSS for layout effectively, it helps to know how it's used to position page content. This article gives an overview of the methods and rules that govern visual rendering in the CSS2 specification. It also points out some things to watch out for.

    http://www.handycss.com/how/how-to-use-css-positioning/

    0 讨论(0)
  • 2020-12-03 12:18

    For understanding CSS positioning, you need to get familiarize with the "CSS BOX Model"

    There are tons of tutorials online. Here are some good ones with examples for beginners:

    http://www.brainjar.com/css/positioning/default.asp

    http://www.tizag.com/cssT/position.php

    http://www.alistapart.com/articles/css-positioning-101/

    0 讨论(0)
  • 2020-12-03 12:22

    Two that I frequently use are:

    Relative positioning: helps you style elements relative to other elements. E.g. you want to move an input to the right relative to the div it's inside.

    Fixed positioning: great for things like Refresh suggestions that get 'fixed' so that they follow you wherever you scroll.

    It's best to play around with them and see for yourself.

    0 讨论(0)
提交回复
热议问题