Some problems that are easy to be neglected in the construction of website _dreamweaver

Source: Internet
Author: User
About this article has long wanted to write, just because they are too lazy to drag until now. I would like to talk about some of the more easily overlooked issues in Web page production, is not what advanced tutorials, but their usual work in the study of the problems accumulated, write down one can give beginners to wake up, and second is to help themselves to do a transcript, after all, old, memory is not good ...

1, let you think of course, give you some color to see

This problem is actually a lot of people ignore, small to personal site, large to portal sites are likely to make this mistake. Believe it or not, if your website background is white, then you will remember to write down Background-color in CSS: #ffffff this code? I bet most people won't! It is not because everyone is lazy, but this is completely ignored, why? Because of the Windows operating system we use in most cases, the default background color of the various software running on it is white, including IE browser, so in the background of the site is white, many web makers take for granted ignore the background color settings, anyway, everyone is white, If you don't set it, you won't see it. But don't forget, Windows starts to support system theme replacements from XP, and there are a number of third-party themes that change the system default settings, including background-color settings, and if the background color is not enforced on the page, the page will display content in the background color of the current browser. The result is that the site beauty is greatly reduced, take everyone familiar with the netease to give examples, the following screenshot is on my machine when browsing the appearance, because before long changed a set of Vista theme style, so the browser background color into a light gray.

Take a closer look at NetEase's Logo, can you see it? Yes, the Logo background is white, but next to the background color is gray, in other words, NetEase's entire page background was originally intended to be white, which in the background of the browser is white under the premise is not what to see, but like now this "leakage stuffing." Not only NetEase, a lot of portals are like this, I do not go to an example, can be seen about the importance of background-color settings. So, no matter what kind of background color your site is, please remember to set it well, even if it is white!

2, Attention! to the Left ~ ~ ~

We all know that the default horizontal alignment of Table (align) is left-aligned, and that setting align= "Ieft" is the same as not setting it, so many people don't set this property, as I used to. However, in some special cases, IE will interpret the default left alignment as the center alignment, resulting in the layout of the page problems, although it is said that the specific circumstances will be a problem even I do not know, but this situation is absolutely, so everyone in the page must be habitual to set the table align properties , do not lazy skip this step, for the performance of the page, this so-called superfluous is absolutely beneficial harmless.

3, Cell width-Stealth killer

I don't know if you've ever met a situation like this, let's say that when you set the left alignment for a cell's align, you find that the text in the cell doesn't have the effect of applying the property, but it continues to be centered, looking at both ends of the text without finding any spam code included. But in any case can not change the position of the text. Is it depressing? Anyway, at the time I was very depressed, until later, I found that the original cell width property in the mischief, delete or reset the problem is resolved, so, when you also encountered the same problem, you may wish to check the width settings of the problem cell, I believe you will find a solution.

4, kill the scroll bar will not disappear

Sometimes for some personalized needs, some people like to hide the browser's scroll bar, this effect is easy to do, but sometimes found that the code is not a problem, and view the browser is not a non-IE kernel type, but the abominable scroll bar is not gone! And many of the problems appear on Web pages made with visual editing software such as DW. What's the reason? In fact, the reason is in the header code of the page, look at the source code of the page, you will find at the top of the two code similar to this:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en"
"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

These two lines of code, called DOCTYPE declarations, are shorthand for document type, which is used to indicate what version of XHTML or HTML you are using. To put it simply, the two lines of code are essential to making a standardized page, and the browser interprets your page's identity according to the type of document you define and displays it. In other words, if you define a wrong DOCTYPE, your logo and CSS will not take effect. And the definition of the scroll bar to display or not overflow, overflow-x, overflow-y These three attributes are not adopted by the web standards, so if your page defined above DOCTYPE, then these three properties is invalid code, the solution is to delete the head of the DOCTYPE statement, although this is not recommended today for the increasingly popular standard.

5, all is the trouble of annotation

It's a good practice to write comments for code, but sometimes there are problems, such as writing a Chinese annotation for a CSS.
If you write a Chinese annotation for your own defined CSS, then in some special cases (such as server-side support, the page used by the type of program, etc.) will cause some of the code to fail for no reason, this situation I met several times, so the technology did not solve the problem before, or do not write annotations for CSS good, Develop good naming habits enough for others to understand the meaning of their own code, even if it must be written, please write in English ... What the? Pinyin!!! Please, you use pinyin to try, guarantee one weeks later even you do not understand what it is written.

6, God, shine it ~ ~ ~

This question some impostors suspicion, just have a lot of people ask about, so also put up. is about the CSS Glow Filters, this filter effect is to surround the object content edge to make the luminous effect, also has the person to stroke the effect, many uses in the text performance, but many people use this filter to discover does not appear wants the effect, The reason is mostly due to the use of this filter directly to the text, to know that the filter on the text is no effect, then why can produce luminous text? That's because it must be applied to the container where the text is placed, such as Table. So if there's no effect, check to see if it's in the wrong place.

Another problem with the filter is that, although there is a glow effect, it feels like the halo on the text is cut off, one less. This is because the container height of the placed text falls below the glow range of the filter, there are three ways to resolve it:

1. Reduce font-size
2, increase the height value
3, reduce the size of the strength value

7, thinking ...

In fact, these problems are not a great big problem, but often the more small problems are easier to be overlooked, I hope that these lessons can help you, even if a person from the benefit of my Luo miles wordy so half-day.

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.