Absolute positioning and relative positioning of CSS

Source: Internet
Author: User
Relative positioning

The parent has code:

. picbox{    position:relative;    width:400px;    height:250px;    margin:0 Auto;

That is, the position:relative in the code, and the child's positioning can determine the seat relative to the parent.

The code for the Child:

The code in the child must have position:absolute;

CSS Original code display:

. picbox{    position:relative;    width:400px;    height:300px;    margin:0 Auto;}. Picbox span{    Position:absolute;    top:10px;    bottom:10px;    Color: #f3eded;}

How to locate a seat:

top:10px;bottom:10px;

This code determines their relative parent's seat

The transparency of the DIV:

. ttbg{    Position:absolute;    left:0;    bottom:0%;    width:400px;    height:40px;    background:red;    opacity:0.1;

opacity:0.1 with code in a CSS style, representing the transparency of a color

Image

Representation methods in CSS3

Background:rgba (0,0,0,0.5)

Analytical

RGB: Refers to the code color in PS
A: Refers to the transparency of the channel

CSS Absolute Positioning

Code:

Positioning relative to the entire page

Position:absolute

Absolute positioning: relative to parent positioning

. picbox{    position:relative;    width:400px;    height:300px;    margin:0 Auto;

More about the absolute positioning and relative positioning of CSS please follow topic.alibabacloud.com!

  • Related Article

    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.