You cannot shorten this:
div#sbar {position:absolute;top: 10px;bottom: 10px;left:10px; right: 10px;}
But you could shorten this:
div#sbar {position:absolute;top: 10px;bottom: 10px;left:10px; right: 10px;} div#gbar {position:absolute;top: 10px;bottom: 10px;left:500px; right: 30px;} div#nbar {position:absolute;top: 10px;bottom: 10px;left:50px; right: 200px;}
For this:
div#sbar, div#gbar, div#nbar { position:absolute; top: 10px; bottom: 10px } div#sbar { left:10px; right: 10px } div#gbar { left:500px; right: 30px } div#nbar { left:50px; right: 200px }
This may be helpful.
In addition, there is no need to use the div in the div#sbar : id is unique by definition, so there is no need to qualify the id with the tag name. Using this actually (really, very slightly) slows down your browser.
So this would be better (and more precisely, shorter):
#sbar, #gbar, #nbar { position:absolute; top: 10px; bottom: 10px } #sbar { left:10px; right: 10px } #gbar { left:500px; right: 30px } #nbar { left:50px; right: 200px }
Here is an example where I really did something very similar to what I just suggested:
In this question, it really worked because all div contained in a common parent, so there was no need to list the elements twice.
source share