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

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.