I am trying to define a border around a div tag in HTML. In some browsers the border does not appear.
Here is my HTML code:
As per the W3C:
Since the initial value of the border styles is 'none', no borders will be visible unless the border style is set.
In other words, you need to set a border style (e.g. solid
) for the border to show up. border:thin
only sets the width. Also, the color will by default be the same as the text color (which normally doesn't look good).
I recommend setting all three styles:
style="border: thin solid black"