Dreamweaver set page width:How do I set the page width in Dreamweaver?
Q: How do I set the page width in Dreamweaver?
A: In Dreamweaver, you can set the page width by defining a CSS rule for the body or a container element. First, open your document and go to the CSS Designer panel (Window > CSS Designer). Create a new CSS rule by clicking the plus icon, and choose whether to html">apply it to the body tag or a specific class. In the rule definition, set the width property, for example, width: 960px; or a percentage like width: 80%;. If you want a fixed-width layout, specify a pixel value; for a fluid layout, use percentages. You can also set a maximum width using max-width to make the design responsive. After setting the width, you may need to center the container by adding margin: 0 auto;. Alternatively, you can use the Page Properties dialog (Modify > Page Properties) to set the page width under the Appearance category, but this method is less flexible than CSS. For best results, use CSS to control layout width and ensure consistency across your site.
Q: What is the recommended page width for a Dreamweaver website?
A: The recommended page width for a Dreamweaver website depends on your target audience and design goals. For a fixed-width layout, a common choice is 960 to 1200 pixels, as these widths accommodate most desktop screens and standard ad sizes. A width of 960px is a classic safe option that works well on older monitors, while 1200px is now more popular for modern displays. For responsive designs, you should avoid fixed widths and instead use relative units like percentages or set a max-width (e.g., max-width: 1200px;). This allows the layout to adapt to different screen sizes. Dreamweaver's Bootstrap templates often use a container width that is fluid up to a breakpoint. Consider your content: text-heavy sites may benefit from a narrower width (around 800px) for readability, while image galleries might need more space. Always test your design in multiple browsers and devices. Ultimately, there is no one-size-fits-all answer, but starting with 960px or 1200px for fixed layouts is a reliable html">approach.
Q: How can I set the page width in Dreamweaver without using CSS?
A: While CSS is the standard method for setting page width in Dreamweaver, you can also use HTML attributes or the Page Properties dialog for a non-CSS html">approach. One way is to use the width attribute on a table or a div, but this is outdated and not recommended for modern web design. For example, you could wrap your content in a <div width='960'> tag, but this is not valid HTML5. A better non-CSS method is to use Dreamweaver's Page Properties: go to Modify > Page Properties, then in the Appearance category, you can set the page width by entering a value in the 'Page width' field and choosing pixels or percent. This actually generates inline CSS or a style block, but it's done through the interface without writing code. Alternatively, you can use the Properties panel to set the width of a selected element like a table. However, note that using tables for layout is deprecated. For maintainable and responsive sites, it's strongly advised to use external CSS. If you must avoid CSS entirely, the Page Properties method is the most straightforward, but it's limited and not suitable for modern standards.
Words of experience
Common scenarios of "Dreamweaver set page width"
【Student】 Hey, I'm trying to set the page width in Dreamweaver. Can you help me?
【Instructor】 Sure! Are you working with a fixed width or a responsive layout?
【Student】 I want a fixed width, like 960 pixels. How do I do that?
【Instructor】 You can set the width in the CSS. Create a container div and set its width to 960px.
【Student】 Where do I add that CSS? In the head section?
【Instructor】 Yes, you can add it in a <style> tag in the head, or in an external stylesheet. Which do you prefer?
【Student】 I'll use an external stylesheet. How do I link it?
【Instructor】 In the head, add: <link rel="stylesheet" href="styles.css">. Then in styles.css, add: .container { width: 960px; margin: 0 auto; }
【Student】 What does margin: 0 auto do?
【Instructor】 It centers the container horizontally by setting top/bottom margin to 0 and left/right to auto.
【Student】 Okay, I added that. But my content still spans the full width. Why?
【Instructor】 Make sure your HTML content is inside the .container div. Did you wrap everything?
【Student】 Ah, I didn't. Let me wrap it. Now it's centered but there's a scrollbar. Why?
【Instructor】 That might be because of padding or borders adding to the width. Use box-sizing: border-box; on the container.
【Student】 Where do I add that? In the same rule?
【Instructor】 Yes: .container { width: 960px; margin: 0 auto; box-sizing: border-box; }
【Student】 Great, that fixed it. Now, how can I make it responsive later?
【Instructor】 You can change width to max-width: 960px; and add width: 100%; so it shrinks on smaller screens.
【Student】 So it would be: .container { max-width: 960px; width: 100%; margin: 0 auto; box-sizing: border-box; }?
【Instructor】 Exactly! That will keep it at 960px on large screens and adapt on smaller ones.

