A box model test page with box-sizing

Below are two bordered DIV elements. They have exactly the same CSS styles, with one exception: The top one has box-sizing: border-box, and the bottom one does not.

Ravana carries Sita away to Lanka, where Sita is kept under the heavy guard of rakshasis. Ravana demands Sita marry him, but Sita, eternally devoted to Rama, refuses. Rama and Lakshmana learn about Sita's abduction, and immediately set out to save her. During their search, they meet the demon Kabandha and the ascetic Shabari, who direct them towards Sugriva, the monkey king, and Hanuman.

Having received Hanuman's report on Sita, held prisoner in Lanka, Rama and Lakshmana proceed with their allies towards the shore of the southern sea. There they are joined by Ravana's renegade brother Vibhishana. The monkeys construct a giant floating bridge across the ocean, and the princes and their army cross over to Lanka. A lengthy battle ensues, in which Rama eventually kills Ravana.

The top bordered DIV element is constrained to the width specified for all DIVs on this page — including the DIV that encloses this paragraph. The bottom bordered DIV is wider because the border width and the padding width have been added to the DIV's specified width (which may be given in rems, ems, pixels, or percent).

Read more about box-sizing and the box model.