How can I style fields in custom content type I am using Drupal 8 and I've made a custom content type, and I've figure it out, that I can "style" this content type with page--mycontenttype.html.twig and with adding this code in mytheme.theme:

function mythemename_theme_suggestions_page_alter(array &amp;$suggestions, array $variables) {

  if ($node = \Drupal::routeMatch()-&gt;getParameter('node')) {
    $content_type = $node-&gt;bundle();
    $suggestions[] = 'page__'.$content_type;
  }
}


But with this I can only style page of custom content type, and not the fields of it. I try with this but it's not working:

{{ node.field_body.value }}
{{ node.field_title.value }}
The body and title have no prefix field_, this should work:

{{ node.body.value }}
{{ node.title.value }}


But is not the preferred way to style the fields on the page level. If you access the field values in the database, which you basically do when you access the node object, you get the raw value, only escaped by twig for security reasons. Without the formatting, that is integrated into drupal for each field type, and that you can easily extend with additional modules.

To style the fields of the custom content type go to:

admin/structure/types/manage/mycontenttype/display


If you can't find all the options you need for your fields in the ui, you can make a copy of the field twig and apply the changes there.

field--field-myfield.html.twig