Chat.css_class_element — alfred3_interact

Skip to main content
`Ctrl`+`K`

# Chat.css_class_element

property Chat.css_class_element: str

  Returns the name of the element’s CSS class.

  On the webpage generated by alfred3, all elements reside in some sort of container which has a CSS class of the element’s css_class_element. The name is composed as the element’s class name, followed by `-element`.

  Examples

  This is a simplified illustration of the html structure of a text element. Let’s say, the element was instantiated with the name “example_text”. The element’s css_class_element will be Text-element:

      >>> import alfred3 as al
      >>> ex = Text("This is an example", name="example_text")
      >>> ex.css_class_element
      Text-element

  The html code generated by this element is structured as follows

      <div class="Text-element-container" id="example_text-container">
        ...
        <div class="Text-element" id="example_text">
          <p>This is an example</p>
        </div>
        ...
      </div>

  Note that the element receives two CSS classes and two IDs, one each for the outer container and one for the innermost layer. The outer container includes the element’s base template (e.g. Element.html, or LabelledElement.html), while the inner layer includes the specific element- template (e.g. TextElement.html).