I googled it, but didn't find a satisfactory answer. Do I change the CSS file or the PHP file?
Secondly, is there a better way of getting more than one image to appear on a page than copy-pasting the php code like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IS THIS THING ON?</title>
<link rel="stylesheet" href="./wp-content/themes/cosmicbuddy/_inc/css/screen.css" type="text/css" />
</head>
<body>
<a href="<?php bp_send_public_message_link() ?>" class="myButton"><!-- button --></a>
</body>
</html>
While this is the CSS code:
.myButton {
background-image: url(/wp-content /themes/cosmicbuddy/_inc/images/kaksnuppu.gif);
height: 22px;
width: 22px;
margin-left: 5px;
display:inline;
}
.myButton:hover {
background-position: 0px 25px;
}
Thanks a lot!
First off you only need to declare the page once:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>IS THIS THING ON?</title> <link rel="stylesheet" href="./wp-content/themes/cosmicbuddy/_inc/css/screen.css" type="text/css" /> </style> </head> <body> <!-- Content goes here --> </body> </html>
Any content should be in between the body tag.
Second, you can display images using this code:
<img src="dir/image.jpg" width="x" height="x" alt="Alt Title">
You can repeat this code as many times as you want inside the <body>
tags.
Looking at your CSS you're declaring the element to be BOTH block and inline.. one is overriding the other
I would suggest changing your CSS to be inline-block .
(see the edited code)
Also see the suggestions from @David Nguyen
.myButton {
background-image: url(/wp-content /themes/cosmicbuddy/_inc/images/kaksnuppu.gif);
height: 22px;
width: 22px;
margin-left: 5px;
display:inline-block;
}