|
Home
TutorialsArticles (6)HTML/CSS (15) Javascript (3) PHP (3) Paint Shop Pro 7 (7) Flash CS3 (9) DesignAvatars (166)Layouts (8) phpBB3 Skins (4) Buttons (20) Fonts Emoticons Adopt QuizzesClassical Elements![]() Your Baby's Looks Clothes Color More (10)InteractiveButton RotationHosting Livejournal |
HTML & CSS Tutorial: DIV Positioning [absolute and relative positioning]You can use divs to accomplish a wide variety of positioning options for your text and images. You can code entire layouts in divs, and they come in very handy if you don't want to use tables. Divs can allow you to put your content anywhere on your page. An example would look like this:
Position Absolute Div Tag
See the text 260 pixels down from the top of your browser screen, 10 pixels from the right, and with a space 50 pixels in width?Now you can change position: absolute to position: relative if you don't want the position according to the person's browser/screen but in accordance with everything else on the page. For example, I can write this:
Which would produce this:
Position Relative Div Tag You can also exclude the whole position: relative line and use margin-top and margin-left instead of top and left to achieve the same effect. Note how the text is not at the very top of your screen even though it says top: 0px. It's only relative to what you already have and your allocated text space. For both of the above examples, you can use top, left, bottom, and right as positioning attributes. (Or margin-top, margin-left, etc.) That's your basic on div positioning!
|
ForumLatest Topics...- Continuing Story OOC - Hai Hai Everyone :3 - WE SHALL TALK ABOUT MUFFINS! - Harle is a bastard - messages of love SiteSubmissionsTerms of Use Credits Links & More Site of the Month![]() AffiliatesNone |
||
|
Best viewed in 1024 x 768 resolution or higher.
|
||||