Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is all very subjective as per the usual code formatting debates and I do not know of any formalized conventions.</p> <p>The method I've chosen is to use all lowercase classes and ids with underscores separating words (<code>#page_container</code> for example). I declare all my <strong>tag</strong> styles first (<code>html</code>, <code>body</code>, <code>ul</code>, etc.), then all classes and ids, sorted alphabetically. Additionally, all the styles defined in each class, id, or tag are defined alphabetically as well. Using this convention makes it easier to track down a particular style.</p> <p>For formatting, I always compress it as small as possible, but still legible. I put everything on one line with appropriate white space. If you have Visual Studio, you can specify this format and have it automatically formatted this way for you (Set Style to <strong>Compact rules</strong> under <em>Tools, Options, Text Editor, CSS, Format</em>).</p> <p>Naming conventions are extremely subjective here, but the thing to keep in mind is to name your elements as their intended purpose, not their styled meaning. For example, if you have a company slogan you want to style in a large, red font name the id <code>#slogan</code> instead of <code>#red_bold</code>.</p> <p>Here's a full example to give you an idea:</p> <pre><code>body { background-color: #fff; color: #999; font-family: verdana, arial, helvetica, sans-serif; font-size: 76%; padding: 0; margin: 0; } a { color: #2c5eb4; text-decoration: none; } a:hover { text-decoration: underline; } h1, h2, h3, h4, h5, h6 { color: #f70; font-family: helvetica, verdana, arial, serif; font-weight: bold; margin: 1.2em 0; } h1 { font-size: 2.4em; line-height: 1.2em; margin-bottom: 0em; margin-top: 0em; } h2 { font-size: 1.7em; } h3 { font-size: 1.4em; } h4 { font-size: 1.2em; font-weight: bold; } h5 { font-size: 1.0em; font-weight: bold; } h6 { font-size: 0.8em; font-weight: bold; } img { border: 0; } li, ol, ul { font-size: 1.0em; line-height: 1.8em; list-style-position: inside; margin-bottom: 0.1em; margin-left: 0; margin-top: 0.2em; } #content { clear: both; margin: 0; margin-top: -4em; } #columns { height: 36em; } #column1, #column2, #column3, #column4 { border-right: 1px solid #dbdbdb; float: left; width: 18%; margin: 0 0.5em; padding: 0 1em; height: 100%; } #column1 { width: 28%; } #column1 input { float: right; } #column1 label { color: #999; float: left; } #column2 a, #column3 a { font-weight: bold; } #column4 { border-right: 0; } #form { margin: 0 2em; } .help_button { float: right; text-align: right; width: 30px; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload