CSS Designer panel (Window > CSS Designer) is a CSS Property Inspector that lets you "visually"create CSS styles, files, and set properties, along with media queries.
The following sections are available in the CSS Designer interface:
- Sources: A collection of CSS files associated with the project
- @Media: Media queries to control the screen size
- Selectors: Selectors associated with the selected media query in the @Media panel
- Properties: Properties associated with the selected selector, with an option to show only the set properties
If you add media query conditions through code, only the supported conditions are populated in the Define Media Query dialog box. The Code text box in the dialog box, however, displays the code completely (including unsupported conditions).
If you click on a media query in the Design/Live view, the viewport switches to match the selected media query. To view the full size viewport, click Global in the @Media pane.
In the Selectors pane, click . Based on the element selected in the document, CSS Designer smartly identifies and prompts you with the relevant selector (upto three rules).
You can do one or more of the following:
- Use the up or down arrow keys to make the suggested selector more specific or less specific.
- Delete the suggested rule and type the required selector. Ensure that you type the name of the selector along with the denotion for the Selector Type. For example, if you are specifying an ID, prefix the name of the selector with a '#'.
- To search for a specific selector, use the search box at the top of the pane.
- To rename a selector, click the selector, and type the required name.
- To reorganize the selectors, drag the selectors to the required position.
- To move a selector from one source to another, drag the selector to the required source in the Source pane.
- To duplicate a selector in the selected source, right-click the selector, and click Duplicate.
- To duplicate a selector and add it into a media query, right-click the selector, hover the mouse over Duplicate Into Media Query, and then choose the media query.
Note: The Duplicate Into Media Query option is available only when the source of the selected Selector contains media queries. You cannot duplicate a Selector from one source into a media query of another source.
You can now copy styles from one selector and paste into another. You can copy all styles or copy only specific category of styles such as Layout, Text, and Border.
- If a selector has no styles, Copy and Copy All Styles are disabled.
- Paste Styles is disabled for remote sites that cannot be edited. But Copy and Copy All
styles is available.
- Pasting Styles that already exist partially on a selector (Overlapping) works. Union
of all the selectors is pasted.
- Copy-paste Styles also works for different linkages of CSS files – Import, Link, Inline
The properties are grouped into the following categories and are represented by different icons at the top of the Properties pane:
- More (list of 'text only' properties and not properties with visual controls)
Before editing the properties of a CSS Selector, identify the elements associated with the CSS Selector using Reverse Inspect. By doing so, you can evaluate if all the elements highlighted during Reverse Inspect actually require the changes.
Select the Show Set check box to view only the set properties. To view all the properties that you can specify for a selector, deselect the Show Set check box.
To set a property, such as, width or border-collapse, click the required options displayed adjacent to the property in the Properties pane.
Using the box controls in CSS Designer's Properties pane, you can quickly set the margins, padding, and position properties. If you prefer code, you can specify shorthand code for margin and padding in the quick edit boxes, as shown in this example.
Click the values and type the required value. If you want all the four values to be the same and changed simultaneously, click the link icon at the center.
At any point in time, you can disable or delete specific values, for example, left margin value while retaining the right, top, and bottom values.
Border Control properties are organized into logical tabs to help you quickly view or modify the properties.
If you prefer code, you can specify shorthand code for borders and border radius in the quick edit text box.
To specify the Border Control properties, first set the properties in the 'All Sides' tab. The other tabs are then enabled and the properties set in the 'All Sides' tab are reflected for individual borders.
When you change a property in the individual border tabs, the value of the corresponding property in the 'All Sides' tab changes to 'undefined' (default value).
During Inspect, the tabs are focused based on the priority of the "set" tabs. The highest priority is for "All sides" tab followed by "Top", "Right", "Bottom" and "Left". For example, if only the top value for a border is set, the computed mode takes the focus to the "Top" tab ignoring the "All sides" tab because "All sides" tab is not set.
The Disable/Enable CSS Property feature lets you comment out portions of CSS from the CSS Styles panel, without having to make changes directly in the code. When you comment out portions of the CSS, you can see what kinds of effects particular properties and values have on your page.
When you disable a CSS property, Dreamweaver adds CSS comment tags and a [disabled] label to the CSS property you’ve disabled. You can then easily re-enable or delete the disabled CSS property according to your preference.
You can disable or delete each property using the CSS Designer.
The following screenshot shows the disable and delete icons for the height property. These icons are visible when you hover your mouse on the property.
You can also use the delete and disable controls at the Border Control group level to apply these actions to all the properties.
You can add or delete CSS selectors and properties using keyboard shortcuts. You can also navigate between the property groups in the Properties pane.
|CTRL + Alt +[Shift =]||Adds Selector (If control is in the selector section)|
|CTRL + Alt+ S||Add Selector (If control is anywhere in the application)|
|CTRL + Alt +[Shift =]||Adds Property (If control is in the property section)|
|CTRL + Alt+ P||Adds Property (If control is anywhere in the application)|
|Select + Delete||Deletes selector, if selector is selected|
|CTRL + Alt + (PgUp/PgDn)||Jump between sections while in the properties subpanel|
Most often, a single CSS Selector is associated with multiple page elements. For example, text in the main content of a page, header, and footer text can all be associated with the same CSS Selector. When you edit the properties of the CSS Selector, all the elements associated with the Selector are affected, including the ones that you do not intend to change.
Live Highlight helps you identify all the elements associated with a CSS Selector. If you want to change only one elment or some of the elements, you can create a new CSS Selector for those elements, and then edit the properties.
To identify the page elements associated with a CSS Selector, hover your mouse over the Selector in Live View (with Live Code 'off'). Dreamweaver highlights the associated elements with dotted lines.
To lock-in the highlight for the elements, click the Selector. The elements now are highlighted with a blue border.
Live Highlight is enabled by default. To disable Live Highlight, click Live View options in Document Toolbar and click Disable Live Highlight.
When you edit an external CSS style sheet, all documents linked to that CSS style sheet are updated to reflect those edits.
You can export the CSS styles found in a document to create a new CSS style sheet, and attach or link to an external style sheet to apply the styles found there.
You can attach to your pages any style sheet that you create or copy into your site.