Freemote Logo

Coding Wiki

Most Common Coding Questions

Find answers to popular programming questions and level up your coding skills

Adding border around page in html

Learn how to add a border around a HTML page

Answer:

To add a border around a page in HTML, you can use the CSS box model. A CSS rule with the style attribute set to border can be applied to any HTML element.

html
<html><head><style>body {border: 1px solid #000;}</style></head><body></body></html>

You can adjust the border style, width, and color to suit your needs. The above code adds a black border around the entire page.

Alternatively, you can use inline styles on individual HTML elements if needed. However, using an external CSS file or stylesheet is generally more efficient and maintainable.

For more advanced styling options, consider using CSS properties like border-radius, box-shadow, or overflow to further customize your page's appearance.

Tags:
html
☾☾☾
+++++++++
Level Up Your Coding Skills

JavaScript Cheat Sheet

Remember the essentials of 5 different languages, it's free.