stuart7398 Posted April 14, 2008 Share Posted April 14, 2008 Hi. The css code below are for 3 buttons. They are all the same apart from the 'padding-left' property. Is it possible to have just one piece of code to apply to all buttons, then a separate piece of code to control the 'padding-left' property? Any help is appreciated. Thanks, Stuart. .button_apply_now { position: absolute; left: 8px; top: 3px; margin: 0px; padding-left: 1em; cursor: pointer; } .button_training { position: absolute; left: 8px; top: 3px; margin: 0px; padding-left: 1.8em; cursor: pointer; } .button_answers { position: absolute; left: 8px; top: 3px; margin: 0px; padding-left: 1.7em; cursor: pointer; } Quote Link to comment https://forums.phpfreaks.com/topic/101116-same-code/ Share on other sites More sharing options...
ToonMariner Posted April 14, 2008 Share Posted April 14, 2008 .button_apply_now , .button_training , .button_answers { position: absolute; left: 8px; top: 3px; margin: 0px; padding-left: 1.7em; cursor: pointer; } .button_apply_no { padding-left: 1em; } .button_training { padding-left: 1.8em; } .button_answers { padding-left: 1.7em; } Quote Link to comment https://forums.phpfreaks.com/topic/101116-same-code/#findComment-517150 Share on other sites More sharing options...
stuart7398 Posted April 14, 2008 Author Share Posted April 14, 2008 Nice one! Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/101116-same-code/#findComment-517166 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.