Monday, October 5, 2009

Dreamweaver uses CSS style to express setting webpage

If why this article introduction uses cascade style to express in Dreamweaver (the text format in CSS) setting page. You can use the way that CSS cannot offer with HTML to set text format and fixed position text, thereby the exterior of page of control of ground of more can agile freely.

Understand CSS

Cascade style is expressed (CSS) is a series of format setting regulation, they control the outward appearance of Web page content. When use CSS sets page pattern, content and type of watch reveal one's true features are mutual departure. Page content (HTML code) in the HTML file that is located in oneself, and the CSS regulation that defines code to behave a form is located in another file (exterior style is expressed) or the another part of HTML documentation (it is a part normally) in. Use CSS is very OK the outward appearance that controls a page better neatly, wait to specific font and style from exact position fixed position.

CSS makes you can be controlled a lot of use the property with uncontrollable HTML only. For example, you can choose text to appoint different font measurement and unit for place (wait for) like value of element, pound. Set font size in order to resemble element for the unit thereby through using CSS, still can ensure with more consistent pattern in many browsers processing page layout is mixed the exterior.

CSS format installs regulation to comprise by two parts: Enzymatic Qia of shaddock of Yan of add of Qian Ye of have a nightmare of Jin of ≡ of Q of a huge legendary turtle of  of exuviate of ≡ Jin Jie all  ? if P, H1, kind the term of name or ID) , and statement is used at defining modal element. In the give typical examples below, h1 is selector, interpose at big bracket (all content between {}) are statement:

It is quotative content below:

H1 {

Font-size:16 Pixels;

Font-family:HElvetica;

Font-weight:bOld;

}
  


Statement divides composition by two: Sell? is like Font-family) and value (like Helvetica) . Afore-mentioned give typical examples established a pattern for H1 label: The lip embraces sauce search  to fall the text of label of?H1 you  will be 16 size resembling element use Helvetica font and thick system.

" of term " cascade is to point to right same an element or the capacity that Web page uses many types. For example, can found regulation of a CSS to use color, found another regulation to apply an edge to be apart from, next the identical text version that will both in a page applying. " of defines modal " cascade arrives the element on your Web page, establish the design that you want finally.

The main good point of CSS is to update; easily to want to undertake updating to handling CSS regulation only, the form that uses all this documentation that define a style is met it is new form newlier automatically.

The following and regular kind can define in Dreamweaver:

Define CSS regulation oneself (also call " kind modal ") makes you can use modal property any text limits or text version piece. All kind of style all with period (. ) begin. For example, you can found those who call.red kind of style, the Color attribute that sets regulation is red, use this type in the stage text version that already defined a style partly next.

HTML label regulation defines specific label again (the format that is like P or H1) . When the CSS that found or changes H1 label is regular, all label that use H1 installed the text of the format to be able to be updated instantly.

