CSS Tutorial: div Bottom Placement Text

Source: Internet
Author: User
Tags relative

CSS does not have an argument on the layout of the text that is aligned to the bottom of the container. A good way to use it is also better. is to use the Position property to solve, look at the following code, with the position of the relative and absolute positioning function is also easy to achieve, the text near the div lower part of the alignment, and close to the distance can also be accurate to the pixel, they can adjust, is not very good?   

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"
"Http://www.w3.org/TR/html4/loose.dtd" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Untitled Document </title>
<style type= "Text/css" >
#txt {

height:300px;
width:300px;
border:1px solid #333333;
Text-align:center;
Position:relative


#txt p{ 
 position:absolute; 
 bottom:0px; 
 padding:0px; &NBSP
 margin:0px 

</style> 
<body >&NBSP
<div id=txt> 
<p>aadsad</p> 
</div> 
</body >&NBSP

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.