Hey Paul!
You're experiencing issues with how your code is being saved or formatted. This can happen if the editor you're using doesn't preserve formatting or if it has settings that remove whitespace and line breaks upon saving. Here are a few things you can check:
Editor Settings: Look for options related to formatting or saving in your code editor. Some editors have settings to preserve indentation or format code automatically.
File Type: Ensure you're saving the file with the correct extension that your editor recognizes, as some extensions might affect how formatting is handled.
Prettier or Linters: If you're using a tool like Prettier or ESLint, make sure it’s configured to retain your formatting preferences.
Manual Formatting: After saving, you can manually format your code using built-in formatting commands (like Format Document) in many editors.
As for your second question, the practice of using indentation and nested elements is generally referred to as "code indentation" or "nesting." It helps improve readability by visually representing the structure of the code. The specific example you gave, using <div> tags in that way, is simply nesting <div> elements, which is common in HTML for organizing layout.
Many thanks, Mary
Receiptify
You're experiencing issues with how your code is being saved or formatted. This can happen if the editor you're using doesn't preserve formatting or if it has settings that remove whitespace and line breaks upon saving. Here are a few things you can check:
Editor Settings: Look for options related to formatting or saving in your code editor. Some editors have settings to preserve indentation or format code automatically.
File Type: Ensure you're saving the file with the correct extension that your editor recognizes, as some extensions might affect how formatting is handled.
Prettier or Linters: If you're using a tool like Prettier or ESLint, make sure it’s configured to retain your formatting preferences.
Manual Formatting: After saving, you can manually format your code using built-in formatting commands (like Format Document) in many editors.
As for your second question, the practice of using indentation and nested elements is generally referred to as "code indentation" or "nesting." It helps improve readability by visually representing the structure of the code. The specific example you gave, using <div> tags in that way, is simply nesting <div> elements, which is common in HTML for organizing layout.
Many thanks, Mary
Receiptify
Statistics: Posted by mary456philips — Tue Oct 29, 2024 10:34 am