Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do you keep your code clean?

Featured Replies

Was just wondering how people kept there code clean so they can edit and find things quicker and generally make it less stressful. Do you use loads comments, spaces, indentation etc etc.

 

 

For my html I like to keep all divs indented, plenty of line spaces and comments when closing one. Also recently I add comments to seperate header, footer, content section with something like this

 

<!-- *****// header //***** -->

 

For my CSS I keep everything on one linem for example #body {width:990px; height:800px; background-color: #FFF} etc rather than having it on multiple lines

 

 

Interested to see how people keep their own clean :)

  • Author

Could a mod also move this into the 'Website Design and Layout' section as I put this in here by accident :)

Could a mod also move this into the 'Website Design and Layout' section as I put this in here by accident :)

It's in the right forum, it's not a Design and layout issue :)

 

I tend to keep CSS on one line the same as you, and also use heading comments to split blocks of styles.

in my html i use indents for the content, use <!-- --> at end of divs

 

in my css i use multiple lines as its easier to find what i want

css Multi line in complete alphabetical order, floats, margins positions etc go in layout.css. Colors fonts backgrounds in content.css!

 

Xhtml is just standard stuff.... Indentation, plenty of white space, Comment where neccessary. PHP similar however I write everything OOP

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.