CSS effect: Fixed footer, PNG transparent, minimum height 3

Source: Internet
Author: User

8. Fixed footer

Adding a fixed footer to a webpage is actually very simple and practical. The footer of some websites is beautifully designed to present a perfect ending to the website.

# Footer {
Position: fixed;
Left: 0px;
Bottom: 0px;
Height: 30px;
Width: 100%;
Background: #444;
}
/* IE 6 */* html # footer {
Position: absolute;
Top: expression((0-(footer.offsetheight)+(document.doc umentelement. clientheight? Document.doc umentelement. clientheight: Document. Body. clientheight) + (ignoreme = document.doc umentelement. scrolltop? Document.doc umentelement. scrolltop: Document. Body. scrolltop) + 'px ');
}

9. Fixed the transparency of PNG in IE 6.

The use of transparent images on the website has become a universal method, starting with the. GIF format, but now it also involves the .png image format. Some earlier versions of IE do not support transparency. The following code will solve this problem well.

. Bg {
Width: 200px;
Height: 100px;
Background: URL (/folder/yourimage.png) No-Repeat;
_ Background: none;
_ Filter: progid: DXImageTransform. Microsoft. alphaimageloader (src = '/folder/yourimage.png', sizingmethod = 'crop ');
}
/* 1px GIF Method */IMG,. PNG {
Position: relative;
Behavior: expression (this. runtimestyle. Behavior = "NONE" &&(this.png set? This.png set = true :( this. nodename = "IMG" & this.src.tolowercase().indexof('.png ')>-1? (This. runtimestyle. backgroundimage = "NONE ",
This. runtimestyle. Filter = "progid: DXImageTransform. Microsoft. alphaimageloader (src = '" + this. SRC + "', sizingmethod = 'image ')",
This. src = "images/transparent.gif") :( this. origbg = This. origbg? This. origbg: This. currentstyle. backgroundimage. tostring (). Replace ('url ("',''). Replace ('")',''),
This. runtimestyle. Filter = "progid: DXImageTransform. Microsoft. alphaimageloader (src = '" + this. origbg + "', sizingmethod = 'crop ')",
This. runtimestyle. backgroundimage = "NONE" available, this.png set = true ));
}

10. Set the minimum height across browsers

Sometimes developers need to set the minimum height for HTML elements. However, this effect is not compatible with IE and Firefox of earlier versions. The following code can fix this problem.

# Container {
Min-Height: 550px;
Height: Auto! Important;
Height: 550px;
}

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.