Go to GoReading for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture.

How to Hide a Portion of DIV

104 6
    • 1). Open your Web page document in a text editor by right-clicking on it, then clicking "Open With." Click to select "Notepad" or "WordPad" from the listed applications, then click "OK."

    • 2). Click to place your cursor on a blank line between the "<BODY>" and "</BODY>" tags.

    • 3). Type "<DIV style ='overflow:hidden; width:[x]px; height:[y]px;'>" to create the outer DIV container, then press "Enter." This is an opening DIV tag with CSS style code that defines the DIV "overflow" property as "hidden." Replace the "[x]" text in the tag with the width of the outer DIV in pixels. Replace the "[y]" text in the tag with the height of the outer DIV in pixels. For example, to create an outer DIV container with a width of 500 pixels and a height of 200 pixels, type "<DIV style='overflow:hidden; width:500px; height:200px;'>."

    • 4). Type "<DIV style="width:[a]px; height:[b]px;'>" to create the inner DIV container and press "Enter." Replace "[a]" with the inner DIV width in pixels and replace "[b]" with the inner DIV height in pixels. The defined width or height for the inner DIV container must be larger than the defined width or height of the outer DIV container. This will cause a portion of the inner DIV to be hidden by the outer DIV container's "overflow:hidden" property. For example, to create an inner DIV with a width of 600 pixels and a height of 300 pixels, type "<DIV style='width:600px; height:300px;'>."

    • 5). Type or paste the content you wish to display in the inner DIV container. A portion of this content (anything outside the outer DIV's defined height and width) will be obscured by the outer DIV.

    • 6). Type "</DIV>" to close the inner DIV container.

    • 7). Type "</DIV>" to close the outer DIV container.

    • 8). Click "File" and "Save" to save the Web page document.

Source...

Leave A Reply

Your email address will not be published.