- The ordered list is created with the (ol) element.
- Each item in the list is placed between an opening (li) tag and a closing (/li) tag.
example :
<ol> <li>first item</li> <li>second item</li> ........... and so on </ol>
- The unordered list is created with the (ul) element.
- Each item in the list is placed between an opening (li) tag and a closing (/li) tag.
example :
<ul> <li>first item</li> <li>second item</li> ........... and so on </ul>
- The definition list is created with the (dl) element.
- (dt) is used to contain the term being defined.
- This is used to contain the definition.
example :
<dl><dt> HTML <dd> Hyper Text Markup Language used to describe the structure of a web page</dd></dt> <dt> CSS <dd> Cascading Style Sheets used to define styles for your web pages, including the design, layout and variations in display for different devices and screen sizes. </dd></dt> </dl>
CSS treats each HTML element as if it lives in its own box ,and we can set several properties that affect the appearance of these boxes.
The (min-width) property specifies the smallest size a box can be displayed at when the browser window is narrow.
The max-width property indicates the maximum width a box can stretch to when the browser window is wide.
In the same way that you might want to limit the width of a box on a page, you may also want to limit the height of it. This is achieved using the min-height and max-height properties.
The overflow property tells the browser what to do if the content contained within a box is larger than the box itself. It can have one of two values:
- hidden: This property simply hides any extra content that does not fit in the box.
- scroll This property adds a scrollbar to the box so that users can scroll to see the missing content.
If you specify a width for a box, then the borders, margin, and padding are added to its width and height.
The border-width property is used to control the width of a border. The value of this property can either be given in pixels or using one of the following values:
- thin.
- medium.
- thick.
- border-top-width.
- border-right-width.
- border-bottom-width.
- border-left-width.
You can control the style of a border using the border-style property. This property can take the following values:
- solid.
- dotted.
- dashed.
- double.
- groove.
- ridge.
- inset.
- outset.
- hidden / none.
- border-top-style.
- border-left-style.
- border-right-style.
- border-bottom-style.
- border-top-color.
- border-right-color.
- border-bottom-color.
- border-left-color.
The border property allows you to specify the width, style and color of a border in one property (and the values should be coded in that specific order).
The value of this property is most often specified in pixels (although it is also possible to use percentages or ems).
If a percentage is used, the padding is a percentage of the browser window (or of the containing box if it is inside another box).
- padding-top.
- padding-right.
- padding-bottom.
- padding-left.
The margin property controls the gap between boxes. Its value is commonly given in pixels, although you may also use percentages or ems.
If one box sits on top of another, margins are collapsed , which means the larger of the two margins will be used and the smaller will be disregarded.
- margin-top.
- margin-right.
- margin-bottom.
- margin-left.
If you want to center a box on the page (or center it inside the element that it sits in), you can set the (left-margin) and (right-margin) to (auto).
In order to center a box on the page, you need to set a width for the box (otherwise it will take up the full width of the page). Once you have specified the width of the box, setting the left and right margins to auto will make the browser put an equal gap on each side of the box. This centers the box on the page (or within the element that the box sits inside).
The display property allows you to turn an inline element into a block-level element or vice versa, and can also be used to hide an element from the page.
- inline.
- block.
- inline-block.
- none.
The visibility property allows you to hide boxes from users but It leaves a space where the element would have been. This property can take two values:
- hidden.
- visible.