English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-10-30 06:31:11 · 4 answers · asked by ppl_zheng 1 in Computers & Internet Programming & Design

4 answers

Here is what you will want to look into:

float: left | right | none
text-align: left | right | inherit | justify | center

also:

position: absolute | relative | static | fixed | inherit
margin-left: 200px (or other) or margin-right: -200px (or other)

There is no longer the align="center" and the valign="top" like there used to be. Those attributes are deprecated. CSS has the text-align which applies to inline content of block-level elements, and vertical-align property which applies to inline level and table cells. vertical-align does not work for block level properties - just table cells and images.

Floating an element will align it to the left or right, taking it out of the normal flow of the document and making it only as wide as you request or as wide as it's widest element.

Text-align if for aligning content within an element. So, the block element will still take up 100% of the width it was going to take up, but the content within it is aligned in that direction - which is what makes it different from float.

If you want something to be in a certain location on a page, you can use positioning. You can also move things a bit over from their natural flow with margin.

if you need more, here's a tutorial on all of the above:

http://www.hypergurl.com/csstutorial8.html

2006-10-31 08:21:55 · answer #1 · answered by ★ Estelle ★ 6 · 1 0

Image Align
In depreciated HTML 3.2, one used "align" to make images float to the right or left. In CSS you would do something like this:

You can also float a div element the same way.

Text Align
If you want to align text, you would do something like this:

blah blah blah

2006-10-30 08:07:16 · answer #2 · answered by LorettoBoy 4 · 0 0

usually you have 2 div tags on your information superhighway website that align content fabric fabric to center, the 1st

and the 2d
placed your div tags in right here and get rid of certainly the positions, never use absolute different than you know the call on the reveal reveal won't replace between purchasers. Like a gadget specific information superhighway website. /div /div i earnings from this code and so a ways it works on any gadget or cyber information superhighway browser, in case you make the main of proportion to align content fabric fabric it is going to alter for browser resolutions, in case you make the main of px widths / heights it won't :) in case you as nicely mght prefer to align text fabric fabric to the middle of the internet website use text fabric fabric-align:center indoors the style tag!

2016-10-21 00:19:03 · answer #3 · answered by genthner 4 · 0 0

It is possible to align block elements (tables, images, objects, paragraphs, etc.) on the canvas with the align attribute. Although this attribute may be set for many HTML elements, its range of possible values sometimes differs from element to element. Here we only discuss the meaning of the align attribute for text.

Attribute definitions

align = left|center|right|justify [CI]
Deprecated. This attribute specifies the horizontal alignment of its element with respect to the surrounding context. Possible values:
left: text lines are rendered flush left.
center: text lines are centered.
right: text lines are rendered flush right.
justify: text lines are justified to both margins.
The default depends on the base text direction. For left to right text, the default is align=left, while for right to left text, the default is align=right.

DEPRECATED EXAMPLE:
This example centers a heading on the canvas.

How to Carve Wood



Using CSS, for example, you could achieve the same effect as follows:


How to Carve Wood


How to Carve Wood



Note that this would center all H1 declarations. You could reduce the scope of the style by setting the class attribute on the element:


How to Carve Wood


How to Carve Wood



DEPRECATED EXAMPLE:
Similarly, to right align a paragraph on the canvas with HTML's align attribute you could have:

...Lots of paragraph text...

which, with CSS, would be:


How to Carve Wood


...Lots of paragraph text...

DEPRECATED EXAMPLE:
To right align a series of paragraphs, group them with the DIV element:


...text in first paragraph...

...text in second paragraph...

...text in third paragraph...



With CSS, the text-align property is inherited from the parent element, you can therefore use:


How to Carve Wood



...text in first paragraph...

...text in second paragraph...

...text in third paragraph...



To center the entire document with CSS:


How to Carve Wood


...the body is centered...



The CENTER element is exactly equivalent to specifying the DIV element with the align attribute set to "center". The CENTER element is deprecated.

2006-10-30 06:34:06 · answer #4 · answered by xerocs 5 · 1 0

fedest.com, questions and answers