Home Database Mysql Tutorial 网页制作中经常用到的六则代码技巧

网页制作中经常用到的六则代码技巧

Jun 07, 2016 pm 03:29 PM
code Skill letter Web page production sheet

一.: 表格内的文字不会自动换行,怎么办? 有两种可能的情况: 第一种,你用CSS把表格内文字的字体设置成了英文字体,这样在DW里表格内的文字不会自动换行,但这仅是DW里的显示效果,在IE里其实是可以正常换行的。如果希望在DW的编辑状态也能使文字自动换行

  一.: 表格内的文字不会自动换行,怎么办?

  有两种可能的情况:

  第一种,你用CSS把表格内文字的字体设置成了英文字体,这样在DW里表格内的文字不会自动换行,但这仅是DW里的显示效果,在IE里其实是可以正常换行的。如果希望在DW的编辑状态也能使文字自动换行,把表格内文字的字体设置为中文字体即可(例如“宋体”)。

  第二种,你在表格中输入了连串无空格的英文或数字,它们被IE识别为一个完整的单词,所以不会自动换行,遇到这种情况,你可以通过CSS把文字强行打散,例如:

…… 

  二. : 怎么才能让层飘在Flash上面?

  在网页里把SWF文件设置为背景透明即可,具体做法:

  DW中,在SWF文件的属性面板中,点parameters,添加参数wmode,值选择transparent;或者直接修改网页的代码,在标志SWF文件属性的代码中添加:



  注意,这种效果只有IE支持。

  三. : 背景音乐因为页面的切换而无法连续播放,怎么让它连续播放?

  用分帧实现,把其中一个frame的显示高度(或宽度)定义为0,在其中设置背景音乐,另外一个frame内的页面切换不影响整个背景音乐的播放。

  例子:



框架页


 



<br> <br>对不起,你的浏览器不支持框架的显示。 <br> <br>
 
  四. : 改变IE的字体大小设置时,页面字体不发生改变,怎样实现?

  用CSS定义页面字体,例如:

  基本上,设置了body和td的默认字体,就相当于定义了页面内大部分文字内容。

  五. : 绝对地址与相对地址?绝对定位与相对定位?

  绝对地址:形如http://www.chinaitlab.com或file://d:/homepage/default.htm这样的地址,就是文件在网络或本地的绝对位置;

  相对地址:就是被链接文件相对与当前页面的地址,比如说,链接和当前页面同级的文件地址只要用“文件名”即可;链接当前页面下级子目录下的文件用“目录名/文件名”;链接当前页面上一级目录下的文件用“../文件名”;链接同级但在另外一个子目录中的文件用“../目录名/文件名”;链接根目录(你的网站的根目录,并非硬盘根目录)下的文件可以用“./文件名”的形式。实绝对和相对很容易理解的,相对就是有参照物的,绝对则是固定的。为什么我们提倡使用相对地址呢?打个比方说吧,如果你有一个index.htm,里面引用了images目录的一些图片,如果使用了相对地址,搬家的时候只需把原来这套东西全部上传到新的空间就行了,因为文件彼此之间的相对位置关系没有改变,所以这些地址仍然是有效的。但如果插入图片的时候使用了绝对地址,那空间地址一变,引用处的图片路径也要随之改变。当然,有时也会用到绝对地址,例如友情链接别人的主页等等。

[1] [2] 

网页制作中经常用到的六则代码技巧

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Steps to adjust the format of pictures inserted in PPT tables Steps to adjust the format of pictures inserted in PPT tables Mar 26, 2024 pm 04:16 PM

1. Create a new PPT file and name it [PPT Tips] as an example. 2. Double-click [PPT Tips] to open the PPT file. 3. Insert a table with two rows and two columns as an example. 4. Double-click on the border of the table, and the [Design] option will appear on the upper toolbar. 5. Click the [Shading] option and click [Picture]. 6. Click [Picture] to pop up the fill options dialog box with the picture as the background. 7. Find the tray you want to insert in the directory and click OK to insert the picture. 8. Right-click on the table box to bring up the settings dialog box. 9. Click [Format Cells] and check [Tile images as shading]. 10. Set [Center], [Mirror] and other functions you need, and click OK. Note: The default is for pictures to be filled in the table

How to make round pictures and text in ppt How to make round pictures and text in ppt Mar 26, 2024 am 10:23 AM