CSS selector is regular (advanced type) the format that defines specific element combination again, or the format of the selector form that other CSS permits (for example, every time when H2 caption appears inside form unit division, apply selector Td H2) . The format that advanced type still can define the ticket that includes specific Id property again (for example, the style that defines by #myStyle can use property / the label) that is worth pair of Id="myStyle" .
   Found new modal table

Above all, you will be founded contain CSS regulation (style of definition stage text version) exterior style watch. When the pattern is established in exterior style watch, can control the outward appearance of many Web page at the same time in a central position, and do not need to be every Web page to set a pattern respectively.

CSS regulation can be located in the following position:

Watch of exterior CSS style is memory in an alone exterior.css file (be not HTML file) a series of medium CSS are regular. Use the link in documentation Head part, this.css file is received by catenary the one or more page in Web site.

In-house (or embedded) CSS style watch is to contain a series of CSS regulation inside the Style label of part of HTML documentation Head. For example, the give typical examples below is all text in the documentation that already set paragraph label to define font size:

: <head>
<style>P{Font-size:80px
}
</style>
</head> :  


Couplet style is the definition in the specific label example in HTML documentation inside. For example,

" P Style="font-size: 9px" "

Contain to using only inside the size of paragraph definition font that the label of couplet style set a pattern.

The most style attribute that Dreamweaver can present your place to apply is in window of " documentation " show them. You also can preview documentation in browser window in order to examine applied case of the style. The outward appearance that attribute of some CSS style presents in Microsoft Internet Explorer, Netscape Navigator, Opera and Apple Safari is not same.

">" of choice " file builds " .

The " category " in documentation " dialog box is built in " " of the choice in the row is basic page " , "CSS" chooses in row of " of " basic page, click " to found " next.

Blank style watch will appear in window of " documentation " . "Design " view and pushbutton of view of " code " already were banned to use. CSS style watch is simple text file, its content will not be used at be being examined in the browser.

Save this page (" file ">" saves ") to be Cafe_townsend.css.

When saving a style to express, ensure please save its Cafe_townsend Folder folder (the root folder of your Web site) in.

The following code keys in in modal watch:

P{
Font-family: Verdana, sans-serif;
Font-size: 11px;
Color: #000000;
Line-height: 18px;
Padding: 3px;
}


When you key in code, dreamweaver suggests use code clew for you a few option, finish an input in order to help you. When seeing hope Dreamweaver finishs the code that key in for you, bolt by Enter please (Windows) or Return key (Macintosh) .

The attribute that does not forget to be in in every ending adds a branch at the back of the value.

The code after finishing is similar to the give typical examples below:

If want to show this guideline, choose " to help ">" referenced " please, consult from " the "O'Reilly CSS of the choice in playing menu giving form of " face plate consults next " . Save a style to express.

Add style is expressed

the style when you the watch adds when Web page is medium, the corresponding element that will use to the page in the regulation of the definition in modal watch. For example, cafe_townsend.css style when you the watch adds when Index.html page, set the CSS regulation that defines according to you all stage text version (the text that sets a pattern with the label in HTML code) format.

In window of " documentation " , open the Index.html file of Cafe Townsend. (If this file already was opened, the option that clicks it please gets stuck. The option that clicks it please gets stuck..

The choice is in tutorial: Kuo takes the advantage of Qia of deep and remote a surname of beautiful press and smooth to surname Cheng  to uncover joyous Wo of show off of male of the instrument that take the advantage of Ma to be sought
  



Check in " attribute " implement in examine, ensure use paragraph label set the pattern of this paragraph.

If " attribute " is checked implement medium " format " plays menu giving form to show " paragraph " , already used paragraph label to set the pattern of paragraph. If " attribute " is checked implement medium " format " plays menu giving form to show " does not have " or other content, choose " paragraph " to set the pattern of paragraph.
  



Repeat the 3rd situation to the 2nd paragraph.

In face plate of "CSS style " (in ") of style of " window ">"CSS, click be located in face plate right the " add style of next horn expresses " pushbutton.


In " add and exterior style expresses " dialog box in, click " to browse " and browse the Cafe_townsend.css file that founds to on one.

Click " to decide " .

"The text in documentation " window will express medium CSS regulation to set a pattern according to exterior style.

Study face plate of "CSS style "

"Face plate of CSS style " can let you follow the CSS regulation that footprint affects current place to choose page element and attribute, or the regulation that affects whole documentation and attribute, the case that still can not making above ministry style express leaves modification CSS property.

Ensure Index.html page is opened in window of " documentation " please.

In face plate of "CSS style " (in ") of style of " window ">"CSS, click all " " of face plate coping, the CSS that checks you next is regular.

In " all " mode falls, CSS face plate shows to you all CSS that apply current documentation are regular, no matter these regulation are to be in exterior style watch, still be in oneself documentation. You should be in " place sees two main categories in case of well-regulated " window: Post? label category and category of a Cafe_townsend.css.

If did not launch label category, click plus please (+ ) launch this category.

Click text regulation.

In the case of window of " attribute " that is worth the Background-color attribute that is #000000 to appear below.

Notice you may need fold other face plate, be like face plate of " file " , so that see face plate of complete "CSS style " , still can move the border between window case to change the length of face plate of "CSS style " through procrastinating.

You are in tutorial: Bursa of Song of Dang of Yi of labial ɑ  takes the advantage of Li season to plant model the setting that? of ü  A Chinese-style unlined garment revised dialog box of page attribute " to install a page is lubricious. When installing page attribute with this means, dreamweaver can write inside the CSS style of park documentation.

Click plus (+ ) launch Cafe_townsend.css category.

Click P regulation.

All attribute that define for P regulation in exterior style watch and value will show the window of " attribute " below in case.

In window of " documentation " , any positions in two stage that just set a pattern are clicked.

In face plate of "CSS style " , click the " current " of face plate coping, examine your CSS type next. In mode of " current " , CSS face plate shows to you current place chooses the summary of the attribute of content. The attribute of regulation of the P in indication attribute and exterior style watch is opposite should.

In issueing, you establish face plate of " of use "CSS style new regulation. Face plate of " of use "CSS style founds new regulation to be moved than the hand it is easy to key in regulation much, the operation when latter is expressed as establishing exterior pattern at first is same.

Establish new CSS regulation

In this section, you found face plate of " of use "CSS style the CSS that defines oneself regular or kind style. Kind the style makes you OK set any range or the modal attribute of text piece, OK to any HTML label applying. The more information of the CSS regulation that concerns different type, refer to understanding CSS please.

In face plate of "CSS style " , click face plate right the " of next horn builds CSS regular " .

CSS regulation is built in " in " dialog box, choose " from inside option of " of " selector type kind " . This option should be acquiescent pitch on.

.bold is inputted in casing of text of " name " .

Ensure period (is keyed in before word "bold" . ) . All kind of style must with period begin

In " the definition plays menu giving form in " in, choose Cafe_townsend.css. This file should be acquiescent pitch on.

Click " to decide " .

Occurrence "CSS regulation defines " dialog box, state you are founding to call kind of pattern of.bold in Cafe_townsend.css file.

In dialog box of " of "CSS regulation definition, execute the operation below:

In casing of text of " font " , input Verdana, sans-serif.

In casing of text of " size " , input 11, tightening the choice in relying on its to play menu giving form rightly to resemble element.

In casing of text of " travel tall " , input 18, tightening the choice in relying on its to play menu giving form rightly to resemble element.

Play " of thick substance of " of the choice in menu giving form from " of " degree of finish.

In casing of text of " color " , input #990000.

Clew concerns the more information of CSS attribute, refer to the O'Reilly referenced guideline that includes in Dreamweaver please. If want to show this guideline, choose " to help ">" referenced " please, consult from " the "O'Reilly CSS of the choice in playing menu giving form of " face plate consults next " .

Click " to decide " .

The pushbutton of " all " that clicks top of face plate of "CSS style " .

If did not launch Cafe_townsend.css category, click the plus on the side of this category (+ ) pushbutton.

You can see, dreamweaver already.bold kind in the regular list that the style adds in watch of outer ministry style to define. If you are in," place clicks.bold regulation in case of well-regulated " window, criterion this regular attribute will appear in case of window of " attribute " . New regulation still appears in " attribute " to check implement " style " plays menu giving form in.

Will kind the style uses text version

Now, you had founded kind of regulation, use this regulation certain stage text version.

In window of " documentation " , before 4 words of the text in choosing the first paragraph: CAfe Townsend's Visionary Chef.

Check in " attribute " implement (in ") of attribute of " window ">" , play "bold" of the choice in menu giving form from " style " .

"Thick substance " kind the text version that the style will use you.

Repeat the 2nd situation, " of " thick substance kind before 4 words that the style uses to the 2nd paragraph.

Save a page.


Install navigation the format of text

Next, you use use CSS navigation the type link text. The chromatic histogram that a lot of Web pages use embedded text version resembles found navigation. But, if use CSS, what what you need to install is link text is mixed only a few formats. Through using Display: Block attribute and the width of setting piece, you found rectangle effectively, and do not need to use image additionally.

Establish new regulation for navigation

If did not open Cafe_townsend.css file, open this file, or click its option card to show this file.

Define a new regulation, the method is the.bold in this file kind the following code keys in at the back of the style:

.navigation {

}

This is an empty regulation.

The code in the file should be similar to the give typical examples below:

Save Cafe_townsend.css file.

Next, you add face plate of " of use "CSS style attribute to regulation.

If did not open Index.html file, open this file.

In face plate of "CSS style " , ensure pitch on mode of " all " , opt new.navigation regulation, click face plate next right the " of " editor style of next horn.

In dialog box of " of "CSS regulation definition, execute the operation below:

In casing of text of " font " , input Verdana, sans-serif.

Play the option in menu giving form from " size " 16, choose to resemble element from inside relying on its closely to play menu giving form rightly next.

It is normal to play " of the choice in menu giving form from " style " " .

From " " of the choice in got-up " list does not have " .

Play " of thick substance of " of the choice in menu giving form from " of " degree of finish.

In casing of text of " color " , input #FFFFFF.

If want to show this guideline, choose " to help ">" referenced " please, consult from " the "O'Reilly CSS of the choice in playing menu giving form of " face plate consults next " .

Click " to decide " .

Now, you add face plate of " of use "CSS style more attribute to.navigation regulation.

In face plate of "CSS style " , ensure pitch on.navigation is regular, click " to show list view " next.

List view can make case of window of " attribute " shows all and usable attribute alphabetically (with " view of setting attribute " differs, "View of setting attribute " shows the attribute) that already installed only.

Click the row of Background-color property right.

If want to examine the complete content of attribute, keep mouse hand on this attribute please.

Input hexadecimal value #993300, bolt by Enter next (Windows) or Return key (Macintosh) .

If clew wants to examine the impact that ministry style expresses outside your labour oppose, maintain Cafe_townsend.css file to be in in window of " documentation " when you work please open position. The choice is made in face plate of "CSS style " when you when, will see Dreamweaver write CSS code in modal watch at the same time.

Find Display property (the likelihood needs to be down scroll) , click in the row of right, choose Block from inside playing menu giving form next.

Find Padding property, click in the row of right, the input is worth 8px, bolt by Enter next (Windows) or Return key (Macintosh) .

Find Width property, click in the row of right, input in casing of the first text 140, from inside playing menu giving form the choice resembles element, bolt by Enter next (Windows) or Return key (Macintosh) .

Click " to show setting attribute " , so that be in case of window of " attribute " ,show the attribute that you install only.

Click Cafe_townsend.css file in order to show this file. You will see, all property that Dreamweaver has specified you are added in this file.

Save and shut Cafe_townsend.css file.

Now, you had founded article of navigation of a setting the regulation of this format. Next, you should use this regulation place to choose a link.

Application is regular

Index.html page is opened in window of " documentation " , click word Cuisine to will insert bit of park a certain position in this word.

In label selector, click most the label of right.

This operation will be designation label or the link chooses all text version.

Check in " attribute " implement (in ") of attribute of " window ">" , play "navigation" of the choice in menu giving form from " style " .

In window of " documentation " , the exterior of Cuisine text produced change completely. The attribute that.navigation regulation defines is in getting on according to you, the format of this text already was installed to be navigation now pushbutton.

To navigation every medium link, repeat the 1st pace to arrive the 3rd pace.

You must allocate a navigation for every label or link kind style, accordingly, individual choice of use label selector is linked every, next it is very important that one by one distributes kind of form for each link.

If have difficulty,be in when the pattern that sets link text, ensure please every (or every groups) case is free between the word of the link (not be carriage return) . Ensure the blank space itself between two links was not linked even. If blank space already was linked, choose the blank space of the link carefully please, check in " attribute " implement in casing of text of " of cleared " link, bolt by Enter (Windows) or Return key (Macintosh) .

Finish pair of navigation after the format of all words is installed, save this page, the job that previews you in the browser next (" file ">" previews ") in the browser.

You can click a link in order to ensure its are effective.

Add a mouse to pass the effect

Now, you will add a mouse to pass the effect, make navigation piece setting color is in color is changed when mouse finger passes a certain link every time. If want to add a mouse to pass the effect, add please include: HOver bogus kind new regulation.

About... about: HOver bogus kind bogus kind the means that is a kind of certain element in affecting HTML documentation, it is not the HTML code that is based on documentation itself, the other that is based on Web browser application however is exterior condition. Bogus kind can be trends, this makes clear when user and documentation are alternant, the element on the page may be gotten or lose bogus kind.

When the user keeps mouse hand on the page element that already set a pattern, : HOver bogus kind the change that can affect this element. For example, will: HOver bogus kind add.navigation kind style (.navigation:hOver) in order to establish new regulation when, according to.navigation:hThe attribute of Over regulation, all text elements that set a pattern with.navigation regulation can produce change.

Open Cafe_townsend.css file.

Opt whole.navigation regulation.

Duplicate text (duplicate ") of " editor ">" .

Click in this regular fine, bolt by a few Enter more next (Windows) or Return key (Macintosh) in order to found a few blank space.

Will duplicate already text is stickup (in the blank space that stickup ") of " editor ">" goes to to just was founded.

Will: HOver bogus kind in adding stickup already.navigation selector, following place show:

In new.navigation:hIn Over regulation, will current background is lubricious (#993300) is replaced for #D03D03.

Save and shut this file.

Index.html file is opened in window of " documentation " , preview this page in the browser next (" file ">" previews ") in the browser.

When you keep mouse hand on any link, can see new mouse passes the effect.

No comments:

Post a Comment