A lot of CSSer are the webpage from before in making, begin to study CSS webpage position, still put in the DW habit with particular move probably. Hope this article can be helped everybody understands and correct a few bad habits.
As a result of " visible " with the operation handy, the friend that writes CSS in DW is very much, we introduce today a few write CSS in DW " optimal habit " , hope to be helped somewhat to everybody.
CSS is changing the course that the website designs. To cater to the demand of the design personnel of the apt CSS of constant growth, macromedia DW MX introduced the character related a few new CSS that reach improvement to pass. Had these new character, you can replace good plan for what did not come, develop more as compatible as W3C standard site. Article discussion uses CSS and outstanding some in DW MX a few proposals when specific CSS is characteristic.
Popularly is told, the style is expressed (the gather that Style Sheet) is the formatted regulation that controls webpage content outward appearance. The means that can differ with 3 kinds uses CSS in your page:
Code type (Inline) : Write the one-time style in code.
Pattern sets inside (Embedded) : Controallable the modal watch of all elements in a page
Outside couplet type (External) : Controallable the modal watch of the element in a lot of pages
In fact, a lot of sites are used according to needing to rise tie of these 3 kinds of kind.
The different version that the fact that when use CSS a need considers mainly is different browser and same browser comes with different kind analytic CSS. Besides the difference of network browser, you realize even still have a lot of other browsers, for instance audition browser, be based on the browser of TV and Palm Pilot and TTY(teletypewriter, long-range typewriter) a kind hold facility.
What is optimal habit to point to?
Most technology has the level of own established by usage. CSS is not exceptional also. All CSS that although be not,exist on the network are very normative, but will use CSS according to existing standard still is however not without advantage. Generally speaking, develop personnel to should depart content and report as far as possible. The profit that such doing depends on:
1, the life that adds a site
Non-standard modal watch may feel very convenient at that time, but after the browser of new version comes out, can appear probably compatibility problem. The job that the page is being chased to revise a site when arriving is an extraordinary take time also makes use CSS lost a sense at the same time.
2, the site that allows you is applicable to all users and browser
Website of already legislative requirement must let the government of some places physical disabilities personage can be browsed as much. Know the browsing equipment of the design for physical disabilities, for instance audition browser, requirement of normative to CSS sex is extremely strict.
3, let the site is updated and be safeguarded more relaxed
If use way is proper, CSS can make your adjustment in a page fast apply in all pages.
The choice that you should make above all is to use which kind of style lists. When involving optimal habit, the analysis that expresses to different type is as follows:
Inline CSS: Say simply, you should avoid to use as far as possible. Besides a few other defect, use Inline CSS means you and use the real good point of CSS without benefit, namely you did not depart content and format. DW MX use Inline CSS basically is for element of fixed position page (these elements are called in the user interface of DW MX " layer (Layer) " ) , or to use specially good effect of a certain DHTML, the Javascript that it needs to use Inline type will change the property of an object.
Embedded CSS: It also is not optimal, because it can bring to bear on to current page only,affect. In updated process, if certain page is missing, will make the style of the site abhorrent; is additional, when the user browses your site, each page should download a style to express information.
External CSS: This is your the first choice. The concentrate on the main points of surface color; that External CSS can let all pages that receive it repeatedly keep consistent, change, ; of relaxed newer all and relevant page makes your page bulk smaller, the rate that browse is rapidder. When thereinafter analyses particular CSS character, other a few optimal habits will allude.
CSS style watch is founded in DW MX
When CSS style is founded to express in DW MX (Text " CSS Style " New Style Sheet) , in shooting the dialog box that give, you have two choices: New form expresses documentation (New Style Sheet File) and use at current page only (This Document Only) . Pitch on " New Style Sheet File " the process that you began to found External CSS. Before you are establishing a procedure truly, this option requirement names a style the watch first and for it make choice of saves option of positional; another, this Document Only, can write relevant code into the part to the page directly.
You also can be in " new form (New Style) " an existent form chooses to the watch will edit or add new definition in the dialog box.
Should receive External CSS repeatedly or guide?
After founding exterior style to express, you need to add it on every page (or it is pattern plate) . Want such doing, can go up in CSS face plate off-season " add style is expressed (Attach Style Sheet) " by button, can play a join right now exterior style is expressed (dialog box of Link External Style Sheet) , can browse the name that expresses to your target style above, after finding, you can choose join (Link) perhaps guides (Import) this exterior style watch.
Join is the most commonly used means, choice " Link " can join modal watch to the page. It can join the number below in your page:
All browsers that support CSS support join option. If you think a few older browsers (for instance Netscape 4.x) also can " see " if this style is expressed, be about to use the method below.
If you choose " guide " option, uses number is:
NetSscape4 will be complete the CSS that oversight guides, and will explain a page according to connective CSS. Such we can be at ease the new function in use CSS, need not worry about the compatibility problem of the browser.
CSS attribute is checked implement
Check in the attribute of DW MX implement in can easily switch arrives CSS mode. Below default circumstance, attribute is checked implement can show primitive HTML mode issues font ticket. Click menu is pulled below font on the side small " A " , you can see at present practicable CSS style is expressed, is not font label list.
In the meantime, you also can be cut easily recur HTML pattern.
Off-the-peg CSS style is expressed
An exciting CSS character in DW MX is it included the CSS type that already had made to express. The new user of CSS can experience first. Choose File>New, pitch on CSS Style Sheets chooses in shooting the new documentation dialog box that give, list of all practicable CSS can appear in the pane in right. To carry out the optimal habit that we say, choose a mark to be " Accessible " .
Protect documentation existence site folder inside, can add CSS in your documentation next with afore-mentioned method.
Design time style is expressed (Design Time Style Sheets)
When this one character of DW MX can let you work below design view, the form watch application reachs a page, let you have a more intuitionistic knowledge to the exterior of the site. Watch of design time style will not appear inside the site. Will tell from the viewpoint of our optimal habit, this one character is very useful. If you are used,guide at the same time with join two kinds of means (as above) , watch of style of add design time can let you use among them any to develop a site. Want to look to be like,express next page exteriors in another style when you when, you can be changed easily express for another style.
Carry to wanting to apply CSS at the server (for instance ASP, PHP, or ColdFusion) or it is to should be for the developer that client end is accessed through Javascript, watch of design time style is likewise useful. The server carries a style to express also is processing client end the browser supports another kind of bad way to CSS. But before in the DW of version, this kind of means cannot let you examine the practical effect of CSS in design phase however. Watch of design time style lets you examine a style to express the effect in real time, so you can be in DW MX work with can inspecting an interface. Another advantage uploads site file when you namely when, you need not reexamination is whole the site searchs redundant style to express.
Test and verify
No matter you are the modal list that he founds a style to express or the editor has, test and verify can ensure you won't misapplication nonstandard label or wrong code. DW MX itself does not include program of CSS test and verify, you can use the service of test and verify that W3C site provides. Inside DW MX you are OK HTML of test and verify or DHTML label (File>Check Page>Validate Markup (for HTML) or File>Check Page>Validate As XML For XHTML. ) . When development is based on the site of CSS, DW MX provided a lot of auxiliary tools. Had the help of MW MX, plus good to CSS understanding, you can develop the site that can undergo time test.

No comments:
Post a Comment