PDA

View Full Version : css help...


Winterworks
02-22-2009, 12:55 PM
This is a code in my index.php.

<div class="testimonial_smiley">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

"test test hehe test rofl"

</div>

Here is part of my CSS.

.testimonial_smiley {
float:left;
width:200px;
height:32px;
text-decoration: none;
font-size: 12px;
color: #000000;
background:url('images/smiley.png') no-repeat top left;

}

So right now, it shows the smiley icon (32px by 32px), but the text only aligns beside it because I added all of those &nbsp;'s. How can I make the text align beside the smiley image only? Like align it to the left by 34px or something (the image is 32px width and height).

Also, in CSS, how can I make the text italic? Do I just edit "text-decoration: none;" to "text decoration: italic;"? What do I do?

edit: to clarify on #1, I want it so like..


[img here] Text aligns
like this
all the way
down the
page.


instead of...


[img here] Text aligns
like this
all the way
down the
page.

UKBusinessLive
02-22-2009, 01:31 PM
Mike take a look at the following ;)
Add this to your <head> of your Page

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
<style type="text/css"><!--
.sign {
font-style:italic;
}
--></style>
</head>

and In the <body> where you want to make the words italic, just use

<span class ="sign"> Your Text here </span>

look at the example below mate

<body>
<h1>Test</h1>
<p>
You can make text <span class="sign">italic</span> using CSS.
</p>
</body>
</html>

Winterworks
02-22-2009, 01:33 PM
I actually wanted it in an external CSS file. I took the "font-style:italic;" part to the external CSS stylesheet, and it worked. Thanks very much. =)

Still need help with my first problem though.