Writing Custom CSS in Custom HTML Elements + Correctly Referencing Layouts and Elements
It's tempting to reference custom CSS using Google Chrome's debugging tools to look up page layout IDs.
Here's an example:
This method works, but only temporarily in the long run. The right way to do this is by referencing elements by name instead of layout ID. This way, nothing breaks when you change page layouts and the IDs follow suit. By choosing the names of elements over IDs, the names will also remain the same when performing layout tests.
Here's where you can name a class in an Element Wrapper:
You can also add custom CSS to a Custom HTML element:
Using a naming structure should help you organize your site build and make layout testing a smooth operation.
If you have any questions about how this works, contact your account manager today.