...

View Full Version : CSS help



THYHN
06-08-2010, 02:08 AM
Ok, so I am coding my web layout, but there's a problem with it. I want the text to appear on top of the image not to the side. I think I may want to use tables for this, but is there a way with css?
here are te codes (Just cut out the parts you may need. if more is needed let me know =)


[index.HTML/PHP]
<div class="title_bar">
<img src="Title_Bar.JPG">Latest Artwork
</div>
[style.css]
div.title_bar
{
margin:-30px;
margin-right:536px;
padding-top:30px;
}

thanks
-Pete

Excavator
06-08-2010, 02:32 AM
Hello THYHN,
The easiest way would be to make Title_bar.JPG a background image of .title_bar.

See background images (http://www.quackit.com/html/codes/html_background_image_codes.cfm).

THYHN
06-08-2010, 02:58 AM
but that makes it repeat all the way across the screen.

mjbasford
06-08-2010, 03:01 AM
if you only set it as the bg for the div it wont do that.

try adding this to your code



.title_bar {
background:url(image.jpg) no-repeat;
(rest of your stuff here)
}

Excavator
06-08-2010, 05:37 PM
but that makes it repeat all the way across the screen.

"no-repeat" makes it show only once. Did you look at the article I linked you to?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum