1

This code creates a (what looks like, roughly) 1px solid border that is grey around the img. I set the images border to none, but it doesn't remove the border.

Here's the code :

<label>
  <img style="width:200px;height:200px">
</label>
j08691
  • 204,283
  • 31
  • 260
  • 272
Wyatt
  • 445
  • 3
  • 12

2 Answers2

3

This is a side effect of your HTML being invalid. Use a validator.

An img element must have a src. Specify what image you want to load and the border goes away.

<label>
  <img  src="https://images.vexels.com/media/users/3/137685/isolated/lists/c078654c8b1501b4c9ee784a330210e5-logo-geometric-polygonal.png" style="width:200px;height:200px">
</label>

If you want a box of certain dimensions without loading an image: Use a div or a different element.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

your img tag syntax is wrong. You have:

<label>
   <img style="width:200px;height:200px;">
</label>

but it should be:

<label>
   <img src="myimage.jpg" style="width:200px;height:200px;">
</label>

then the border will disappear! if you just want a white square use:

<label>
   <div style="width:200px; height: 200px;"></div>
</label>

let me know if you need any more clarification!

FutureCake
  • 2,614
  • 3
  • 27
  • 70