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

How to make full use of CSS style sheets

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to make full use of CSS stylesheets". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to make full use of CSS stylesheets".

1. Multiple ways to call CSS in a web page at the same time

There are many ways to introduce CSS into HTML, such as direct plug-in, using links to external stylesheets, using CSS "@ import" to import stylesheets, and using "STYLE" tags in internal elements to define stylesheets. Some netizens asked whether these introduction methods could be called in the same web page at the same time, and whether there would be confusion between them. In fact, we don't have to worry so much, which is why it is called "cascading stylesheets". Browsers deal with stylesheets in web pages in a certain order, first check whether there is a direct plug-in CSS in the page, execute it first, and ignore it for other CSS of this sentence; then check the "STYLE" tag in the source code of the web page, and execute it. Next, check the internal stylesheet that performed the "@ import" import and the linked external stylesheet in turn. Therefore, we can call multiple introduction ways of CSS in one web page at the same time.

2. Quickly create CSS external files

For a web designer who is new to CSS, it is quite difficult to create an CSS external file using an editor such as WordPad. Because Dreamweaver supports CSS very well, it is much easier to use it to help. Specifically, you can do this: first, write down the grid names that may be used in the web pages of the website, then call up the CSS panel in the editing window of Dreamweaver, define them one by one, and write some relevant content appropriately on a blank page, and try it while defining it. If you are not satisfied with the effect, modify it immediately. Once all defined, create an empty CSS external file with notepad, copy the defined CSS between < head > and < / head > into the CSS file, and you are done.

3. Let the background pattern stand still

When the web page cannot be fully displayed on one screen, we often browse the content outside the screen with the help of horizontal scroll bar and vertical scroll bar. When moving the scroll bar, the general image and text are moved together. Is there any way to make the background image not "scroll" with the text? This can be achieved by using CSS. All we have to do is put the following source code directly between the page and the tag, where bg.jpg is the background image in the page, and you can replace it with the background image you need:

The code is as follows:

< style type= "text/css" >

Share To

Development

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

12
Report