Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the classic css skills?

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article focuses on "what are the classic css skills". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the classic css skills.

Classic css skills

Use line-height to center vertically

Line-height:24px

When you use a fixed-width container and need a row to be centered vertically, use line-height (the height is the same as the parent layer container).

Clear container float

# main {

Overflow:hidden

}

Such a problem was also mentioned before.

Do not let the link break

A {

White-space:nowrap

}

The above settings can avoid link breaks, but it is personally recommended that long links have corresponding lines (for a discussion of line breaks, see the record at the center of the circle).

Always let Firefox display scroll bars

Html {

Overflow:-moz-scrollbars-vertical

}

More Mozilla/Firefox private CSS attributes can be found here. Cross-browser support is required, or you can use the

Body,html {

Min-height:101%

}

What are the css skills?

Center block elements horizontally

Margin:0auto

Actually, it is.

Margin-left:auto

Margin-right:auto

This technique is explained in almost all CSS textbooks, so don't forget to add a width to it. It can also be used under Exploer

Body {

Text-align:center

}

Then define the inner container

Text-align:left

Restore.

Hide the scroll bar of Exploertextarea

Textarea {

Overflow:auto

}

Exploer textarea has a vertical scroll bar by default (don't ask me why).

Set up print paging

H3 {

Page-break-before:always

}

Page-break-before is a performance setting for paging when printing a web page.

Delete the dotted frame on the link

A:active,a:focus {

Outline:none

}

By default, Firefox adds a dotted frame to the focus of the link (or when clicked), which can be deleted using the above attributes.

At this point, I believe you have a deeper understanding of "what are the classic css skills?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report