Zhengchun's CSS Notes (3)

Source: Internet
Author: User
Tags final

1, the right title "more" implementation

The effect shown above is used to position to the right side of the H2 label. In this way, the code does take several more lines. In fact, you can use a stupid way to achieve:

For example, the HTML code is as follows:

< h2>< a h ref= "#" > Title </a> < span> more ...</span>

Using Potsition CSS is almost as follows:

h2{
position:relative;
height:20px;
}
span{
Position:absolute;
right:0;
top:0;
Display:block;
height:20px;
}

This can be achieved more on the right side. Actually, it can be simpler:
h2{
height:20px;
}
span{
Float:right;
Display:block;
margin:-10px 0 0 0;
height:20px;
}

In fact, it only uses the negative numbers of the margin-top to achieve, because the default float will wrap to the H2 tag, so let it jump up. The general code is so, is it simple? I said it's easy! Because it's so simple, there's no separate test page.

PS: I said we have to do with a blue ideal editor ...

2, Taobao CSS properties of the sequential writing specifications.

Former colleagues in the department, everyone has a set of writing specifications, resulting in a look at each other's CSS code is very difficult, so the implementation of a written standard, may also help you.

*{
/* Display Properties * *
Display
Position
Float
Clear
Cursor
...

/* Box Model * *
Margin
Padding
Width
Height

* * Typesetting/*
Vertical-align
White-space
Text-decoration
Text-align
...

/* Text * *
Color
Font
Content

/* Border background Why to put boder and background at the end of the reason is that the frequency of changes will be more frequent, put in the final check up convenient, haha. */
Border
Background
}

In the final analysis, the writing sequence of attributes is: Immortal? -How is the figure! -Clothing type (bikini-padded jacket?) – Dress Style (black, white, button, zipper) – What cosmetics and hairstyles are used.
This writing standard is not a small number of browser manufacturers to implement the writing standards, so it may be the majority of standards to promote people do not agree. But these are the brothers several practice come out think most conforms to the existing Taobao environment.



Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.