Border..... Color,Width and Style

Can anyone tell me what is wrong with the border here ?

If you want the thick-green-border class you should write that code in this way:
img>.thick-green-border

Also, the </p> doesn’t have any sense

your syntax is wrong.
use css class selector i.e the dot “.” character.
so your code will look like this

img > .thick-green-border {

}

Thanks for your help .
But I still haven’t got past it .

img>.thick-green-border
{ border-color: green;
border-width: 10px;
border-style: solid;
}

WHATS WRONG WITH THIS ?

You’re using a direct descendant > selector in there and you shouldn’t be img elements cannot contain children.

Your selector says style all elements with a class of .thick-green-border which are a direct descendent of an img tag.

Presumably you want to style the image, for which you can use:

img.thick-green-border{
   border-color: green;
   border-width: 10px;
   border-style: solid;
}

Or, better yet,

.thick-green-border{
   border-color: green;
   border-width: 10px;
   border-style: solid;
}

That way you can use the style on elements other than images.

Or, finally, as a one liner, since CSS supports it for many properties:

.thick-green-border{
   border: solid 10px green;
}

Regards,
Micheal

2 Likes