-1

I have a question about this code from a tutorial on how to make an announcement box and float to the right. I am learning about classes, but this example doesn't have a class in a stylesheet - with a dot in front like I've been learning. I'm a bit confused on how or why this works. I thought you had have the class in a stylesheet and put in the html doc as class="xxx"

<div class="img-rounded border border-trbl border-round" style="float: right; background-color: #f0f4f3; width: 315px; height: 260px; margin-left: 50px; border: 1px solid #E8E8E0;">
TylerH
  • 20,816
  • 57
  • 73
  • 92
  • Either the `style` attribute has all the properties the div needs to do behave as it needs to do, or the html heades is using/importing an external css file – Josh Part May 23 '22 at 18:58
  • Thanks for the reply Josh Part. This is in the LMS Canvas which many colleges use as you may already know. There are limitations in the basic HTML code and there is no style sheet. I certainly didn't create one. I just pasted the code in and tweaked it. Everything works fine, but I just wanted to understand why the classes work without me having to create a style sheet. – Aaron G May 23 '22 at 19:09

0 Answers0