1 Can the first piece of code shortened?
If you are so concerned about the size than remove the <!-- button -->
html comment.
./wp-content/themes/cosmicbuddy/_inc/css/screen.css
is equivelent to:
wp-content/themes/cosmicbuddy/_inc/css/screen.css
Saving 2 characters :)
As it seems to me in the CSS file you can shorten the path to the images. Instead:
background: url(/wp-content/themes/cosmicbuddy/_inc/images/see.gif) no-repeat;
...
background: url(/wp-content/themes/cosmicbuddy/_inc/images/too.gif) no-repeat;
use relative URLs:
background: url(../images/see.gif) no-repeat;
...
background: url(../images/too.gif) no-repeat;
2 How can I create a CSS file that implements settings to more than one of these settings. Just like this one does in my CSS file to links:
If you don't want to add the CSS class to every element you have to wrap them in some other element
...
</head> <body>
<div class="buttons">
<a href="<?php bp_send_public_message_link() ?>" ></a>
<div class="buttons"><a href="<?php bp_send_public_message_link() ?>" ></a>
<div class="buttons"><a href="<?php bp_send_public_message_link() ?>" ></a>
<div class="buttons"><a href="<?php bp_send_public_message_link() ?>" ></a>
</div>
</body> </html>
And the CSS
.buttons a {
background: url(../images/see.gif) no-repeat;
border: 1;
cursor: pointer;
display: block;
height: 22px;
width: 22px;
margin-left: 5px;
}
.buttons a:hover {
background: url(../images/too.gif) no-repeat;
}
The cursor
is usually used if the href
attribute is not set.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…