SwishTalk.com
 

Go Back   SwishTalk.com > .:: THE HELP DESK ::. > » HTML and Backend Scripting

Reply
 
Thread Tools Display Modes
#1   Basic HTML Code Help  
 
Oxygen454's Avatar

Name: 
Oxygen454
Status: Offline
Rank: Advanced Member
Posts: 469
Mood: Chillaxed
Old 12-06-2011, 11:42 PM Reply With Quote


I haven't done and entire website in html in a long time. Im trying to center a background image on my site and nothing seems to be working. Maybe I have the wrong coding?

HTML Code:
body {
  background-image: url("http://www.aldergroveministorage.com/testing/pg1.jpg");
  background-position: 50% 50%;
  background-repeat: no-repeat;
}




               
__________________
~Oxygen454~
Web Designer
Swish Vid3, Max2, Studio, Jukebox, PS/CS2, 3DS Max 08
 
View Public Profile Send a private message to Oxygen454 Visit Oxygen454's homepage! Find all posts by Oxygen454 Add Oxygen454 to Your Contacts
#2    
 
Oxygen454's Avatar

Name: 
Oxygen454
Status: Offline
Rank: Advanced Member
Posts: 469
Mood: Chillaxed
Old 12-07-2011, 12:06 AM Reply With Quote


This code works but it tiles the page... I want the image center of the page...

HTML Code:
<body background=pg1.jpg>


               
__________________
~Oxygen454~
Web Designer
Swish Vid3, Max2, Studio, Jukebox, PS/CS2, 3DS Max 08
 
View Public Profile Send a private message to Oxygen454 Visit Oxygen454's homepage! Find all posts by Oxygen454 Add Oxygen454 to Your Contacts
#3    
 
mobosof's Avatar

Name: 
mobosof
Status: Offline
Rank: Administrator
Posts: 16,173
Mood: fandabbydozy
Old 12-07-2011, 07:12 AM Reply With Quote






               
 
View Public Profile Send a private message to mobosof Visit mobosof's homepage! Find all posts by mobosof Add mobosof to Your Contacts
#4    

Name: 
briansmith
Status: Offline
Rank: Registered User
Posts: 4
Old 02-01-2012, 01:34 AM Reply With Quote


Yes it is very helpful. Thanks for sharing with us.


               
 
View Public Profile Find all posts by briansmith Add briansmith to Your Contacts
#5    

Name: 
peterb
Status: Offline
Rank: SWiSHer
Posts: 14
Old 04-10-2012, 03:16 AM Reply With Quote


Hello Oxygen454,

Try this. It is compatible with many browsers and should do what you want although I didn't see what your image looks like.

Code:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>page Layout</title>

<style>
body {
    background: #FFFFFF;
}

/* 2C425E is used for body to be left white */
#container {
    padding: 0;
    margin: 0;
    width: 100%;
    background: url("http://www.aldergroveministorage.com/testing/pg1.jpg") repeat 0 0;
    height:100% !Important; 
    text-align: center;
}
</style>

</head>
<body>
<div id="container">


the rest of your work here


</div>
</body>
</html>


               
 
View Public Profile Send a private message to peterb Find all posts by peterb Add peterb to Your Contacts
Advertisement:





Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump