CSS's way of doing it

Source: Internet
Author: User

When the CSS style sets the center alignment of elements, we use the Margin property default auto alignment as:

Margin-left:auto;margin-right:auto;

But when the width is set to 100%, it doesn't have an absolute effect on the way it is, and there's a misunderstanding (I've seen it before), and someone might think the center can set it up like this: "Margin:center;" It won't work.

While the Position property is used to set the element's left-right alignment (while setting the element's height), one way to align elements is to use absolute positioning. Absolute positioning is not related to other elements and can overwrite other elements.

Position:absolute;
left:0px;
RIGHT:PX;
height:0px;
width:0px;

The Position property sets the element alignment method by using relative positioning

position:relative;

There is another way to do this is float (float) property,

Float:right;float:left;

In the block element, we can also use the Span property to set, just note that the Span object is the ID and class, we can control the element.

<span style= "Color:blue" > Color </span>

<span style= "Font-style:oblique" > Italic </span>

<span style= "font-style:100" > Font Bold (100~900) </span>

<span style= "Font-style:overline" > Top slide </span>

<span style= "Font-style:underline" > Glide line </span>

<span style= "Text-decoration:line-through" > Through line </span>

<span style= "line-height:200%" > Row height (percentile higher, larger) </span>

CSS's way of doing it

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.