- 1). Open your HTML file in a text or HTML editor.
- 2). Locate the element you want to change the width for and insert the style coding:
<div style="width:300px">
<h2>Level Two Heading</h2>
<p>Paragraph of text</p>
</div>
The data block width is set to 300 pixels. - 3). Type the code to control the width of a single paragraph:
<p style="width:250px;">Paragraph where all data flow will be constrained to a width of 250 pixels.</p> - 4). Save the HTML file and view it in an Internet browser to test the modifications.
previous post