How to Build an Internal CSS Style Sheet

Internal style sheets, or CSS, are useful web tools if you want to apply a unique style to a single web page, or if you want to test a defined style across one web page before applying it across multiple pages of a large website. Unlike its cousin, the external style sheet, the internal style sheet code is placed directly into the page it affects; therefore, it requires no additional files. Take advantage of this web styling tool by following these steps.

Things You'll Need

  • Computer with Internet access
  • HTML editor software
  • Web browser
Show More

Instructions

    • 1

      Use your favorite HTML editor or Notepad software program to define the web page style.

    • 2

      Define the style of the elements of the web page you want to affect. The CSS structure requires a definition for a selector, property and value. The following cascading style sheet code defines the style for the body and a header.



      body {

      font-size: 12px;

      background-color: #cccccc;

      }

      h1 {

      font-size:24px;

      color:red;

      }

    • 3

      Open the web page that you want to stylize. Put the following "style" tags inside the "head" tags of the web page.




    • 4

      Paste the CSS code defined in "Step 2" between the "style" tags as in the following example and save the page.

    • 5

      Upload the page to your web server.

    • 6

      Test the CSS code that you created. Display the web page into a web browser. The page shows the defined CSS style if the code has been defined properly.

Tips & Warnings

  • Be aware that web pages with internal style sheets must load the style information each time the page is loaded. A large block of code increases page download time.

Related Searches:

Resources

Comments

You May Also Like

Related Ads

Featured