

Now that you have a styling rule for your element, every element you add to your page will be styled in the precisely the same manner. Your webpage should display a green box 100 pixels wide and 100 pixels tall as specified by the CSS rule: (For instructions on loading an HTML file, please visit our tutorial step How To View An Offline HTML File In Your Browser). Save the index.html file and reload it in your browser. Notice that the element has opening and closing tags but does not require any content. Next, add the following CSS rule for the tag selector: Erase everything in your styles.css file (if you added content from previous tutorials). Let’s try a hands-on exercise to study how the element works.

To follow this tutorial, make sure you have set up the necessary files and folders as instructed in a previous tutorial in this series How To Set Up You CSS and HTML Practice Project. To specify the size, color, and other properties of a element, you can assign it style rules using CSS. On its own, the element typically has little visual effect on the presentation of a webpage. The element is used by adding opening and closing tags to an HTML document.

These skills will prepare you to use elements as layout tools later on in the series when you begin recreating the demonstration website. In this tutorial, you will create and style elements, as well as learn how to add and style other elements inside a container. The element can be used to structure the layout of a page and break up a webpage into separate components for individual styling. This tutorial will introduce you to styling the HTML Content Division element-or element-using CSS. If you don’t have familiarity with HTML, you can follow the first ten tutorials of our series How To Build a Website With HTML before starting this series. You may follow the entire series to recreate the demonstration website and gain familiarity with CSS or use the methods described here for other CSS website projects.īefore proceeding, we recommend that you have some knowledge of HTML, the standard markup language used to display documents in a web browser. This tutorial is part of a series on creating and customizing this website with CSS, a stylesheet language used to control the presentation of websites.
