Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    4
    Member #
    19466
    Hi,

    I'm trying to learn how to code in XHTML and CSS, and thought I would sign up here for any help. Don't worry, I'll keep all my questions in this thread so I don't end up cluttering this forum category with my newbie questions.

    Anyways, I need some help figuring out how to display an image. I got my background image to work and repeat horizontally, but now I'm trying to add another image but for some reason it will not show up. Here's the code for both the XHTML and CSS. Tips are always welcome.

    XHTML:
    Code:
    <!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" xml:lang="en" lang="en">
        <head>
            <link rel="stylesheet" type="text/css" href="style.css" />
            <title>AnakesMedia</title>
        </head>
        <body>
            <div id="main"></div>
        </body>
    </html>
    CSS:
    Code:
    body {
            background-color: #313131;
            background-image: url('backgroundp.jpg');
            background-repeat: repeat-x;
            }
            
    #main {
            background-image: url('background.jpg');
            }

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Other than you should omit quotes when specifying URLs, I don't see anything particularly wrong. Most likely it's because there's no content in the div. Put some text in it and see what happens.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    4
    Member #
    19466
    Ok, so I got the image to display properly. Now I'm trying to figure out how to add text. I want to add a Copyright footer but don't know how to go about it. I forgot to link my site so you guys could maybe figure out what I might be doing wrong. Here it is.

    Here's the updated code for both files:

    XHTML:
    Code:
    <!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" xml:lang="en" lang="en">
        <head>
            <link rel="stylesheet" type="text/css" href="style.css" />
            <title>AnakesMedia</title>
        </head>
        <body>
            <div id="main"></div>
            <div id="footer"><p>Copyright</p></div>
        </body>
    </html>
    CSS:
    Code:
    body {
            background-color: #313131;
            background-image: url('backgroundp.jpg');
            background-repeat: repeat-x;
            }
            
    #main {
            position: absolute;
            background-repeat: no-repeat;
            top: 0px;
            left: 0px;
            background-image: url('background.jpg');
            width: 730px;
            height: 530px;
            }
        
    #footer {
            text-align: center;
            bottom: 0px;
            color: #005EB6;
            }

  5. #4
    Junior Member
    Join Date
    Jul 2009
    Posts
    4
    Member #
    19466
    Ok, so I got the last question figured out, but now I need some help aligning my main image with my background image so it doesn't seem offset.

    Here's the new code. I tried messing with margins, padding, top, bottom, whatever, but can't figure out what's wrong.

    XHTML:
    Code:
    <!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" xml:lang="en" lang="en">
        <head>
            <link rel="stylesheet" type="text/css" href="style.css" />
            <title>AnakesMedia</title>
        </head>
        <body>
            <div id="main"></div>
            <div id="footer"><p>Copyright &copy 2009 AnakesMedia</p></div>
        </body>
    </html>
    CSS:
    Code:
    body {
            background-color: #313131;
            background-image: url('backgroundp.jpg');
            background-repeat: repeat-x;
            }
            
    #main {
            background-repeat: no-repeat;
            background-image: url('background.jpg');
            width: 730px;
            height: 522px;
            top: 0px;
            left: 0px;
            }
        
    #footer {
            top: 550px;
            text-align: center;
            margin-left: auto;
            margin-right: auto;
            color: #005EB6;
            }

  6. #5
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    I don't want this to come out the wrong way,
    but are you the one offering web development
    on that website? Seems like these problems are
    pretty much website 101. Do you have a portfolio
    of sites you've done yet?

    Not only that, but Google will give you the fastest help.
    I noticed you seem to find the answers before we can respond.

    We love to help out and appreciate good discussions on WDF,
    so you might want to be selective and descriptive about what
    you ask. In any event, welcome to WDF.


  7. #6
    Junior Member
    Join Date
    Jul 2009
    Posts
    4
    Member #
    19466
    Well, I'm just the GFX designer on that site. We have a separate guy for doing the back end programming and another person to actually do the XHTML/CSS code. I thought since they're working on the other stuff I might as well learn how to do some coding myself so I could help them out in the future.

  8. #7
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    OK ... you're doing the right thing then ... learning XHTML/CSS (a good idea to learn).



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com