Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: CSS help

  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS help

    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 =)
    Code:
    [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

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello THYHN,
    The easiest way would be to make Title_bar.JPG a background image of .title_bar.

    See background images.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but that makes it repeat all the way across the screen.

  • #4
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you only set it as the bg for the div it wont do that.

    try adding this to your code


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

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by THYHN View Post
    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?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •