Make the background color transparent

Source: Internet
Author: User

Make the background color transparent

 

There is an Alpha filter in CSS, which can set the transparency of the target element. You can also specify coordinates to achieve transparency across different ranges. The syntax is as follows:

{Filter: alpha (opacity = # opacity, finishopacity = # finishopacity, style = # style, startx = # startx, starty = # starty, finishx = # finishx, finishy = # finishy )}

The specific parameter meanings are as follows:

Opacity transparency. The default range is from 0 to 100. They are actually percentages. That is to say, 0 indicates completely transparent, and 100 indicates completely opaque.

Finishopacity is an optional parameter. If you want to set the transparency of the gradient, you can use them to specify the transparency at the end. The range is also 0 to 100.

Style specifies the shape features of the transparent area: 0 represents the unified shape, 1 represents the linear shape, 2 represents the radial shape, 3 represents the rectangle

X coordinate at the beginning of the startx gradient transparency effect.

Y coordinate at the beginning of the starty gradient transparency effect.

The X coordinate at the end of the finishx gradient transparency effect.

The Y coordinate at the end of the finishy gradient transparency effect.

You can set only one opacity.

For example:

{Filter: alpha (opacity = 50 )}

This is the translucent setting. You only need to add the code in {} to the {} in the template to be set. Remember to use the ";" interval with the previous code, otherwise, the settings are invalid.

For example:

I want to set the color (white) and translucent of the background of the template area [the effect of my current blog]

As long

. Modbox {}

. Modbl {}

. Modbc {}

. Modbr {}

Background-color: white

These are the template background settings ID.

Then add one in. modbox,. modbl,. modbc,. modbr {} without this.

Add filter: alpha (opacity = 80) to achieve the translucent effect of the background of all templates.

If you want to display only the background of a blog like me, and everything else is transparent, add the background transparent code to other templates.

Background: transparent this is the fully transparent background code.

For template IDs, refer to the link: Baidu space CSS description

However, the main area of the template is transparent, but there will be a color under it, So in addition

. Modbl {}

. Modbc {}

. Modbr {}

Add fully-transparent background code to make the template area completely transparent, just like what I do now

In addition, this parameter can only be used to set the background color. The background image cannot be set to translucent.

 

This is others' translucent background settings for reference.

. Modbox {padding: 10px 10px 0 10px; Background-color: # ffffff; border-left: 1px solid #813533; border-Right: 1px solid #813533}

. Modbl {Background: transparent; border-left: 1px solid #813533; border-bottom: 1px solid #813533; line-Height: 1px}

. Modbc {Background: transparent; border-bottom: 1px solid #813533; line-Height: 1px}

. Modbr {Background: transparent; border-Right: 1px solid #813533; border-bottom: 1px solid #813533; line-Height: 1px}

. Modbox,. modbl,. modbc,. modbr {filter: alpha (opacity = 80);-moz-opacity: 0.8; width: Auto! Important; width: 100%}

The red text is the key setting. If you do not want to set it to fully transparent, you can set it. modbl {}. modbc {}. in modbr {}, change the value of Background: transparent. in modbox {}, background-color: # ffffff. Of course, you can replace # ffffff here with your favorite color, but for the sake of beautiful appearance, we recommend that the four color codes be the same.

Appendix: # ffffff is white, white; #000000 is black, black

Analyze content

Profile # m_blog {}

Space title bar # m_header {}

The menu bar is # tab {}

Article area # m_blog {}

Album area # m_album {}

Link # m_links {}

Document category # m_artclg {}

Latest comment # m_comment {}

Access area # comm_info {}

All of the above modules [except space title and menu]. Stage {}

This is the ID of several major modules. You only need to add the fully transparent code to the ID {} where you want to set the fully transparent one. If there is no module ID {} You want to set {}, add it to the blank space.

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.