Skip to content

Technology Forum

SEO, Speed Up website, Server Optimization, Linux, Open Source Softwares

  • Home
  • General
    • Web Server
    • Website Formatting
  • IT Companies
  • Optimization
    • PHP
  • Linux
  • Home
  • General
  • Website Formatting
  • Shorthand CSS Properties
Web Server
HTTP header and Server Response Codes
HTML
HTML: Link rel – Preload
Plesk Panel
Parallels Plesk for Linux services logs and configuration files
Plesk Panel
Plesk: Self-Signed SSL Certificate
Plesk Panel
Plesk: Disable Nginx and Rebuild Httpd Configuration
Plesk Panel
Plesk: Disable Mail Service for domain

Shorthand CSS Properties

Posted on May 8, 2007May 20, 2008 By infoweb No Comments on Shorthand CSS Properties
Website Formatting

The CSS can be made clean with removing the properties names as mentioned below. This can help in reducing the size of CSS in the process of development of website.

Font

Use:

font: 1em/1.5em bold italic serif
…instead of
font-size: 1em; line-height: 1.5em; font-weight: bold; font-style: italic; font-family: serif

Border

Use:

border: 1px black solid
…instead of
border-width: 1px; border-color: black; border-style: solid

Background

Use:

background: #fff url(image.gif) no-repeat top left
…instead of
background-color: #fff; background-image: url(image.gif); background-repeat: no-repeat; background-position: top left;

Margin, padding, border

Use:

margin: 2px 1px 3px 4px (top, right, bottom, left)
…instead of
margin-top: 2px; margin-right: 1px; margin-bottom: 3px; margin-right: 4px

Use:

margin: 5em 1em 3em (top, left and right, bottom)
…instead of
margin-top: 5em; margin-bottom: 1em; margin-right: 1em; margin-right: 4em

Use:

margin: 5% 1% (top and bottom, left and right)
…instead of
margin-top: 5%; margin-bottom: 5%; margin-right: 1%; margin-right: 1%

These rules can be applied to margin, border and padding.

Tags: CSS CSS Optimization CSS Properties

Post navigation

❮ Previous Post: PHP Code Optimization
Next Post: HTTP header and Server Response Codes ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

View Posts

  • PHP FPM modification – Plesk
  • HTML: Link rel – Preload
  • HTML: Attributes of rel
  • Linux Commands
  • Security HTTP Headers

Categories

  • Domain Name
  • General
    • Servers
    • Web Server
    • Website Formatting
  • IT Companies
  • Linux
  • MySQL
  • Optimization
    • PHP
  • Troubleshooting
  • Web Hosting Control Panel
    • Plesk Panel
  • Websites
    • CSS
    • HTML
    • Optimization
  • Windows
    • Windows 10

Recent Posts

  • PHP FPM modification – Plesk
  • HTML: Link rel – Preload
  • HTML: Attributes of rel
  • Linux Commands
  • Security HTTP Headers

Copyright © 2025 Technology Forum.

Theme: Oceanly News by ScriptsTown