First, draw a circle in PPT, then insert a text box and enter text content. Finally, set the fill and outline of the text box to None to complete the production of circular pictures and text.

How to make a table for sales forecast How to make a table for sales forecast Mar 20, 2024 pm 03:06 PM

Being able to skillfully make forms is not only a necessary skill for accounting, human resources, and finance. For many sales staff, learning to make forms is also very important. Because the data related to sales is very large and complex, and it cannot be simply recorded in a document to explain the problem. In order to enable more sales staff to be proficient in using Excel to make tables, the editor will introduce the table making issues about sales forecasting. Friends in need should not miss it! 1. Open [Sales Forecast and Target Setting], xlsm, to analyze the data stored in each table. 2. Create a new [Blank Worksheet], select [Cell], and enter [Label Information]. [Drag] downward and [Fill] the month. Enter [Other] data and click [

How to set WPS value to automatically change color according to conditions_Steps to set WPS table value to automatically change color according to condition How to set WPS value to automatically change color according to conditions_Steps to set WPS table value to automatically change color according to condition Mar 27, 2024 pm 07:30 PM

1. Open the worksheet and find the [Start]-[Conditional Formatting] button. 2. Click Column Selection and select the column to which conditional formatting will be added. 3. Click the [Conditional Formatting] button to bring up the option menu. 4. Select [Highlight conditional rules]-[Between]. 5. Fill in the rules: 20, 24, dark green text with dark fill color. 6. After confirmation, the data in the selected column will be colored with corresponding numbers, text, and cell boxes according to the settings. 7. Conditional rules without conflicts can be added repeatedly, but for conflicting rules WPS will replace the previously established conditional rules with the last added rule. 8. Repeatedly add the cell columns after [Between] rules 20-24 and [Less than] 20. 9. If you need to change the rules, you can just clear the rules and then reset the rules.

Win11 Tips Sharing: Skip Microsoft Account Login with One Trick Win11 Tips Sharing: Skip Microsoft Account Login with One Trick Mar 27, 2024 pm 02:57 PM

Win11 Tips Sharing: One trick to skip Microsoft account login Windows 11 is the latest operating system launched by Microsoft, with a new design style and many practical functions. However, for some users, having to log in to their Microsoft account every time they boot up the system can be a bit annoying. If you are one of them, you might as well try the following tips, which will allow you to skip logging in with a Microsoft account and enter the desktop interface directly. First, we need to create a local account in the system to log in instead of a Microsoft account. The advantage of doing this is

Do you know how to sum a Word table? Do you know how to sum a Word table? Mar 21, 2024 pm 01:10 PM

Sometimes, we often encounter counting problems in Word tables. Generally, when encountering such problems, most students will copy the Word table to Excel for calculation; some students will silently pick up the calculator. Calculate. Is there a quick way to calculate it? Of course there is, in fact the sum can also be calculated in Word. So, do you know how to do it? Today, let’s take a look together! Without further ado, friends in need should quickly collect it! Step details: 1. First, we open the Word software on the computer and open the document that needs to be processed. (As shown in the picture) 2. Next, we position the cursor on the cell where the summed value is located (as shown in the picture); then, we click [Menu Bar

What are the tips for novices to create forms? What are the tips for novices to create forms? Mar 21, 2024 am 09:11 AM

We often create and edit tables in excel, but as a novice who has just come into contact with the software, how to use excel to create tables is not as easy as it is for us. Below, we will conduct some drills on some steps of table creation that novices, that is, beginners, need to master. We hope it will be helpful to those in need. A sample form for beginners is shown below: Let’s see how to complete it! 1. There are two methods to create a new excel document. You can right-click the mouse on a blank location on the [Desktop] - [New] - [xls] file. You can also [Start]-[All Programs]-[Microsoft Office]-[Microsoft Excel 20**] 2. Double-click our new ex

A must-have for veterans: Tips and precautions for * and & in C language A must-have for veterans: Tips and precautions for * and & in C language Apr 04, 2024 am 08:21 AM

In C language, it represents a pointer, which stores the address of other variables; & represents the address operator, which returns the memory address of a variable. Tips for using pointers include defining pointers, dereferencing pointers, and ensuring that pointers point to valid addresses; tips for using address operators & include obtaining variable addresses, and returning the address of the first element of the array when obtaining the address of an array element. A practical example demonstrating the use of pointer and address operators to reverse a string.

See all articles